The First Five Minutes: Parsing Pcap Files in Wireshark
The most common mistake in CTF is opening pcap and reading packets from top to bottom. In a dump of 10-20,000 packets, this is a guaranteed waste of time. The first five minutes are reconnaissance: figuring out where to dig and what to discard as background noise. For more details, see our guide on creating CTF tasks .
Protocol Hierarchy и Conversations
Statistics → Protocol Hierarchy— the first window after loading the file. It shows the percentage distribution of protocols by packet count and data volume. Essentially, it's a dump map that immediately shows where to search.
What to look for:
HTTP — even 0.3% of HTTP traffic among TLS can contain everything needed. Unencrypted protocols are the first target. In the analysis of the EscapeRoom task on CyberDefenders, it was 0.3% of HTTP that contained a User-Agent value of wget, which released the attacker's tool (analysis on InfoSec Writeups).
DNS - a high percentage of DNS packets (more than 10-15%) with a small number of unique domains is a warning sign of possible DNS exfiltration.
FTP — credentials and files in clear text. If they're in the dump, check them first.
Non-standard protocols—telnet, IRC, SMTP—packets that Wireshark shows as "Data" on non-standard ports. This is where the interesting stuff usually hides.
Statistics → Conversations(TCP tab, sorted by bytes) shows all pairs of communicating hosts. "Thick" sessions with large amounts of data are candidates for file transfers. Multiple short sessions from a single IP to port 22 are SSH brute-force attacks. A single successful session among dozens of failed ones is immediately noticeable by the volume of response data: in EscapeRoom, this technique allowed us to distinguish 52 failed SSH attempts from two successful ones—without manually reviewing each session.
Statistics → EndpointsThis completes the picture: one internal IP address communicating with a dozen external ones is normal. One external IP address initiating hundreds of connections is an anomaly worth investigating.
Decision tree after reconnaissance:
What does the Protocol Hierarchy show? What to do
HTTP / FTP / SMTP / Telnet Start with unencrypted protocols
TLS/SSH only Look for pre-master secret in task files or switch to DNS/ICMP
Unusually many DNS Check subdomains for hex/Base64 (DNS exfiltration)
Unknown protocols on non-standard ports Decode As or Follow TCP Stream for manual analysis
Wireshark Filters for CTF: Basic and Advanced
Display filters are the primary navigation tool. Without them, analyzing Wireshark network traffic with thousands of packets becomes a game of chance. They are entered in the field at the top of the window and applied by pressing Enter.
Wireshark Display Filters: Examples for Each Protocol
Filters worth knowing by heart:
http— all HTTP traffic
dns— DNS queries and responses
ftp— FTP control channel commands (for file contents — ftp-data)
smtp- email
tcp.port == 4444— traffic on a specific port (4444 is a classic for reverse shell in CTF labs)
ip.addr == 10.0.2.15— all packets from/to a specific IP
http.request.method == "POST"— only POST requests: login forms, file uploads, transferring credentials
http.response.code == 200— successful HTTP responses
Combination: &&— logical AND, || - OR, !- negation. Filter http && ip.src == 10.0.2.15will show HTTP traffic from a specific host. A !dns && !arpremoves background noise from DNS resolving and ARP requests, leaving your workspace noticeably cleaner.
Finding flags in pcap via packet contents
When the flag format is known (e.g. CTF{...} or flag{...}), searching by content is the fastest way:
frame contains "flag"— searches for a string in the entire frame, including payload and headers
http contains "CTF{"— searches only in HTTP packets
tcp contains "password"— passwords in the TCP stream
dns.qry.name contains "suspicious"— substrings in DNS queries
A separate story - frame matches "flag"Unlike contains, this filter is case-insensitive. See the picoCTF PcapPoisoning analysis on brootware.github.io frame matchesfound the line FLAG, Flag or flagwith one request - no need to sort through options manually.
For regular expressions, the operator matches: filter http.request.uri matches ".*\\.php"will show all requests to PHP scripts. Filter dns.qry.name matches "^[a-f0-9]{8,}\\."will detect DNS queries with hex strings in subdomains - a typical sign of DNS exfiltration.
If the flag format is unknown, a sequential series of requests: frame contains "flag", then frame contains "key", frame contains "secret", frame contains "pass"In entry-level CTFs, the flag appears open in about half of the tasks. Don't make it complicated until you've tested the simpler options.
Limitation: Content filters only work with unencrypted traffic. On encrypted TLS sessions contains And matchesuseless without decryption keys.
Follow TCP Stream Wireshark: Reading Entire Sessions
Right-click on any packet of the session you are interested in → Follow → TCP StreamWireshark assembles all the packets of a single TCP session into a single, readable stream. Red text is data from the client, blue is from the server. Essentially, it's an intercepted conversation, stitched together from disparate fragments.
At the bottom of the Follow TCP Stream window, you can navigate between streams: Stream 0, Stream 1, Stream 2And so on. In CTFs with a small number of threads (up to 20-30), it's worth clicking through each one sequentially, switching the number. It takes a couple of minutes and often leads to a flag faster than complex filters. I almost always do this—blindly clicking through the threads until I spot something suspicious.
Typical findings when using Follow TCP Stream on CTF tasks:
Cleartext flag - if data was sent via HTTP, Telnet, or IRC
Base64 strings - header Authorization: Basicwith Base64-encoded credentials. Decoded via echo "строка" | base64 -d
FTP logins - commands USER / PASSin plain text
Scripts and code - while analyzing the THM Wireshark CTF (cyber-99.co.uk) via Follow Stream, a Python script with ROT13, Base64, and Caesar encryption was discovered. To obtain the flag, I had to copy the code, reverse-engineer the encoding functions (replace b64encodeon b64decode, shift Caesar from +3 to -3) and run the script
HTTP Headers - Non-Standard User-Agent ( wget or curl) indicates automated downloading, which in MITRE ATT&CK terms models the Web Protocols (T1071.001, Command and Control) technique.
Follow Stream output formats are ASCII (for text protocols), Hex Dump (for binary data), and Raw (for saving to disk). These formats are available in the "Show data as" drop-down menu. To save a binary file from the stream, select Raw and click Save AsASCII will corrupt binary data – I've tested it myself.
The most common mistake in CTF is opening pcap and reading packets from top to bottom. In a dump of 10-20,000 packets, this is a guaranteed waste of time. The first five minutes are reconnaissance: figuring out where to dig and what to discard as background noise. For more details, see our guide on creating CTF tasks .
Protocol Hierarchy и Conversations
Statistics → Protocol Hierarchy— the first window after loading the file. It shows the percentage distribution of protocols by packet count and data volume. Essentially, it's a dump map that immediately shows where to search.
What to look for:
HTTP — even 0.3% of HTTP traffic among TLS can contain everything needed. Unencrypted protocols are the first target. In the analysis of the EscapeRoom task on CyberDefenders, it was 0.3% of HTTP that contained a User-Agent value of wget, which released the attacker's tool (analysis on InfoSec Writeups).
DNS - a high percentage of DNS packets (more than 10-15%) with a small number of unique domains is a warning sign of possible DNS exfiltration.
FTP — credentials and files in clear text. If they're in the dump, check them first.
Non-standard protocols—telnet, IRC, SMTP—packets that Wireshark shows as "Data" on non-standard ports. This is where the interesting stuff usually hides.
Statistics → Conversations(TCP tab, sorted by bytes) shows all pairs of communicating hosts. "Thick" sessions with large amounts of data are candidates for file transfers. Multiple short sessions from a single IP to port 22 are SSH brute-force attacks. A single successful session among dozens of failed ones is immediately noticeable by the volume of response data: in EscapeRoom, this technique allowed us to distinguish 52 failed SSH attempts from two successful ones—without manually reviewing each session.
Statistics → EndpointsThis completes the picture: one internal IP address communicating with a dozen external ones is normal. One external IP address initiating hundreds of connections is an anomaly worth investigating.
Decision tree after reconnaissance:
What does the Protocol Hierarchy show? What to do
HTTP / FTP / SMTP / Telnet Start with unencrypted protocols
TLS/SSH only Look for pre-master secret in task files or switch to DNS/ICMP
Unusually many DNS Check subdomains for hex/Base64 (DNS exfiltration)
Unknown protocols on non-standard ports Decode As or Follow TCP Stream for manual analysis
Wireshark Filters for CTF: Basic and Advanced
Display filters are the primary navigation tool. Without them, analyzing Wireshark network traffic with thousands of packets becomes a game of chance. They are entered in the field at the top of the window and applied by pressing Enter.
Wireshark Display Filters: Examples for Each Protocol
Filters worth knowing by heart:
http— all HTTP traffic
dns— DNS queries and responses
ftp— FTP control channel commands (for file contents — ftp-data)
smtp- email
tcp.port == 4444— traffic on a specific port (4444 is a classic for reverse shell in CTF labs)
ip.addr == 10.0.2.15— all packets from/to a specific IP
http.request.method == "POST"— only POST requests: login forms, file uploads, transferring credentials
http.response.code == 200— successful HTTP responses
Combination: &&— logical AND, || - OR, !- negation. Filter http && ip.src == 10.0.2.15will show HTTP traffic from a specific host. A !dns && !arpremoves background noise from DNS resolving and ARP requests, leaving your workspace noticeably cleaner.
Finding flags in pcap via packet contents
When the flag format is known (e.g. CTF{...} or flag{...}), searching by content is the fastest way:
frame contains "flag"— searches for a string in the entire frame, including payload and headers
http contains "CTF{"— searches only in HTTP packets
tcp contains "password"— passwords in the TCP stream
dns.qry.name contains "suspicious"— substrings in DNS queries
A separate story - frame matches "flag"Unlike contains, this filter is case-insensitive. See the picoCTF PcapPoisoning analysis on brootware.github.io frame matchesfound the line FLAG, Flag or flagwith one request - no need to sort through options manually.
For regular expressions, the operator matches: filter http.request.uri matches ".*\\.php"will show all requests to PHP scripts. Filter dns.qry.name matches "^[a-f0-9]{8,}\\."will detect DNS queries with hex strings in subdomains - a typical sign of DNS exfiltration.
If the flag format is unknown, a sequential series of requests: frame contains "flag", then frame contains "key", frame contains "secret", frame contains "pass"In entry-level CTFs, the flag appears open in about half of the tasks. Don't make it complicated until you've tested the simpler options.
Limitation: Content filters only work with unencrypted traffic. On encrypted TLS sessions contains And matchesuseless without decryption keys.
Follow TCP Stream Wireshark: Reading Entire Sessions
Right-click on any packet of the session you are interested in → Follow → TCP StreamWireshark assembles all the packets of a single TCP session into a single, readable stream. Red text is data from the client, blue is from the server. Essentially, it's an intercepted conversation, stitched together from disparate fragments.
At the bottom of the Follow TCP Stream window, you can navigate between streams: Stream 0, Stream 1, Stream 2And so on. In CTFs with a small number of threads (up to 20-30), it's worth clicking through each one sequentially, switching the number. It takes a couple of minutes and often leads to a flag faster than complex filters. I almost always do this—blindly clicking through the threads until I spot something suspicious.
Typical findings when using Follow TCP Stream on CTF tasks:
Cleartext flag - if data was sent via HTTP, Telnet, or IRC
Base64 strings - header Authorization: Basicwith Base64-encoded credentials. Decoded via echo "строка" | base64 -d
FTP logins - commands USER / PASSin plain text
Scripts and code - while analyzing the THM Wireshark CTF (cyber-99.co.uk) via Follow Stream, a Python script with ROT13, Base64, and Caesar encryption was discovered. To obtain the flag, I had to copy the code, reverse-engineer the encoding functions (replace b64encodeon b64decode, shift Caesar from +3 to -3) and run the script
HTTP Headers - Non-Standard User-Agent ( wget or curl) indicates automated downloading, which in MITRE ATT&CK terms models the Web Protocols (T1071.001, Command and Control) technique.
Follow Stream output formats are ASCII (for text protocols), Hex Dump (for binary data), and Raw (for saving to disk). These formats are available in the "Show data as" drop-down menu. To save a binary file from the stream, select Raw and click Save AsASCII will corrupt binary data – I've tested it myself.