CYBER SECURITY • SECURITY TOOLS AND HANDS-ON SKILLS

Wireshark Basics — Use Wireshark conceptually to inspect traffic and identify protocol fields (intro)

Learn to dissect live network traffic at the packet level to understand protocols and detect anomalies.

Historical Context & Motivation

Before graphical packet analyzers existed, network engineers and security professionals relied on command-line utilities like tcpdump to capture and display raw network traffic. While powerful, these tools demanded expertise in reading hexadecimal output and manually correlating bytes to protocol field definitions. The need for a more accessible, visual approach to deep packet inspection drove the creation of a new class of network analysis tools. Understanding the evolution from raw hex dumps to structured, color-coded protocol dissection helps contextualize why Wireshark became the industry-standard tool for security analysts, network engineers, and computer science researchers alike.

1988
tcpdump Released
The first widely adopted command-line packet capture tool for Unix systems, built on the Berkeley Packet Filter (BPF) architecture, became the foundational standard for network traffic analysis.
1998
Ethereal Created
Gerald Combs wrote Ethereal, the first open-source graphical packet analyzer, to solve the problem of needing an affordable protocol analysis tool that could visually dissect packets across hundreds of protocols.
2006
Ethereal Becomes Wireshark
Due to trademark issues, the project was renamed Wireshark. The tool had already become the de facto standard for network troubleshooting and security analysis in both academic and professional environments.
2015
Wireshark 2.0 — Qt Interface
A complete UI rewrite using the Qt framework modernized the interface, improving cross-platform support and usability while retaining the same powerful dissection engine underneath.
2023+
Modern Protocol Coverage
Wireshark now supports dissection of over 3,000 protocols — including QUIC, gRPC, and TLS 1.3 — and remains essential for cybersecurity incident response, forensic analysis, and network research.

The central question Wireshark addresses is deceptively simple: what is actually happening on the wire? Every application, service, and system call that touches the network produces structured data encapsulated in protocol headers and payloads. Without a tool to capture and decode that traffic, diagnosing misconfigurations, detecting intrusions, and verifying protocol implementations would require painstaking manual analysis of raw binary data. Wireshark transforms this problem into an interactive, searchable, filterable exploration of network communication.

Core Principles & Definitions

To use Wireshark effectively, you need to internalize several foundational concepts that govern how network traffic is captured, structured, and interpreted. These principles map directly to the OSI and TCP/IP reference models you have likely encountered in networking courses, but here the focus shifts from theoretical layering to practical byte-level inspection. Wireshark operates by placing a network interface into promiscuous mode, which allows the capture of all frames traversing the local network segment rather than only those addressed to the host machine. Once captured, each frame is passed through Wireshark's protocol dissectors — modular decoders that parse bytes into named fields according to the relevant RFC or specification.

1

Packet Capture (pcap)

The process of intercepting and recording network frames using the libpcap (Unix) or Npcap (Windows) library. Captured data is stored in .pcapng files for offline analysis.
2

Protocol Dissection

Wireshark's engine interprets raw bytes by matching them against known protocol specifications. Each layer of encapsulation — Ethernet, IP, TCP, HTTP — is decoded and presented hierarchically.
3

Display Filters

Boolean expressions (e.g., tcp.port == 443) that narrow the visible packet list after capture. These are distinct from capture filters, which limit what is recorded.
4

Three-Pane Interface

Wireshark's main window is divided into a packet list (summary rows), a protocol detail tree (hierarchical field view), and a hex/bytes pane showing the raw octets with corresponding highlights.
5

Encapsulation & Layering

Each protocol wraps the next layer's data as its payload. Wireshark visually separates these layers, letting you expand each header independently and correlate fields to their byte positions.
KEY TAKEAWAY
Think of Wireshark like a translator at a busy international conference. Every participant speaks a different language (protocol), and the translator (dissector) converts each speech into a structured transcript you can search, highlight, and cross-reference. Without the translator, you'd hear only a stream of unintelligible sounds — the raw bytes on the wire.

Visual Explanation — The Three-Pane Interface

The defining feature of Wireshark's user experience is its three-pane layout, which simultaneously presents packet summaries, protocol hierarchies, and raw bytes. Understanding the relationship between these three views is essential for efficient traffic analysis. The diagram below illustrates how a single captured frame is represented across all three panes, showing how selecting a field in the detail pane highlights the corresponding bytes in the hex pane.

The three panes are interconnected: selecting packet #2 in the Packet List (①) populates the Protocol Detail tree (②). Expanding the TCP header and clicking a field highlights the corresponding raw bytes in the Hex Pane (③).

In the diagram above, notice how packet #2 (a TCP SYN-ACK) is selected in pane ①. The protocol detail tree in pane ② shows each encapsulation layer as an expandable node — Frame metadata, Ethernet II, IPv4, and TCP. When the TCP layer is expanded, individual fields such as source port, destination port, flags, sequence number, and window size are displayed with their decoded values. Simultaneously, pane ③ highlights the exact bytes at offset 0x0020 that correspond to the TCP header, providing a direct mapping from human-readable field names to their raw binary representation. This three-way linkage is what makes Wireshark uniquely powerful: you can always trace any protocol field back to its precise byte position in the frame.

How Packet Capture & Dissection Work

Understanding Wireshark's internal pipeline — from the moment a frame arrives at the network interface card (NIC) to its fully decoded representation on screen — clarifies why certain design choices were made and what limitations exist. The capture and dissection process involves several distinct stages, each corresponding to a software or hardware boundary.

Capture Pipeline

When you start a capture in Wireshark, the tool instructs the operating system's network stack to place the selected NIC into promiscuous mode. In this mode, the NIC forwards all frames it observes on the link — not just those addressed to the host's MAC address. On shared media (e.g., a hub or a mirrored switch port), this captures traffic between other hosts as well. The captured frames pass through a capture filter (compiled into BPF bytecode) that runs in kernel space for performance, discarding frames that do not match the filter expression before they are copied to user space.

Dissection Engine

Once a frame reaches user space, Wireshark's dissection engine takes over. The engine maintains a table of protocol dissectors — one for each recognized protocol. The process begins with the link-layer dissector (typically Ethernet), which reads the EtherType field to determine which network-layer dissector to invoke (e.g., 0x0800 → IPv4). That dissector in turn reads the Protocol field in the IP header (e.g., 6 → TCP, 17 → UDP) and chains to the appropriate transport-layer dissector. This recursive hand-off continues until no further sub-dissector can be identified, at which point the remaining bytes are displayed as raw payload data.

FRAME SIZE RELATIONSHIP
Frame Size = Σᵢ Header_i + Payload
Where Header_i is the header size (in bytes) of layer i and Payload is the application data. For example, a typical HTTP GET over Ethernet: 14 (Ethernet) + 20 (IPv4) + 20 (TCP) + N (HTTP) = 54 + N bytes.
MAXIMUM TRANSMISSION UNIT
MTU_Ethernet = 1500 bytes (payload)
The standard Ethernet MTU constrains the maximum IP datagram size to 1500 bytes. With a 20-byte IPv4 header and 20-byte TCP header, the maximum TCP segment data (MSS) is 1500 − 20 − 20 = 1460 bytes. Wireshark flags packets exceeding the MTU and reassembles IP fragments.
⚠️ Capture Filters vs. Display Filters
A common point of confusion: capture filters use BPF syntax (e.g., host 10.0.0.1 and port 80) and are applied before packets are written to the buffer — frames that don't match are lost forever. Display filters use Wireshark's own syntax (e.g., http.request.method == "GET") and are applied after capture — all data remains in the buffer and can be re-filtered at any time.

Protocol Field Breakdown — Ethernet, IP, TCP

A critical skill in packet analysis is recognizing and interpreting the key fields within common protocol headers. This section dissects the three most frequently encountered headers — Ethernet II, IPv4, and TCP — at the byte level. The SVG diagram below shows how these headers nest within a single Ethernet frame and which offsets correspond to each field.

Each protocol header occupies a specific byte range within the frame. The Ethernet header (bytes 0–13) wraps the IPv4 header (bytes 14–33), which wraps the TCP header (bytes 34–53). Byte 54 onwards contains the application payload.
Key protocol fields and their security implications
ProtocolKey FieldSizeSecurity Relevance
Ethernet IIDst MAC6 bytesDetect ARP spoofing by correlating MAC-to-IP bindings
Ethernet IIEtherType2 bytesIdentify unexpected protocols (e.g., 0x86DD for IPv6 on an IPv4-only network)
IPv4TTL1 byteLow TTL values may indicate traceroute probes or TTL-based evasion
IPv4Src / Dst IP4 + 4 bytesSpot IP spoofing, C2 beaconing, or connections to known-bad IPs
TCPFlags1 byte (6 bits)Detect SYN floods, XMAS scans, null scans, and other flag-based attacks
TCPSrc / Dst Port2 + 2 bytesIdentify services, detect non-standard port usage (e.g., SSH on port 8080)

Worked Example — Analyzing a TCP Three-Way Handshake

Let's walk through how you would use Wireshark to identify and verify a TCP three-way handshake in a captured packet trace. This is one of the most common analysis tasks and demonstrates how to correlate fields across multiple packets. Suppose you have captured traffic from a client (192.168.1.10) connecting to a web server (93.184.216.34) on port 80.

Identifying a TCP Three-Way Handshake in Wireshark
1
Step 1 — Apply a Display FilterIn the display filter bar, type tcp.flags.syn == 1 && ip.addr == 93.184.216.34 and press Enter. This filters the packet list to show only packets with the SYN flag set that involve the target server. You should see two packets: the initial SYN from the client and the SYN-ACK from the server.
Filtered view shows packets #1 (SYN) and #2 (SYN,ACK)
2
Step 2 — Inspect Packet #1 (SYN)Click on packet #1 in the packet list. In the protocol detail pane, expand the TCP layer. Verify the following: Source Port = 49152 (ephemeral), Destination Port = 80 (HTTP), Flags = 0x002 (SYN only), and Sequence Number = 0 (relative). The SYN flag indicates the client is requesting a connection.
Confirmed: SYN flag set, Seq = 0, Dst Port = 80
3
Step 3 — Inspect Packet #2 (SYN-ACK)Select packet #2. The TCP flags should read 0x012 (SYN + ACK). The Acknowledgment Number should be 1, indicating it acknowledges the client's SYN (Seq 0 + 1). The server's own Sequence Number is 0 (relative). The source port is now 80, and the destination port is 49152 — the reverse of packet #1.
Confirmed: SYN+ACK flags, Ack = 1, server Seq = 0
4
Step 4 — Remove the SYN Filter and Locate the ACKChange the display filter to tcp.stream eq 0 to see all packets in this TCP stream. Packet #3 should show flags 0x010 (ACK only) from the client. Its Sequence Number = 1 and Acknowledgment Number = 1, confirming it acknowledges the server's SYN. The three-way handshake is now complete.
Three-way handshake verified: SYN → SYN-ACK → ACK
5
Step 5 — Correlate with the Bytes PaneWith packet #2 selected, click on the 'Flags' field in the protocol detail pane. The hex pane should highlight two bytes around offset 0x002F (byte 47 of the frame). The highlighted value will contain the bit pattern 0001 0010 in binary — bit 1 (SYN) and bit 4 (ACK) are set. This confirms the dissector's interpretation matches the raw data.
Byte-level validation: flags byte = 0x12 → SYN + ACK confirmed

Strengths, Limitations & Comparisons

Wireshark is extraordinarily powerful, but it is not the right tool for every situation. Understanding its strengths and limitations is essential for selecting appropriate tools in a professional security workflow. The following comparison contextualizes Wireshark alongside other commonly used traffic analysis tools.

Comparing Wireshark with tcpdump and Zeek
CriterionWiresharktcpdumpZeek (Bro)
InterfaceFull GUI with three-pane view, color-coded protocolsCommand-line only; text outputDaemon with log-based output; scriptable
Protocol Depth3,000+ dissectors; deep field-level parsingBasic protocol identification; limited field parsingFocused on connection-level metadata; programmable analyzers
ScalabilityStruggles with captures > 100 MB; memory-intensiveHandles high-speed captures efficiently in kernel spaceDesigned for continuous monitoring of high-volume links
Best Use CaseInteractive forensic analysis of targeted capturesQuick captures on remote servers via SSHNetwork security monitoring and anomaly detection at scale
Encrypted TrafficCan decrypt TLS if pre-master secrets are providedCannot decrypt; sees only ciphertextExtracts metadata (SNI, JA3 hashes) without decryption
KEY TAKEAWAY
Think of Wireshark as a high-powered microscope for network traffic — it provides extraordinary detail for focused examination of individual samples. However, just as a biologist would not use a microscope to survey an entire ecosystem, you would not use Wireshark to continuously monitor a 10 Gbps production link. Tools like Zeek serve that macro-level surveillance role, while Wireshark excels at the micro-level forensic investigation.

Connection to Advanced Analysis Techniques

The foundational skills covered in this lesson — capturing packets, navigating the three-pane interface, reading protocol fields, and applying display filters — are prerequisites for a range of advanced techniques that security professionals employ daily. Understanding where these basics lead helps motivate the depth of knowledge required and illustrates the tool's full potential.

From basics to advanced Wireshark techniques
Basic Concept (This Lesson)Advanced Technique
Reading TCP flags (SYN, ACK, FIN)TCP stream reassembly and conversation analysis to reconstruct full HTTP sessions, file transfers, and even exfiltrated data
Applying simple display filtersComplex filter expressions with boolean logic, regular expressions, and field comparisons (e.g., detecting DNS tunneling via abnormal query lengths)
Inspecting IP source/destination addressesGeoIP mapping, threat intelligence feed correlation, and statistical endpoint analysis for lateral movement detection
Identifying protocol fields in the detail paneWriting custom Lua dissectors for proprietary protocols, and using tshark for automated large-scale field extraction
Viewing the hex pane for byte-level inspectionMalware traffic analysis: extracting C2 beacon patterns, identifying encoded payloads, and carving embedded files from packet captures

As you progress in cybersecurity coursework and practice, you will encounter scenarios where packet-level analysis is indispensable — from CTF (Capture The Flag) challenges that embed flags in custom protocol fields, to real-world incident response where reconstructing attacker behavior from a pcap file is the critical first step. The conceptual model you've built in this lesson — understanding encapsulation, recognizing common header structures, and knowing how to navigate Wireshark's interface — forms the scaffold upon which all of these advanced capabilities are built.

🔒 Looking Ahead: TLS and Encrypted Traffic
With the ubiquity of HTTPS, much modern traffic is encrypted at the transport layer. Wireshark can still reveal metadata — TLS handshake parameters, cipher suites, Server Name Indication (SNI), and JA3/JA3S fingerprints — which are valuable for threat hunting. When pre-master secret log files are available (e.g., via the SSLKEYLOGFILE environment variable), Wireshark can decrypt and fully dissect TLS-encrypted sessions.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain the difference between a capture filter and a display filter in Wireshark. Why might you choose to use one over the other, and what are the consequences of applying the wrong type?
PROBLEM 2BASIC CALCULATION
An Ethernet frame carries an IPv4 packet containing a TCP segment with 500 bytes of HTTP payload. Assuming no optional headers are present, calculate the total frame size (excluding the Ethernet FCS). What byte offset marks the beginning of the HTTP payload?
PROBLEM 3INTERMEDIATE
You are analyzing a pcap file and notice that several packets from IP address 10.0.0.50 have the TCP flags field set to 0x29. Using your knowledge of TCP flag bits (FIN=0x01, SYN=0x02, RST=0x04, PSH=0x08, ACK=0x10, URG=0x20), determine which flags are set. Is this combination normal? What type of attack might this indicate, and what Wireshark display filter would isolate these packets?
PROBLEM 4APPLIED
You are a junior SOC analyst and have been given a pcap from a suspected data exfiltration incident. The attacker is believed to have used DNS tunneling to smuggle data out. Describe a step-by-step strategy using Wireshark to investigate this hypothesis. Mention at least two specific display filters and two protocol fields you would examine.
PROBLEM 5CRITICAL THINKING
A colleague argues that Wireshark is obsolete for modern security analysis because most traffic is now encrypted with TLS 1.3, rendering packet contents unreadable. Construct a detailed counterargument that addresses both the limitations imposed by encryption and the capabilities that remain useful despite it. Reference at least three specific types of metadata or analysis that Wireshark can still perform on encrypted traffic.

Lesson Summary

This lesson introduced Wireshark as the industry-standard tool for deep packet inspection, tracing its evolution from command-line tools like tcpdump through the creation of Ethereal in 1998 to the modern Wireshark application supporting over 3,000 protocol dissectors. The core interface concept — the three-pane layout consisting of the packet list, protocol detail tree, and hex bytes pane — provides an interconnected view where selecting any field instantly highlights its corresponding raw bytes. We examined the capture pipeline, including promiscuous mode, kernel-level BPF capture filters, and the recursive dissection engine that chains protocol decoders based on header field values.

We performed a detailed breakdown of Ethernet II, IPv4, and TCP header fields — identifying byte offsets, sizes, and security implications for each. The worked example demonstrated how to analyze a TCP three-way handshake step by step using display filters and byte-level correlation. We compared Wireshark with tcpdump and Zeek, noting that Wireshark excels at focused forensic analysis but is not suited for continuous high-volume monitoring. Finally, we previewed advanced techniques — stream reassembly, custom Lua dissectors, TLS decryption, and malware traffic analysis — that build directly on these foundational concepts.

Varsity Tutors • Cyber Security • Wireshark Basics — Use Wireshark conceptually to inspect traffic and identify protocol fields (intro)