Kismet display of wireless network monitoring.

Network Monitoring and Packet Sniffing Tools

How to Monitor Traffic on the Network

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! Let's see how to capture packets from both wired and wireless networks using free software. 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 carry the user's account name and password in cleartext, and FTP and even TELNET are still used more than you might expect. The bad guy could easily capture user authentication information like the login and password, or other sensitive data such as the complete contents of shared files, copies of every print job submitted, and more.

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 to solve various types of problems:

Capture and analyze in detail all the packets on the wire or in the air with Wireshark. Wireshark is a serious protocol analyzer. And it's free!

Show general characteristics of the network traffic with ntop or EtherApe.

Only show counts of packets to/from the host itself with iptraf-ng.

Packetstorm has a wonderful archive of network monitoring tools.

LAN Monitoring Tools

UNIX / Linux / BSD / Mac OS X LAN Monitoring Tools

Wireshark, formerly called Ethereal, is really the very best tool short of a dedicated piece of hardware costing several thousand dollars. Get it from wireshark.org.

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 issue is that Wireshark can be difficult to build from source. See my OpenBSD page for details of how to build Wireshark on BSD.

ntop is included with Linux, BSD, and addable to other operating systems. 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. It's a graphical network monitor for Unix-family operating systems. Hosts and links change in size with traffic. Color coded protocols display. It can filter traffic to be shown, and can read traffic from a file as well as live from the network.

iptraf-ng. is a console-based network statistics utility. It shows you counts of packets to/from the host broken out by protocol type and TCP/UDP ports.

Other classic tools include 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?

Windows LAN Monitoring Tools

Wireshark also works on Windows, although you'll also need to add the WinPcap port of libpcap.

Other tools include ETHDUMP to capture packets, then ETHLOAD to load them up and browse through the capture.

Commercial tools are also 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.

Kismet sniffing packets and detecting wireless activity.  Running in a BSD xterm window.

Kismet running in an OpenBSD xterm window, sniffing packets and observing wireless network activity at the Greyhouse coffeeshop in West Lafayette, Indiana. And yes, they really want you to use their WLAN, so you'll hang out there and buy more coffee.

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.

Also see the COMSEC section of another page of mine for details on how mobile phone encryption can be broken. Really. It can. Mobile phone salesmen don't want you to know this, but it's true.

D-Link TM-G5240 WLAN wireless router, Cisco EZXS88W switch, MFJ-1278 multi-mode data controller.

D-Link TM-G5240 802.11g wireless router, Cisco EZXS88W 8-port Ethernet switch, and MFJ-1278 multi-mode data controller.

Gregory Evans simply copied and pasted this entire page of mine to make up a large section of Chapter Two of his book How To Become The World's Number 1 Hacker. He included a couple of misspellings or wording errors that I hadn't happened to notice (now fixed here), and, most clumsily, the sentence "Also see the COMSEC section of another page of mine for details on how GSM encryption can be broken."

Evans' book contains a lot of plagiarized text in addition to untrue claims about the background and experience of its "author". See the detailed analysis of his plagiarism here and here, and an investigation of his background here. Meanwhile, you can enjoy my original version with its corrections and updates for free!

Free wireless sniffers for Linux and BSD

Kismet 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 freecode.com and kismetwireless.net.
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 Shark Reader WiEye — WiFi Scanner WiFi Tracker Wigle WiFi Wardriving Network Signal Info Meraki WiFi Stumbler SDR Touch — 50-2200 MHz receiver

Free wireless sniffers for Mac OS X

KisMAC looks to be the most powerful utility, with all the features of the other MacOS ones and even more.
MacStumbler iStumbler

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

Vulnerability Assessment Tools — do more than just sniffing:
SecPoint's Portable Penetrator Netscout AirMagnet Handheld/Laptop Analyzer

Traffic Monitoring and Analysis Tools — use the free tool Wireshark

WLAN Intrusion Detection Tools
Air Defense StillSecure Border Guard

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.
Announcement 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.
Ars Technica article Authors' paper SANS report Gizmodo report

Josh Wright's file2air is a command-line utility for injecting IEEE 802.11 frames from files.

Void11 implements some basic 802.11 attacks.

Antennas, access point modification, building your own WLAN hardware, etc.

Antenna designs Building antennas and access points Orinoco WLAN antennas Tin can waveguide WiFi antenna Cantenna comparisons Slot waveguide antennas Tiny biquad antenna Cantenna 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. The dsniff toolkit includes arpspoof, which uses ARP trickery to confuse hosts about the mappings between IP and MAC addresses. The attacker can use arpspoof to 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 dsniff toolkit from monkey.org or packetstormsecurity.com.

Also be aware that some tools (dsniff, mailsnarf, webspy, for example) understand application-layer protocols and make it easy to capture and analyze telnet and FTP logins and passwords, web traffic, mail, etc. Dsniff is a great tool for password capture. You must understand that your attackers all know this and will use it if possible.

There are legitimate cybersecurity applications of password or other sensitive information capture and display! One use is to demonstrate to the naïve just how insecure cleartext protocols such as POP, IMAP, FTP, TELNET, etc really are.

Packet capture is also crucial when testing to verify that new tools really do enforce the use of encryption and don't silently roll back to cleartext mode.

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$, search for 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.

Techworld published a nice overview.

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.

TEMPEST

TEMPEST is a classified specification for shielding both electromagnetic and acoustical signals, and for exploiting the emenations of targets. Parts of the specification are public, but many details are classified. See the Wikipedia page for a good overview.

Given the classified nature, I am very skeptical of the accuracy or completeness of either of these. Especially since one of them describes something from 1999 as "Breaking News". Caveat lector. As the saying goes:
Those who know, don't say.
Those who say, don't know.

SST: Secure Systems & Technologies "The Complete, Unofficial TEMPEST Information Page

Eavesdropping Via Light, Audio, and Other Unexpected 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?

1: Shine a laser at the reflective surface of a laptop cover (that is, the surface opposite the display) or an external keyboard.
hackaday.com cnet.com
Obviously, do this with an infrared laser or it will be terribly obvious to people! Even an infrared laser will be obvious to security cameras. Point your TV remote at your smart phone camera to see what I mean.

2: Detect electrical noise:
Researchers' page hackaday.com, #1 hackaday.com, #2

3: Use both wired and wireless signals:
Compromising Electromagnetic Emanations of Wired and Wireless Keyboards

4: Detect keypresses acoustically. That is, listen to the clicking:
"Keyboard Acoustic Emanations Revisited" A description Bruce Schneier's discussion "A Closer Look at Keyboard Acoustic Emanations: Random Passwords, Typing Styles and Decoding Techniques"

5: Use electrical signals plus timing. The Soviet Union used this against the U.S. in the mid 1970s into the mid 1980s. Izvestia reported in 2013 that Russian security services were buying more typewriters to avoid the increased risk of electrical ones.
1987 New York Times article Internal NSA document Public NSA document Ars Technica story

6: Observe the timing of packets of an SSH connection. Even though they are encrypted you can use the packet timing. Interactive SSH does remote echo, so it's generally one packet per keypress. You can recover some information that way. See these papers:
"Timing analysis of keystrokes and timing attacks on SSH" "Inter-Packet Delay Based Correlation for Tracing Encrypted Connections Through Stepping Stones" (2002)

7: 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 Emanations"

Vladimir Putin in mirrored sunglasses.

Never send a human to do a machine's job. But watch those reflections, Vladimir Vladimir'ich.

The Air-Gap Research Page of the Cyber-Security Research Center at the Ben-Gurion University of the Negev has more along these lines. Some of it assumes that the attacker can replace router and switch firmware, or place smart phones with rootkitted baseband firmware into the air-gapped target area.

I wait for the papers "Information Leakage via Observations of Message-Bearing Avian Flight Patterns", and "Information Leakage via Carefully Times Emissions of Smoke from Motherboard Components", all of these to be mitigated by the replacement of all LED indicator lamps with neon bulbs.

You can also watch for the distinctive way that hand position distorts Wi-Fi signals. See the paper: Keystroke Recognition Using WiFi Signals

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.

Then 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: