Wireshark Cheat Sheet
1. Workflow
| Step | Where | What you learn |
|---|---|---|
| 1 | Statistics > Capture File Properties | Duration, packet count, time range, hash of file |
| 2 | Statistics > Protocol Hierarchy | Which protocols exist. Odd ones (lots of DNS, ICMP, FTP, Telnet) stand out |
| 3 | Statistics > Conversations (TCP / UDP / IPv4 tabs) | Who talks to whom. Sort by Bytes, Packets, Duration, port |
| 4 | Statistics > Endpoints | Top talkers, single IPs with huge counts |
| 5 | Statistics > I/O Graphs | Spikes, regular beaconing intervals |
| 6 | Analyze > Expert Information | Retransmissions, resets, malformed packets, warnings |
| 7 | Filter by suspicious host/port, then right-click > Follow > TCP Stream | Read payload, creds, file names |
| 8 | File > Export Objects > HTTP / SMB / FTP-DATA / TFTP | Pull downloaded files out |
| 9 | Hash extracted files (sha256sum, md5sum) | Needed for reports / VirusTotal |
Hints:
- Conversations sorted by Duration with few bytes = Slowloris / beacons.
- Conversations sorted by Bytes = exfiltration / downloads.
- One source hitting many different destination ports = port scan.
- Many different sources hitting one port = flood / DDoS.
- Pcap shows hosts, not processes. Say “host 192.168.x.x”, not “the browser”.
- First packet of interest: note the frame number (
frame.number >= 2599).
Useful UI actions
- Edit > Find Packet (search in String / Packet bytes / Packet details)
- Right-click field > Apply as Filter (e.g.
dns.qry.name,http.host) - Right-click field > Follow > Stream (e.g. tcp,tls)
- Right-click packet > Conversation Filter
- View > Time Display Format > UTC / seconds since beginning
- Statistics > Resolved Addresses
- Statistics > HTTP > Requests (list of hosts/URLs)
- Statistics > Flow Graph (sequence view of one conversation)
2. Display filter basics
ip.addr == 10.0.0.5 # src OR dst
ip.src == 10.0.0.5 && ip.dst == 1.2.3.4
tcp.port == 443 # src OR dst port
tcp.dstport == 3306
udp.port == 53
!(arp || dns || icmp) # hide noise
tcp.stream eq 12 # one TCP conversation
frame.number >= 2599 # from packet N onward
frame.time_delta_displayed > 5 # gaps between displayed packets
frame contains "password" # string anywhere in the packet
tcp contains "PK" # string inside TCP payload
ip.addr in {10.0.0.5 10.0.0.6} # set of values
http.host matches "(evil|bad)\.com" # regex
Operators: == != > < && || ! contains matches in
3. Common filters
TCP / scanning
tcp.flags.syn == 1 && tcp.flags.ack == 0 # SYN only (scan or new connection)
tcp.flags.syn == 1 && tcp.flags.ack == 1 # SYN/ACK (port open)
tcp.flags.reset == 1 # RST (port closed / aborted)
tcp.flags.reset == 1 && tcp.flags.ack == 1 # RST/ACK reply to SYN = closed port
tcp.flags.fin == 1
tcp.analysis.retransmission
tcp.analysis.flags # all TCP problems
tcp.analysis.zero_window
tcp.len > 0 # packets with payload
DNS
dns
dns.flags.response == 0 # queries only
dns.flags.response == 1 # responses only
dns.qry.name contains "example.com"
dns.qry.type == 16 # TXT
dns.qry.type == 10 # NULL
dns.qry.type == 255 # ANY
dns.qry.name.len > 50 # long names (tunneling) (check field name)
dns.flags.rcode != 0 # errors (NXDOMAIN etc.)
dns && frame.len > 300 # big DNS packets
HTTP
http
http.request
http.request.method == "POST"
http.request.method == "GET"
http.host contains "mediafire"
http.request.uri contains ".exe"
http.user_agent contains "MSIE"
http.response.code == 200
http.response.code >= 400
http.content_type contains "zip"
http.content_type contains "octet-stream"
http contains "This program cannot be run in DOS mode" # Windows EXE in HTTP body
TLS
tls.handshake.type == 1 # Client Hello
tls.handshake.type == 2 # Server Hello
tls.handshake.type == 11 # Certificate (not visible in TLS 1.3 w/o keys)
tls.handshake.extensions_server_name # SNI
tls.handshake.ciphersuite # offered / chosen suites
tls.record.version # record version
tls.handshake.version # handshake version (1.3 shows 1.2 here; check supported_versions ext.)
tls.alert_message # TLS alerts
- TLS 1.3 suites start with
TLS_AES_/TLS_CHACHA20_. - Static RSA suites look like
TLS_RSA_WITH_...(no forward secrecy). - Certificate fields (CN, issuer, validity): expand packet > Certificate > tbsCertificate.
Other protocols
ftp # control channel
ftp.request.command == "USER" || ftp.request.command == "PASS"
ftp.response.code == 530 # login failed
ftp-data # file transfer
smb || smb2
kerberos
kerberos.msg_type == 13 # TGS-REQ (check value)
kerberos.etype == 23 # RC4 tickets (Kerberoasting hint)
ldap
dhcp
arp
arp.opcode == 2 # ARP replies
arp.duplicate-address-detected # same IP, different MAC
icmp.type == 8 # echo request (ping)
ssh
telnet
4. Getting files out of a pcap
GUI
- File > Export Objects > HTTP / SMB / FTP-DATA / TFTP > Save
- Anything else: Follow TCP Stream > “Show data as: Raw” > Save as… (binary, not the text view)
CLI (tshark)
tshark -r in.pcap --export-objects http,outdir
tshark -r in.pcap --export-objects smb,outdir
tshark -r in.pcap --export-objects ftp-data,outdir
sha256sum outdir/*
file outdir/*
Identify by magic bytes
| Bytes (hex) | ASCII | Type |
|---|---|---|
4D 5A | MZ | Windows EXE/DLL |
50 4B 03 04 | PK.. | ZIP (also DOCX/XLSX/JAR) |
25 50 44 46 | ||
1F 8B | gzip | |
52 61 72 21 | Rar! | RAR |
7F 45 4C 46 | .ELF | Linux binary |
Notes:
- ZIP stores file names uncompressed in the local header, so
.exeinside a ZIP is visible as plain text in the stream. - Chunked HTTP or partial captures can make exported files incomplete. Always check the size against
Content-Lengthand the hash. - Report: file name, source IP, URL/host, size, SHA256 (and hash of the ZIP itself if it was a ZIP).
5. Decrypting TLS
Which method works?
| Situation | Method |
|---|---|
Cipher suite TLS_RSA_WITH_... (static RSA), TLS 1.2 or older | Server private key works |
| ECDHE / DHE suites, or TLS 1.3 | Private key does NOT work. Need a key log file |
| You captured the browser yourself | Use SSLKEYLOGFILE |
Check the suite first: tls.handshake.type == 2, expand Server Hello > Cipher Suite.
Have the key, search for it in the pcap or in the internet.
A) With an RSA private key (Wireshark 3.x/4.x) (check menu names)
- Edit > Preferences > Protocols > TLS
- RSA keys list > Edit >
+- IP Address: server IP (or
0.0.0.0for any) - Port:
443(or the real port) - Protocol:
http(or the app protocol) - Key File: path to the
.pem/.key - Password: only if the key is encrypted
- IP Address: server IP (or
- OK. Packet list should now show decrypted HTTP. Bottom pane tab “Decrypted TLS” appears.
- Non-standard port: Analyze > Decode As… > TCP port > TLS.
Older versions (before 3.0) call this SSL instead of TLS.
Key must match the certificate in the capture:
openssl x509 -noout -modulus -in cert.pem | md5sum
openssl rsa -noout -modulus -in key.pem | md5sum # hashes must be identical
openssl rsa -check -in key.pem -noout # key is valid?
openssl rsa -in key.pem -text -noout | head # inspect
Fix format problems: openssl rsa -in key.key -out key.pem. Copy-pasted keys through chat/email often get corrupted (line wraps, truncation). Use the original file. Do not paste real private keys into chats. Lab keys only.
Capture must contain the full handshake (Client Hello through Finished), otherwise nothing decrypts.
B) With a key log file (works for TLS 1.3 and ECDHE)
- Set the env variable before starting the browser:
- Windows (cmd):
set SSLKEYLOGFILE=C:\temp\keys.log - Linux/macOS:
export SSLKEYLOGFILE=~/keys.log
- Windows (cmd):
- Start the browser from that shell, capture, browse.
- Wireshark: Edit > Preferences > Protocols > TLS > (Pre)-Master-Secret log filename > select
keys.log. - Certificates now show with
tls.handshake.type == 11even in TLS 1.3. - Alternative: Wireshark can embed keys in the file: File > Save As pcapng after Edit > Insert Secrets /
editcap --inject-secrets tls,keys.log in.pcap out.pcapng(check).
C) tshark
# key log
tshark -r in.pcap -o "tls.keylog_file:keys.log" -Y http -V
# RSA key (check exact syntax for your version)
tshark -r in.pcap -o "tls.keys_list:10.0.0.5,443,http,key.pem" -Y http
D) Prevent decryption later (exam question type)
Use forward secrecy (ECDHE/DHE cipher suites, TLS 1.3), so a stolen server key cannot decrypt recorded traffic.
6. Attacks and how to spot them
| Attack | What you see | Filter / view |
|---|---|---|
| SYN scan (port scan) | One source sends SYNs to many ports/hosts. Closed = RST/ACK, open = SYN/ACK. Scanner often sends RST after SYN/ACK (half-open, no full handshake) | tcp.flags.syn==1 && tcp.flags.ack==0; Conversations: one src, many dst ports |
| SYN flood (DoS) | Huge number of SYNs, often spoofed/random sources, to one port. Few or no ACKs completing the handshake | Same SYN filter; Endpoints / I/O graph spike; tcp.analysis.retransmission of SYN/ACKs |
| Slowloris (DoS) | Many parallel connections from one IP to port 80/443. Each sends incomplete HTTP headers very slowly (tiny packets, keep-alive header lines) and never finishes the request. Server resources fill up | Conversations sorted by Duration: many long-lived, few bytes. Follow stream: GET without final blank line. Note user agent |
| HTTP flood | Many complete GET/POST requests, high rate, often same URI | http.request + I/O graph; Statistics > HTTP > Requests |
| DNS tunneling (iodine, dnscat2) | Very long, random-looking subdomain labels; many unique names under one domain; TXT / NULL (and CNAME/MX) record types; large DNS packets; constant steady flow to one external server | dns.qry.type == 10 | dns.qry.type == 16; dns.qry.name.len > 50; Statistics > DNS; Conversations to a single resolver IP |
| DNS C2 over TXT | Regular TXT queries to one domain, encoded (base32/base64/hex) payloads in responses | dns.qry.type == 16; decode labels; check interval in I/O graph |
| DNS amplification | Small spoofed queries (type ANY/TXT), huge responses sent to the victim, responses without matching queries, from many resolvers | dns.qry.type == 255; dns.flags.response==1 && frame.len > 500 |
| ARP spoofing / MITM | Attacker MAC answers for gateway IP. Same IP with two MACs. Repeated unsolicited (gratuitous) ARP replies | arp.duplicate-address-detected; arp.opcode == 2; Expert Info |
| ICMP tunnel / ping sweep | Sweep: echo requests to many IPs. Tunnel: large or regular ICMP payloads carrying data | icmp.type == 8; icmp && frame.len > 100 |
| Brute force | Many repeated login attempts, failures then one success. FTP 530, HTTP 401/403, many short SSH connections, SMB/Kerberos failures | ftp.response.code == 530; http.response.code == 401; kerberos.error_code; count in Conversations |
| Cleartext credentials | FTP USER/PASS, HTTP Basic auth, Telnet, POP/IMAP, HTTP POST forms | ftp.request.command == "PASS"; http.authorization; http.request.method == "POST"; Follow stream |
| Malware download | HTTP GET for .zip/.exe from file host (e.g. MediaFire), fake installers (e.g. Flash Player), then new unusual outbound connection from same host | http.request.uri contains ".exe"; Export Objects; check MZ/PK magic |
| Disguised payload on odd port | EXE (MZ) sent over a non-standard port such as 3306 (MySQL) or 53 | Conversations by port; Follow stream; tcp contains "MZ" / DOS-mode string |
| C2 beaconing | Same host contacts same external IP at fixed intervals, small packets, similar sizes | I/O Graph; frame.time_delta_displayed on a filtered conversation |
| Data exfiltration | Large outbound transfer (FTP/HTTP POST/DNS/ICMP) to an external IP; client uploads more than it downloads | Conversations sorted by Bytes, check direction A to B vs B to A |
| Kerberoasting | TGS requests for service accounts with RC4 (etype 23) | kerberos.etype == 23 (check) |
| DCSync | DRSUAPI (DsGetNCChanges) from a non-DC host | drsuapi |
| TLS stripping / downgrade | HTTP 301/302 to https missing, user stays on HTTP, old TLS versions or weak suites offered | http.response.code == 301; tls.handshake.version; ClientHello cipher list |
| Weak TLS | Static RSA suite, TLS 1.0/1.1, self-signed or expired cert, SNI/CN mismatch | Server Hello suite; Certificate fields |
How to prove an answer (evidence template)
Attack: Slowloris DoS
Source: 192.168.1.50 -> 10.0.0.10:80
Evidence: 200+ simultaneous connections, each sending partial headers (packets #1204-#5120),
no complete request, connections open > 60 s. Filter: ip.src==192.168.1.50 && tcp.dstport==80
Impact: Availability (CIA). Server cannot accept new connections.
7. OS fingerprinting from a pcap (passive, probabilistic)
| Indicator | Hint |
|---|---|
| IP TTL (initial) | 64 = Linux/macOS/Android, 128 = Windows, 255 = network devices. Observed TTL is initial minus hops |
| TCP SYN options + window size | Windows: MSS 1460, window scale, SACK, NOP padding. Linux: timestamps present. Compare several packets |
HTTP User-Agent | Best direct evidence (Windows NT 5.1 = XP, MSIE 7.0) |
| DHCP | option 60 vendor class (MSFT 5.0), hostname |
| SMB / NTLM | OS version strings |
| SSH banner / client | e.g. WinSCP = Windows client |
| DNS names queried | windowsupdate, ubuntu.com, apple.com |
State it as “indicates”, not “proves”. Use several indicators together. TTL/window values here are recalled, verify against a known reference (e.g. p0f) if the exam depends on it.
8. tshark quick commands
tshark -r f.pcap -q -z io,phs # protocol hierarchy
tshark -r f.pcap -q -z conv,tcp # TCP conversations
tshark -r f.pcap -q -z conv,udp
tshark -r f.pcap -q -z endpoints,ip
tshark -r f.pcap -q -z http,tree
tshark -r f.pcap -q -z http_req,tree # requests per host/URI
tshark -r f.pcap -Y "tcp.flags.syn==1 && tcp.flags.ack==0" \
-T fields -e ip.src -e tcp.dstport | sort | uniq -c | sort -nr | head
tshark -r f.pcap -Y dns -T fields -e dns.qry.name | awk '{print length($0), $0}' | sort -nr | head
tshark -r f.pcap -Y "http.request" -T fields -e frame.number -e ip.src -e http.host -e http.request.uri
tshark -r f.pcap -Y "tls.handshake.type==1" -T fields -e ip.dst -e tls.handshake.extensions_server_name
tshark -r f.pcap -z follow,tcp,ascii,12 -q # follow TCP stream 12
Python fallback (no tshark): scapy.rdpcap() / dpkt.pcap.Reader, group packets by (src, sport, dst, dport), reassemble by TCP sequence number.
9. Capture filters (BPF, set BEFORE capture, different syntax from display filters)
host 1.2.3.4
tcp port 443 and host 1.2.3.4
port 53
net 192.168.1.0/24
not arp
- Capture filter = what gets recorded (BPF). Display filter = what you see afterwards.
- For the report, write the exact capture filter and prove it with a screenshot (Capture > Options).
- To see a fresh TLS handshake: close existing tabs, use a private window; Chrome may use QUIC (UDP 443), so
tcpin the filter excludes it. - Save as
.pcapif the task says pcap (File > Save As > “Wireshark/tcpdump - pcap”).
10. Snort rule skeleton (recalled, check syntax for your Snort version, 2.9.x vs 3.x)
alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (
msg:"ZIP with EXE downloaded over HTTP";
flow:established,to_client;
content:"PK|03 04|"; depth:4;
content:".exe"; distance:0;
classtype:trojan-activity; sid:1000001; rev:1;)
depth/offset: absolute position from start of payload.distance/within: relative to previous match.content:"MZ"; depth:2;catches a plain EXE download too (ZIP rule alone misses it).- A ZIP rule anchored at the first local header only catches ZIPs whose first entry is the .exe; central directory repeats names at the end (needs larger HTTP inspection depth).
- Put SID >= 1,000,000 for local rules.
40-minute order
- Protocol Hierarchy + Conversations
- Pick the anomaly, note first packet number
- Follow stream / export object / hash / decrypt
- Answer each question with evidence
- Final read-through for placeholders