How to Monitor Traffic on the Network
This page has been clumsily copied and pasted into this book.
Network monitoring or packet sniffing tools are like many other infosec tools. They can be used for good or evil, it all depends on the intent of the user!
I cannot imagine how you could claim to do LAN troubleshooting without capturing packets at times. At the same time, protocols that move sensitive data as cleartext are commonly used (POP and IMAP with the user's account name and password, and FTP and even TELNET are still used a surprising amount), and the bad guy could easily capture user authentication information (login and password) or other sensitive data (complete contents of shared files, copies of every print job submitted, and so on).
So, you have to use these to maintain your networks, and you need to realize that the bad guys could use these against you.
There are various categories of network monitoring tools:
- Capture and analyze in detail all the packets on the wire or in the air (e.g., Wireshark, formerly called Ethereal). Wireshark is a serious protocol analyzer. And it's free!
- Show general characteristics of the network traffic (e.g., EtherApe or ntop).
- Only show counts of packets to/from the host itself (e.g., iptraf).
Packetstorm has a wonderful archive of network monitoring tools.
LAN Monitoring Tools
UNIX / Linux / BSD / Mac OS X LAN Monitoring Tools
is really the very best tool
short of a dedicated piece of hardware costing
US$ 20,000 or more.
Get it from
- My biggest complaint with Wireshark is the difficulty of building filter strings, particularly for new users. Note that Wireshark uses the same filter syntax as tcpdump, and that syntax is well documented on the tcpdump manual page. Also check out the books on packet analysis with Wireshark.
- Another problem is that Wireshark can be difficult to build from source. See my OpenBSD page for details of how to build Wireshark on BSD.
Other tools include:
- ntop is included with Linux, BSD, and addable to others (click here). It shows the general characteristics of traffic on the network, showing the packet and byte rate broken out by application layer protocols.
- EtherApe is another tool to characterize general traffic characteristics.
- iptraf shows you counts of packets to/from the host where you run it, broken out by protocol type.
- Clownix is a Linux-specific tool.
- Other classic tools include Esniff, SniffIt, solsniff (For Solaris), Etherfind (for ancient SunOS 4.1.X), and Snoop (comes with Solaris). If you capture traffic with snoop, you can use Wireshark to decode and display it. But why not just use Wireshark in the first place.
DOS/Windows LAN Monitoring Tools
also works on Windows,
although you'll also need to add the
Other tools include:
- ETHDUMP captures packets, then ETHLOAD loads them up and lets you browse.
Commercial tools are available:
- Netscout's products (formerly Network General, bought for a while by Network Associates) are top-of-the-line in function and price.
- Lancope makes security and network monitoring tools.
- Network Observer also supports WLAN capture and analysis.
- Klos Technologies, Inc. has PacketView.
- Frontline Test Equipment, +1-800-359-8570.
- Microsoft's Net Monitor might be of some use.
Wireless LAN/WAN Monitoring and Attacks on WEP and WPA
Wikipedia has a very useful introduction to wireless networking and the security issues.
Note that wireless monitoring tools can be extremely dependent on chipset. Make sure that your planned software and WLAN card will get along!
The Trifinite Group has information on wireless security, including RFIDiot and other RFID security tools and information at trifinite.org.
Also see the COMSEC section of another page of mine for details on how GSM encryption can be broken. Really. It can. GSM salesmen don't want you to know this, but it's true.
Free wireless sniffers for Linux and BSD
is great for WLAN surveillance.
It displays all wireless access points (WAPs)
and WLAN nodes it detects, showing channel,
use of encryption, signel strength and more.
Get it from
AirSnort captures wireless LAN packets and then recovers the encryption keys. Get it from freecode.com and airsnort.shmoo.com.
BSD-Airtools is a BSD-specific 802.11 auditing toolkit.
Aircrack-ng Aircrack (old) WaveStumbler Wellenreiter
Free wireless sniffers for Android
Fing — Network Tools
Shark for Root —
tshark for Android
WiEye — WiFi Scanner
Wigle WiFi Wardriving
Network Signal Info
Meraki WiFi Stumbler
SDR Touch — 50-2200 MHz receiver
Free wireless sniffers for Mac OS X
looks to be the most powerful utility, with
all the features of the other MacOS ones and even more.
Free wireless sniffers for Windows
Net Stumbler Aircrack-ng Aircrack (old)
Commercial tools — divided into categories:
Packet Sniffing and War-Driving Tools
- Security System War Driving Kit from AirTouch Network includes sniffing software, an 802.11b adapter, and antenna.
- Vulnerability Assessment Tools — more than just sniffing
- Traffic Monitoring and Analysis Tools — and also consider the free tool Wireshark and
- WLAN Intrusion Detection Tools
WLAN attack tools:
- WEP is, of course, well known to be weak. In 2007 three researchers announced an attack that required just 1 minute of WLAN data collection and 3 seconds of cryptanalysis on a 1.75 GHz Pentium. See the announcement and their detailed paper.
- A WPA attack was announced in late 2008. It does not recover the key (allowing the decryption of all data) but just allows the decryption of individual short packets.
- Black Alchemy's Fake AP "generates thousands of counterfeit 802.11b access points. Hide in plain sight amongst Fake AP's cacophony of beacon frames. As part of a honeypot or as an instrument of your site security plan, Fake AP confuses Wardrivers, NetStumblers, Script Kiddies, and other undesirables."
- Josh Wright's file2air
- Void11 implements some basic 802.11 attacks. Network DOS: flood WLAN with de-authentication packets and spoofed BSSIDs. Access point DOS: flood APs with authentication packets and random station addresses.
Antennas, access point modification, building your own WLAN hardware, etc.
- A great collection of antenna pages.
- Loads more info.
- Connecting to Orinoco WLAN cards.
- Many antenna designs.
- Build a tin can waveguide WiFi antenna.
- Cantenna comparisons.
- Helical antenna.
- Trevor Marshall's slot waveguide antennas.
- Trevor Marshall's tiny biquad antenna, which can be used as a feed for a surplus satellite TV dish.
- The "cakepan" 2.3 GHz antenna design.
- Several more 2.3 GHz antenna designs.
- Ham radio info, including 802.11 antennas.
WPA2 / 802.11i
Here's my page on setting up WPA2 / 802.11i wireless security.
Beware a false sense of security based on switches
A switch can improve LAN throughput immensely,
but it does not really provide security.
arpspoof,which uses ARP trickery to confuse hosts about the mappings between IP and MAC addresses. The attacker can use
arpspoofto have all datagrams between specified pairs of hosts sent to a sniffing host. The sniffer grabs copies and possibly modifies contents before sending the frames back through the switch to the legitimate hardware addresses. Get the
dsnifftoolkit from monkey.org or packetstormsecurity.com.
Also be aware that some tools (
webspy,for example) understand application-layer protocols and make it easy to capture and analyze
FTPlogins and passwords, web traffic, mail, etc.
Dsniffis a great tool for password capture. You must understand that your attackers all know this and will use it if possible.
Legitimate cybersecurity applications of password
or other sensitive information captuer and display
- An easy but very impressive demonstration of just how insecure things are when cleartext protocols like POP, IMAP, HTTP and so on are used.
- A test to see how bad things are, or to test whether the new user tools really enforce use of encrypted connections only or if they silently roll back to insecure network communication.
Tapping Optical Fiber
Optical fiber can be tapped without splicing.
You can read the data by removing some of the sheath
and gently bending the fiber in a bend coupler.
You can supposedly buy them for a few hundred US$,
optical+fiber+tap at eBay.
There are claims that optical taps have been found on police networks in the Netherlands and Germany, and the FBI investigated one discovered on Verizon's network in the US.
For more see:
- Techworld article with a nice overview.
Marketing material from companies selling
expensive OSI Layer-1
encryption hardware or fiber monitoring hardware:
- NetworkIntegrity Systems only sells their Interceptor Optical Network Security System to the U.S. Government. It detects unauthorized tampering by monitoring spare fibers.
- Blind Man's Bluff, by Sharry Sontag and Christopher Drew, describes U.S. Navy fiber tapping operations on the floor of the Sea of Okhotsk and elsewhere.
Eavesdropping Via Light, Audio, and Other Unusual Means
Interactive keyboard use can be "eavesdropped" by means you might not expect.
Consider the relative difficulty or ease of touch-typing different character sequences on a standard QWERTY keyboard: F-J would be very fast (home key on left hand then home key on right hand, easy and fast) while 2-X would be very slow (extreme reaches for the same finger, awkward and slow).
So, a good typist may have a high aggregate rate of characters per minute, but the inter-character spacings are going to vary. A given two-character or longer sequence is not always going to be exactly the same, but over time the distribution is going to be fairly distinctive.
Measure the inter-character times and you have the data needed for bigram analysis. You won't recover 100% of the cleartext, but with adequate data and quality typing of large blocks of text, you will recover some.
So how can you measure the inter-character times?
- Shine a laser off the reflective surface of a laptop cover (that is, the surface opposite the display) or an external keyboard:
- Detect electrical noise:
- Detect keypresses acoustically — that is, listen to the clicking:
- If you can observe the packets of an SSH connection, even though they are encrypted you can get using timing information and recover some information that way. See the paper "Timing analysis of keystrokes and timing attacks on SSH" Also see the paper "Inter-Packet Delay Based Correlation for Tracing Encrypted Connections Through Stepping Stones" (2002)
- Similarly, observe the network activity lights on router or Ethernet switch ports. Sit in the next building with a telescope.... See the paper "Information Leakage from Optical Emenations"
Like so much of information theory, this isn't entirely new. A Morse code operator might be recognized by a distinctive "fist" or slight imperfection in their keying cadence.
There there are more "movie-style" threats. Jan-Michael Frahm of the University of North Carolina at Chapel Hill is the head of the 3D Computer Vision Group there. His group has developed their iSpy system, which can identify text typed on touchscreens from video footage of the screen itself or of its reflection in windows or even in sunglasses. Their paper is available here. Their system was described in New Scientist, 29 October 2011, pp 22-23.
They say that they can use video from an ordinary mobile phone up to 3 meters away, but a digital SLR camera shooting HD video could read screens up to 60 meters away. Their approach takes advantage of the fact that the targeted platforms magnify the virtual keys. It isn't perfect, but they get over 90% copy of what is typed on these ever more prevalent interfaces.
Other Side-Channel Attacks
The paper RSA Key Extraction via Low-Bandwidth Acoustic Cryptanalysis explains how the authors extracted full 4096-bit RSA decryption keys from laptop computers running the GnuPG implementation of RSA by listening to the high-pitched sounds generated by vibration of components within the processor. An ordinary smart phone could be used to collect the audio. Similar attacks can use the electrical potential of the computer chassis, possibly using the ground wires at the remote end of VGA, USB or Ethernet cables. Non-technical overviews are available here and here.
The significant attacks on virtualization security use side-channel attacks. See this page for the details.
Detecting Packet Sniffing Attacks
For suggestions on spotting sniffer attacks, see the discussion in an older CERT advisory. One method would be to send out an Ethernet frame to MAC destination address that is not in use on your network. Inside of that is an IP datagram to which a typical host would reply. The NIC would normally have filtered out (that is, ignored or dropped) that frame because it was sent to some other unicast MAC address. But since its chipset is in promiscuous mode, the filtering is turned off and the IP datagram is passed to the operating system. The operating system then replies, and now you know that host has its interface in promiscuous mode. The sniffer detection relies on tricking the host with a promiscuous interface into reporting itself.
To detect network interfaces in promiscuous mode:
- The best tools would be:
- Two other tools require that they be run on the attacking host during an attack — not very likely! But Purdue's CERIAS research group has two tools on their FTP server: cpm and ifstatus.