Monday, March 12, 2012

How to Identify Network Abuse with Wireshark


Wireshark is the swiss army knife of network analysis tools. Whether you’re looking for peer-to-peer traffic on your network or just want to see what websites a specific IP address is accessing, Wireshark can work for you.
We’ve previously given an introduction to Wireshark. and this post builds on our previous posts. Bear in mind that you must be capturing at a location on the network where you can see enough network traffic. If you do a capture on your local workstation, you’re likely to not see the majority of traffic on the network. Wireshark can do captures from a remote location — check out our Wireshark tricks post for more information on that.

Identifying Peer-to-Peer Traffic

Wireshark’s protocol column displays the protocol type of each packet. If you’re looking at a Wireshark capture, you might see BitTorrent or other peer-to-peer traffic lurking in it.
You can see just what protocols are being used on your network from the Protocol Hierarchy tool, located under the Statistics menu.
This window shows a breakdown of network usage by protocol. From here, we can see that nearly 5% of packets on the network are BitTorrent packets. That doesn’t sound like much, but BitTorrent also uses UDP packets. The nearly 25% of packets classified as UDP Data packets are also BitTorrent traffic here.
We can view only the BitTorrent packets by right-clicking the protocol and applying it as a filter. You can do the same for other types of peer-to-peer traffic that may be present, such as Gnutella, eDonkey, or Soulseek.
Using the Apply Filter option applies the filter “bittorrent“. You can skip the right-click menu and view a protocol’s traffic by typing its name directly into the Filter box.
From the filtered traffic, we can see that the local IP address of 192.168.1.64 is using BitTorrent.
To view all the IP addresses using BitTorrent, we can select Endpoints in the Statisticsmenu.
Click over to the IPv4 tab and enable the “Limit to display filter” check box. You’ll see both the remote and local IP addresses associated with the BitTorrent traffic. The local IP addresses should appear at the top of the list.
If you want to see the different types of protocols Wireshark supports and their filter names, select Enabled Protocols under the Analyze menu.
You can start typing a protocol to search for it in the Enabled Protocols window.

Monitoring Website Access

Now that we know how to break traffic down by protocol, we can type “http” into the Filter box to see only HTTP traffic. With the “Enable network name resolution” option checked, we’ll see the names of the websites being accessed on the network.
Once again, we can use the Endpoints option in the Statistics menu.
Click over to the IPv4 tab and enable the “Limit to display filter” check box again. You should also ensure that the “Name resolution” check box  is enabled or you’ll only see IP addresses.
From here we, can see the websites being accessed. Advertising networks and third-party websites that host scripts used on other websites will also appear in the list.
If we want to break this down by a specific IP address to see what a single IP address is browsing, we can do that too. Use the combined filter http and ip.addr == [IP address]to see HTTP traffic associated with a specific IP address.
Open the Endpoints dialog again and you’ll see a list of websites being accessed by that specific IP address.

This is all just scratching the surface of what you can do with Wireshark. You could build much more advanced filters, or even use the Firewall ACL Rules tool from our Wireshark tricks post to easily block the types of traffic you’ll find here.

No comments:

Post a Comment