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.
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
Essential Vocabulary
Packets and the OSI Model
Anatomy of a Network Packet
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
The TCP Three-Way Handshake
How to Analyze Traffic
Example: Reading a DNS Query
Example: Inspecting an 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
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".
Common Mistakes
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?