LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-29-2008, 12:58 PM   #1
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Rep: Reputation: 34
how to detect sniffers on the network


I have a lan consisting of windows machines. I use my fedora8 laptop on the same network.
I wish to detect any machine running a sniffer. For that I should detect if any of the interfaces is in promiscuous mode.
I donot want a readymade tool for that, can someone suggest a manual method - I mean a set of commands from the terminal window to do that?
thanks in advance
nishith
 
Old 07-29-2008, 03:24 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Sniffers are passive, like radar detectors.
 
Old 07-29-2008, 03:30 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Unless the sniffer also generates traffic which is distinguishable from traffic the host may also generate ordinarily, you will not be able to detect a sniffer. Promiscuous mode simply means that the interface captures all packets that it detects, not just packets whose destination MAC matches the host interface's MAC and broadcasts/multicasts. Promiscuous mode listening has no influence on the network itself.
--- rod.
 
Old 07-29-2008, 03:51 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Think of it like how a nose works. You smell or sniff the odor in the air but don't return the odor itself when you exhale.
 
Old 07-29-2008, 04:22 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Do you use hubs or switches? If you use switches, then traffic between host A and host B is direct, and another host, host C doesn't see it. Host C can only see broadcasts and it's own traffic.
 
Old 07-30-2008, 05:38 AM   #6
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
sorry guys I think, I need to clarify what I wish to do....
I wish to detect sniffers if any exists on the network. If there are any sniffers they got to be in promiscous mode, so if I find out all users who have their nw card in promiscous mode I am probably close to the solution.
I can use ifconfig , ip , ifpromisc etc utilities to detect if nw card is running on promiscous mode locally, but to detect it over nw I need some other tricks ?
one way is to send a arp request with a bogus mac address to the suspected machine. if it replies it is in promisc mode - isn't that right ?
any more such ideas ? or any other such tips ?
thanks in advance
nishith
 
Old 07-30-2008, 08:50 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by nkd View Post
sorry guys I think, I need to clarify what I wish to do....
I wish to detect sniffers if any exists on the network. If there are any sniffers they got to be in promiscous mode, so if I find out all users who have their nw card in promiscous mode I am probably close to the solution.
I can use ifconfig , ip , ifpromisc etc utilities to detect if nw card is running on promiscous mode locally, but to detect it over nw I need some other tricks ?
one way is to send a arp request with a bogus mac address to the suspected machine. if it replies it is in promisc mode - isn't that right ?
any more such ideas ? or any other such tips ?
thanks in advance
nishith
No you were quite clear, but everyone else above was too. The only way you can tell if the NIC is in promiscuous mode is to get on the box, and see how the driver is loaded. You'd either need to scan the box with SNMP, which may not work, since the driver information may not be in what's returned. Or you can connect to every box, and burp out full driver-information and card settings.

A sniffer does just that...sniffs. Any packets coming across aren't modified, just looked at. It's totally passive. If that box is doing ARP table posioning, you may be able to detect it, but that's an "if".
 
Old 07-30-2008, 08:59 AM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by nkd View Post
one way is to send a arp request with a bogus mac address to the suspected machine. if it replies it is in promisc mode - isn't that right ?
nishith
The fact that a host is listening in promiscuous mode should not affect any behavior of the rest of the network stack. If it does, it is a lousy sniffer.
To help you understand this, you should think back to the early days of networking, when packet sniffers were dedicated Test & Measurement instruments, made by companies such as Agilent (then, Hewlett Packard), Tektronix, etc. One of the tenets of good T&M is that it should have zero effect on the device or system which it is measuring. In the case of network packet sniffers, this means that it should not generate any traffic that would not be otherwise present in the network under test, or if it does, it should be indistinguishable from normal traffic.
Your assumption that any sniffer present on a network would necessarily be running on a Linux (or any other standard OS) host fails to cover the possibility of some dedicated traffic monitoring device, such as the T&M instruments I refer to above. Even a PC hosted device can operate as a dedicated sniffer, without the aid of any OS (I have done this).
Your best hope of detecting any device might come from information gleaned through the management side of managed switches, but at best, you could make only vague inferences.
As jschiwal has already mentioned, switched networks are already quite immune to traffic sniffing, and if you are using switches, instead of hubs, there is little traffic that is visible to a sniffer.
--- rod.
 
Old 07-30-2008, 10:19 AM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
ettercap + plugins..

http://www.irongeek.com/i.php?page=v...-with-ettercap
 
Old 07-30-2008, 11:12 AM   #10
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by farslayer View Post
VERY NICE!
 
Old 07-31-2008, 05:18 AM   #11
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
ok guys here is a technique to detect nw cards that are in promisc mode.
compose an ARP request packet as under :-
Ethernet address of destination FF FF FF FF FF FE
Ethernet address of sender <Own NIC’s Device Address>
Protocol type (ARP = 0806) 08 06
Hardware address space (Ethernet = 01) 00 01
Protocol address space (IPv4 = 0800) 08 00
Byte length of hardware address 06
Byte length of protocol address 04
Opcode (ARP request = 01) 00 01
Hardware address of sender of this packet <Own NIC’s Device Address>
Protocol address of sender of this packet <Own PC's IP Address>
Hardware address of target of this packet 00 00 00 00 00 00
Protocol address of target <IP Address of the machine you suspect to be the sniffer>

You will get a arp reply from the suspected machine if it is running the nw card in promisc mode.
To check all machines in the LAN , write a script to send this crafted arp request packet many times, each time with a different IP address in the protocol address of target.

I tried it out on ethereal and a number of other sniffers , they were all caught or returned a positive with this test.

There is a very good document on this with explanation - "Detection of Promiscuous Nodes Using ARP Packets"
at www.SecurityFriday.com.

thanks
nishith

Last edited by nkd; 07-31-2008 at 05:37 AM.
 
Old 07-31-2008, 11:27 AM   #12
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Not if the sniffer is in hidden arp mod:

http://www.ssi.bg/~ja/#hidden
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify existing network boot cd, cannot detect new network card driver. hocheetiong Linux - Newbie 0 12-05-2007 07:06 AM
Network tool to detect network traffic? cucolin@ Linux - Networking 2 07-30-2007 04:28 PM
what sniffers can see ? medya Linux - Software 13 05-20-2006 10:59 PM
Network icon to detect wireless network is gone Micro420 SUSE / openSUSE 1 01-28-2006 02:14 PM
how to detect sniffers porous Linux - Security 11 01-05-2004 09:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration