Wireshark for CTF
Sometimes Apackets is useless so lets make a quick reference for packet analysis during CTF challenges.
๐งฉ Basic Navigation
-
Start/Stop Capture: Shark fin icon / red square
-
Open PCAP:
File โ Open -
Follow Stream: Rightโclick packet โ Follow โ TCP/UDP/HTTP/SSL stream
-
Use Display Filter Bar: Top filter input box
๐ฏ Essential Display Filters
๐น Protocol Filters
ip
tcp
udp
icmp
http
https
dns
ftp
smtp
ssh
๐น Filter by IP
ip.addr == 10.0.0.5
ip.src == 192.168.1.10
ip.dst == 8.8.8.8
๐น Filter by Port
tcp.port == 80
tcp.srcport == 443
tcp.dstport == 1337
๐น Filter by MAC Address
eth.addr == AA:BB:CC:DD:EE:FF
๐น Filter by Contains Data
frame contains flag
http contains "flag"
dns.qry.name contains "ctf"
๐น Filter for Credentials
http.authbasic
ftp.request.command == "USER"
ftp contains PASS
๐น Filter by Packet Type
tcp.flags.syn == 1
tcp.flags.fin == 1
tcp.flags.reset == 1
๐ Common CTF Tasks
โ Extract Credentials
- Filter:
http
ftp
smtp
pop
imap
- Rightโclick โ Follow Stream.
โ Reconstruct Files (e.g., images, zip)
-
File โ Export Objects โ HTTP -
File โ Export Objects โ SMB -
File โ Export Packet Bytes(for manual carving)
โ Find Hidden Data
-
Look at UDP/TCP payloads
-
Use
frame containsto search keywords -
Inspect DNS TXT queries:
dns.txt
- Look for base64:
frame matches "[A-Za-z0-9+/]{20,}="
โ Follow Streams
-
TCP stream (cleartext protocols)
-
HTTP stream (GET/POST data)
-
UDP stream (custom protocols)
-
SSL stream (if key available)
Keyboard shortcut: Ctrl + Alt + Shift + T
๐ Useful Tools Inside Wireshark
๐น Decode Asโฆ
Rightโclick โ Decode As โ set protocol (useful for odd ports).
๐น Packet Bytes View
-
Shows raw hex
-
Good for carving files / hidden payloads
๐น Statistics Menu
-
Protocol Hierarchy (what traffic exists?)
-
Endpoints (active IPs, MACs)
-
Conversations (pairโwise communication)
-
I/O Graphs (find bursts / anomalies)
๐ Decrypting HTTPS (if key available)
Edit โ Preferences โ Protocols โ TLS โ (PreโMaster Secret log)
Then apply filter:
http
๐งช Advanced Filters (Very Useful)
Find suspicious payload sizes
frame.len > 500
Find ASCII printable bytes
data-text-lines
Track a single TCP session
tcp.stream == 5
Detect port scans
tcp.flags.syn == 1 && tcp.flags.ack == 0
Filter out noise
!(dns || mdns || arp)
๐ก File Carving Tricks
Extract everything likely to be base64
frame matches "[A-Za-z0-9+/]{30,}"
Copy payload โ decode.
Extract PNG files manually
PNG header:
89 50 4E 47 0D 0A 1A 0A
Search using:
frame contains 89:50:4E:47
Export packet bytes โ save โ test with file command.
๐งฐ External Tools to Pair with Wireshark
-
tshark โ CLI Wireshark
-
scapy โ custom packet analysis
-
binwalk โ file carving
-
foremost / bulk_extractor โ data extraction
-
CyberChef โ decode literally everything
๐ Quick Workflow for CTF!
-
Open PCAP
-
Check Statistics โ Protocol Hierarchy
-
Find interesting IPs โ filter by them
-
Follow streams
-
Export objects
-
Search for keywords:
frame contains "flag"
frame contains "ctf"
frame contains "{"
-
Look for encoded data (base64, hex, gzip)
-
Extract files