What is Wireshark?
Wireshark is the world's foremost network protocol analyzer. It lets you capture and interactively browse network traffic running on a computer network. Think of it as a "network microscope" that shows you exactly what's happening on your network at the packet level.
Every piece of data sent over a network is broken into small chunks called "packets". Wireshark captures these packets and decodes them so humans can read and understand network communications.
Why Do We Need Wireshark?
- Network Troubleshooting: Find why applications are slow or connections are dropping
- Security Analysis: Detect malware, data exfiltration, and unauthorized access
- Protocol Learning: See how TCP/IP, HTTP, DNS, and other protocols actually work
- Forensics: Investigate security incidents by analyzing captured traffic
- Development: Debug network applications and verify implementations
The Three Core Skills
- Capturing: Recording network traffic from an interface
- Filtering: Finding the specific packets you need among thousands
- Analyzing: Understanding what the packets mean
Understanding Network Interfaces
Before capturing, you must select which network interface to monitor. This is often a point of confusion for beginners.
Selecting the wrong interface means capturing no useful traffic. If you're analyzing web traffic but selected a disconnected interface, you'll see nothing!
Common Interface Types
eth0,ens33,enp0s3- Wired Ethernet adapterswlan0,wlp2s0- Wireless adapterslo- Loopback (local traffic only, like 127.0.0.1)any- Capture from ALL interfaces simultaneouslyvirbr0,docker0- Virtual bridges for VMs/containers
When unsure which interface to use, select "any" to capture from all interfaces. You can then filter by interface later using frame.interface_name == "eth0"
Display Filters vs Capture Filters
This distinction confuses many beginners. Understanding the difference is crucial!
Display Filters
- Applied AFTER capture
- Hide packets from view
- Easy to change on-the-fly
- All data still saved
- Uses Wireshark syntax
http.request.method == "GET"
Capture Filters
- Applied DURING capture
- Prevents packets from being recorded
- Must be set before starting
- Filtered data is GONE forever
- Uses BPF syntax (tcpdump-style)
port 80
Display filters are more flexible and commonly used for analysis. They use Wireshark's powerful expression syntax which we'll practice extensively.
Filter Syntax Fundamentals
Basic Comparison Operators
ip.addr != 10.0.0.1 # Not equal to
frame.len > 1000 # Greater than
tcp.port >= 1024 # Greater than or equal
udp.port < 1024 # Less than (well-known ports)
Logical Operators
dns || dhcp # OR - either can be true
!arp # NOT - exclude ARP packets
not tcp # Alternative NOT syntax
Handling Ports (Common Confusion Point!)
These filter fields behave differently - choosing the wrong one is a common mistake!
tcp.srcport == 80 # Only matches SOURCE port 80
tcp.dstport == 80 # Only matches DESTINATION port 80
udp.port == 53 # Same logic for UDP
IP Address Filters (Another Confusion Point!)
ip.src == 192.168.1.1 # Only matches SOURCE IP
ip.dst == 192.168.1.1 # Only matches DESTINATION IP
ip.addr == 192.168.1.0/24 # Matches entire subnet (CIDR notation)
String Matching
http.request.uri matches "login" # Regex match
frame contains "password" # Search raw packet data
Common Analysis Scenarios
Finding HTTP Traffic
http.request # HTTP requests only
http.response # HTTP responses only
http.request.method == "POST" # POST requests (form submissions)
http.response.code == 404 # 404 Not Found errors
http.response.code >= 400 # All client/server errors
DNS Analysis
dns.qry.name contains "malware" # Suspicious domain queries
dns.flags.response == 1 # DNS responses only
dns.qry.type == 16 # TXT record queries (sometimes C2)
TCP Connection Analysis
tcp.flags.reset == 1 # RST packets (connection resets)
tcp.analysis.retransmission # Retransmitted packets
tcp.stream eq 5 # Follow specific TCP stream
Security Investigation
tcp.flags.syn == 1 && tcp.flags.ack == 0 && ip.src == 10.0.0.50
# SMB traffic (lateral movement)
tcp.port == 445
# Non-standard HTTPS port
tcp.port == 8443 || tcp.port == 4443
# Large data transfers (exfiltration?)
frame.len > 5000 && ip.dst != 192.168.0.0/16
Ready to Practice?
Head to the Filter Lab tab to practice writing filters with instant feedback. Then test your skills in the Challenges section!
The Filter Lab provides a simulated network capture. Type filters and see which packets match in real-time. No actual network capture required!
| No. | Time | Source | Destination | Protocol | Length | Info |
|---|---|---|---|---|---|---|
| Click "Load Normal Traffic" or "Load Malicious Traffic" to begin | ||||||
Click a packet to view layer-by-layer details
Your Progress
IP Address Filters
Port Filters
Protocol Filters
TCP Flags
HTTP Specific
DNS Specific
Logical Operators
Export Progress
Save your challenge progress and settings to continue later.
Import Progress
Load previously saved progress.
Reset Progress
Clear all challenge progress and start fresh.