If you’re planning on taking the Security+ exam, you should have a good understanding of network traffic and how to capture and analyze packets on a network.
For example, can you answer this question?
Q. A network administrator needs to identify the type of traffic and packet flags used in traffic sent from a specific IP address. Which of the following is the BEST tool to meet this need?
A. UTM security appliance
B. Router logs
C. Protocol analyzer
D. Vulnerability scan
More, do you know why the correct answer is correct and the incorrect answers are incorrect? The answer and explanation is available at the end of this post.
Sniffing with a Protocol Analyzer
A protocol analyzer can capture and analyze packets on a network. The process of using a protocol analyzer is sometimes referred to as sniffing or using a sniffer. Both administrators and attackers can use a protocol analyzer to view IP headers and examine packets. For example, administrators can use a protocol analyzer to troubleshoot communication issues between network systems, or identify potential attacks using manipulated or fragmented packets.
Attackers can use a protocol analyzer to capture data sent across a network in cleartext. One of the ways they do so is by connecting an unauthorized switch within a network to capture traffic and forward it to a system running a protocol analyzer. If cabling isn’t protected, they might be able to simply connect a switch above a drop-down ceiling that wouldn’t be detected easily.
Capturing Network Traffic
Wireshark is a free protocol analyzer that you can download from here: http://www.wireshark.org/. The following figure shows Wireshark after it captured packets transmitted over the network. It includes about 150 packets and has packet 121 selected in the top pane. The top pane shows the source and destination IP addresses and the Server Message Block (SMB) protocol. Many networks use SMB to send files over the network, and this packet includes the contents of that file. The middle pane shows details from this packet with the Internet Protocol Version 4 header information partially expanded. The bottom pane shows the entire contents of the packet displayed in hexadecimal and ASCII characters.
Figure 1: Wireshark capture
Although it can be tedious to analyze a packet capture, there is a lot of information in it for anyone willing to take the time to do so. Occasionally, attackers manipulate flags (arrow 1) within the headers for different types of attacks, and the protocol analyzer allows you to verify header manipulation attacks. You can also see the source and destination IP addresses (arrow 2) within the IP header field. You can expand the Ethernet II section to show the media access control (MAC) addresses of the source and destination computers.
Notice that you can view the username (Darril) and password (P@ssw0rd) in the bottom pane (arrow 3) because SMB sends it in cleartext. However, if an application encrypted the data before sending it across the network, it would not be readable.
Although this packet capture only includes about 150 packets, a packet capture can easily include thousands of packets. Wireshark includes filters that administrators use to focus on specific types of traffic. These filters also allow them to quantify the traffic. For example, they can determine the percentage of SMTP traffic or HTTP traffic on the network.
Source of Traffic
In addition to seeing a capture using the Wireshark graphical interface, you can also view them as text files (and that’s how they’ll typically be referenced on any exam). The information in the text file is usually limited using filters, but normally includes the time, source information labeled as src, destination information labeled as dst, and sometimes protocol information. Here’s an example:
22:33:44, src 192.168.5.55:3389, dst 192.168.7.17:8080, syn/ack
The time is shown in a 24-hour clock as 10:33 p.m. and 44 seconds. Notice the source and destination include an IP address and a port number. This reiterates the importance of knowing the ports. It also shows you how you can identify the source of traffic. For example, if an attacker is manipulating or fragmenting packets as part of an attack, you can use the src IP address to identify the potential source of the attack.
It’s worth noting that the source IP address doesn’t always identify the actual attacker. For example, attackers often take control of other computers and launch attacks from them without the knowledge of the owner. Similarly, Port Address Translation (PAT) translates public and private IP addresses. If the traffic goes through a device using PAT, the protocol analyzer only captures the translated IP address, not the original IP address.
When using a protocol analyzer, you need to configure the network interface card (NIC) on the system to use promiscuous mode. Normally, a NIC uses non-promiscuous mode and only processes packets addressed directly to its IP address. However when you put it in promiscuous mode, it processes all packets regardless of the IP address. This allows the protocol analyzer to capture all packets that reach the NIC.
Remember this
Administrators use a protocol analyzer (or sniffer) to capture, display, and analyze packets sent over a network. It is useful when troubleshooting communications problems between systems. It is also useful to detect attacks that manipulate or fragment packets. A capture shows information such as the type of traffic (protocol), flags, source and destination IP addresses, and source and destination MAC addresses. The NIC must be configured to use promiscuous mode to capture all traffic.
Q. A network administrator needs to identify the type of traffic and packet flags used in traffic sent from a specific IP address. Which of the following is the BEST tool to meet this need?
A. UTM security appliance
B. Router logs
C. Protocol analyzer
D. Vulnerability scan
Answer is C. A protocol analyzer (or sniffer) can capture traffic sent over a network and identify the type of traffic, the source of the traffic, and protocol flags used within individual packets.
A unified threat management (UTM) security appliance combines multiple security solutions into a single solution but doesn’t typically capture traffic.
Router logs identify the type of traffic going through it, but do not include packet flag data.
A vulnerability scan identifies vulnerabilities on a network.