01 / 20

Wireshark
Basics

Learn to capture and inspect network traffic using the world's most popular packet analyzer: identify protocols, read packet fields, and understand data in transit.

Cyber Security

What Is Wireshark?

Wireshark is a free, open-source packet analyzer that captures network traffic in real time. Security analysts, network engineers, and students use it to see exactly what data flows across a network: every request, every response, every byte.

Why Packet Analysis Matters

Detect Threats
Spot suspicious traffic patterns, malware callbacks, and data exfiltration attempts.
Troubleshoot
Diagnose slow connections, failed handshakes, and misconfigured services by reading the packets.
Learn Protocols
See TCP, HTTP, DNS, and TLS in action rather than just reading about them in textbooks.

Essential Vocabulary

1
Packet: The smallest unit of data transmitted over a network: a chunk of bytes with header information and a payload.
2
Protocol: A set of rules governing how data is formatted and transferred (e.g., TCP, UDP, HTTP, DNS).
3
Capture: The act of recording live packets from a network interface for later analysis.
4
Display Filter: A Wireshark expression that narrows visible packets to only those matching your criteria.

Packets and the OSI Model

Layer 7: Application (HTTP, DNS) Layer 4: Transport (TCP, UDP) Layer 3: Network (IP) Layer 2: Data Link (Ethernet) Encapsulation Packet Bytes Packet Details Packet Details Packet Details Wireshark's Three Panes Packet List All captured packets Packet Details Protocol tree view Packet Bytes Raw hex dump

Anatomy of a Network Packet

Ethernet Src/Dst MAC 14 bytes IP Header Src/Dst IP, TTL 20 bytes (typ.) TCP Header Ports, Seq, Flags 20 bytes (typ.) Payload Application Data Variable length Packet Structure (TCP/IP) Layer 2 Layer 3 Layer 4 Layer 7

Capture vs Display Filters

Capture Filter Display Filter
When Applied Before capture starts After packets are captured
Syntax BPF (Berkeley Packet Filter) Wireshark display filter syntax
Example tcp port 80 http.request.method == "GET"
Reversible? No: unmatched packets are discarded Yes: all packets remain in memory
Best For Reducing file size on busy networks Exploring and investigating captures

Essential Display Filters

1
ip.addr == 192.168.1.10: Show all traffic to or from a specific IP address.
2
tcp.port == 443: Filter for HTTPS traffic on port 443.
3
dns: Show only DNS queries and responses to investigate domain lookups.
4
http.request: Isolate HTTP request packets (GET, POST, etc.).
5
tcp.flags.syn == 1 && tcp.flags.ack == 0: Find initial TCP SYN packets: new connection attempts.

The TCP Three-Way Handshake

Client Server SYN Seq = 0 SYN-ACK Seq = 0, Ack = 1 ACK Seq = 1, Ack = 1 Connection Established

How to Analyze Traffic

1
Select the interface: Choose the network adapter (Wi-Fi, Ethernet) you want to monitor in Wireshark's start screen.
2
Start capturing: Click the blue shark fin icon. Packets begin streaming into the Packet List pane immediately.
3
Apply a display filter: Type a filter (e.g., http) in the filter bar and press Enter to focus on relevant traffic.
4
Select a packet: Click a row in the Packet List. The Packet Details and Packet Bytes panes update to show that packet's contents.
5
Inspect protocol fields: Expand each protocol layer in the Details pane to read individual field values (IPs, ports, flags, payload).
6
Follow the stream: Right-click a packet and choose "Follow TCP Stream" to see the entire conversation reassembled as readable text.

Example: Reading a DNS Query

No. Time Source Destination Protocol Info 42 0.345 192.168.1.10 8.8.8.8 DNS A example.com Packet Details - Ethernet II Src: aa:bb:cc:dd:ee:ff Dst: 11:22:33:44:55:66 - Internet Protocol v4 Src: 192.168.1.10 Dst: 8.8.8.8 TTL: 64 - User Datagram Protocol Src Port: 54321 Dst Port: 53 - Domain Name System (query) Name: example.com Type: A (Host Address)

Example: Inspecting an HTTP Request

# Display filter applied: http.request

GET /login.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html
Cookie: session_id=abc123def456

Example: Spotting Suspicious Traffic

Attacker 10.0.0.99 Target 10.0.0.5 SYN :22 SYN :80 SYN :443 Red Flags in Wireshark Many SYN packets to sequential ports from one IP (port scan) High volume of DNS queries to unusual domains (DNS tunneling) Repeated failed TCP connections (RST responses) Unencrypted credentials visible in packet payload

Following a TCP Stream

Wireshark can reassemble all packets in a TCP conversation into a single readable view. Right-click any packet in a conversation and select "Follow" → "TCP Stream".

Client Data
Shown in red text: everything the client sent (requests, form data, commands).
Server Data
Shown in blue text: everything the server responded with (HTML, headers, status codes).

Common Mistakes

✕ Wrong Filter Syntax
Mixing up capture filter syntax (BPF: tcp port 80) with display filter syntax (Wireshark: tcp.port == 80). They are different languages.
✕ Capturing Everything
Running a capture with no filter on a busy network produces massive files. Use a capture filter or limit duration to stay focused.
✕ Ignoring Encrypted Traffic
Expecting to read HTTPS payload data. TLS encrypts application data: Wireshark shows the TLS handshake but not the decrypted content without keys.

Protocol Quick Reference

Protocol Port Transport What to Look For
HTTP 80 TCP GET/POST methods, headers, cookies
HTTPS 443 TCP TLS handshake, encrypted payload
DNS 53 UDP Query name, record type (A, AAAA, MX)
FTP 21 TCP USER/PASS commands (plaintext!)
SSH 22 TCP Encrypted: version exchange, key exchange

Question 1 of 5

Which Wireshark pane allows you to expand protocol headers and read individual field values like source IP, destination port, and TCP flags?

Question 2 of 5

A display filter uses Wireshark's own syntax and is applied after packets have been captured. Which of the following is a valid display filter?

Question 3 of 5

You see hundreds of SYN packets from a single source IP targeting sequential ports on a server, with most receiving RST responses. What does this pattern most likely indicate?

Question 4 of 5

DNS queries typically use which transport protocol and are sent to which well-known port?

Question 5 of 5

You capture traffic on an open Wi-Fi network and use Wireshark to inspect an HTTP session to a login page. Which of the following could an attacker potentially see in the captured packets?