Wireshark Display Filters: Syntax, Useful Examples and SOC Use Cases
Wireshark display filters hide packets you do not need after capture, so you can focus on what matters. A filter is a field name, an operator and a value, such as ip.addr == 10.0.0.5 or dns.flags.rcode == 3. Combine filters with and, or and not, search payloads with contains and matches, and test for a protocol simply by typing its name, such as tls.
Topic: Security Tools, Authorized Labs & CTFs in Cybersecurity & Ethical Hacking · Commands & reference
Also covers: SOC & Blue Team
Quick answer: Wireshark display filters hide packets you do not need after capture, so you can focus on what matters. A filter is a field name, an operator and a value, such as ip.addr == 10.0.0.5 or dns.flags.rcode == 3. Combine filters with and, or and not, search payloads with contains and matches, and test for a protocol simply by typing its name, such as tls. Display filters are different from capture filters, which use BPF syntax like host 10.0.0.5 and decide what is recorded at all. SOC analysts use display filters to triage alerts, spot failed connections and confirm suspicious traffic.
Key takeaways
- Display filters work on a capture already taken; capture filters limit what is saved.
- The syntax is field, operator, value; the filter bar turns green when it is valid.
- Field names come from the official display filter reference.
- Use filters to narrow an investigation, not as proof of an attack on their own.
- Capture only on networks you own or are authorised to monitor.
Table of Contents
- How Are Display Filters Different From Capture Filters?
- What Is the Basic Display Filter Syntax?
- Which Operators and Functions Should You Know?
- What Are Useful Everyday Display Filters?
- Which Filters Help SOC Analysts Triage Alerts?
- What Common Filter Mistakes Should You Avoid?
- What Legal Rules Apply to Packet Capture?
- References
How Are Display Filters Different From Capture Filters?
| Feature | Display filter | Capture filter |
|---|---|---|
| When applied | After capture, while viewing | Before capture, while recording |
| Syntax | Wireshark fields, e.g. tcp.port == 443 | BPF, e.g. tcp port 443 |
| Effect | Hides packets; nothing deleted | Unmatched packets are never saved |
| Depth | Thousands of protocol fields | Mostly addresses, ports, protocols |
The capture filter guide and pcap-filter(7) describe BPF syntax. When in doubt, capture broadly and filter on display.
What Is the Basic Display Filter Syntax?
Each filter names a protocol field, compares it and gives a value. The User's Guide explains the grammar, and the field reference lists every field. A shortcut: right-click any field in the packet details pane and choose Apply as Filter.
ip.src == 192.168.1.10
tcp.port == 443
http.request.method == "POST"
dns
Typing only a protocol or field name, like dns or tcp.analysis.retransmission, shows packets where it exists.
Which Operators and Functions Should You Know?
| Operator | Meaning | Example |
|---|---|---|
| == or eq | Equal | ip.addr == 10.0.0.5 |
| != or ne | Not equal | tcp.port != 22 |
| > < >= <= | Greater or less than | frame.len > 1000 |
| and, or, not | Combine conditions | tcp and not tcp.port == 443 |
| contains | Bytes or text inside a field | http.host contains example |
| matches | Regular expression, case-insensitive by default | http.user_agent matches curl |
| in | Value in a set | tcp.port in {80 443 8080} |
The wireshark-filter(4) page documents these, plus functions such as len() and lower().
What Are Useful Everyday Display Filters?
ip.addr == 10.0.0.5 and tcp.port == 443 # one host, HTTPS
tcp.flags.syn == 1 and tcp.flags.ack == 0 # new connection attempts
tcp.analysis.flags # retransmissions, resets, issues
icmp # ping and errors
arp # address resolution
dhcp # IP lease traffic (bootp on old versions)
Which Filters Help SOC Analysts Triage Alerts?
During triage, filters help answer one question at a time, which fits the analysis phase in NIST SP 800-61 Rev. 3.
| Question | Display filter |
|---|---|
| Are connections being refused? | tcp.flags.reset == 1 |
| Are there failed DNS lookups (possible DGA)? | dns.flags.rcode == 3 |
| Are credentials sent in clear text? | http.request.method == "POST" or ftp or telnet |
| Which TLS sites were contacted? | tls.handshake.extensions_server_name |
| Is there unexpected SMB traffic? | smb2 and not ip.dst == 10.0.0.0/8 |
| Are large DNS answers present (possible tunnelling)? | dns and frame.len > 512 |
For regular beacons, filter on the suspicious host, then use Statistics, Conversations and I/O Graphs to see the timing pattern. Malware often hides command traffic inside normal protocols, as described in MITRE ATT&CK T1071. Treat any match as a lead to confirm with logs, EDR and threat intelligence.
What Common Filter Mistakes Should You Avoid?
- Using != on multi-value fields:
ip.addr != 10.0.0.5can still match. Use!(ip.addr == 10.0.0.5). - Mixing up syntaxes:
host 10.0.0.5is a capture filter and fails in the display bar. - Expecting to read encrypted payloads: TLS content stays hidden without the session keys.
- Forgetting non-standard ports: filter on the protocol name, not only the port number.
What Legal Rules Apply to Packet Capture?
Packets can contain personal data, so a capture falls under India's DPDP Act 2023 as well as company policy. Capture only on networks you own or are authorised to monitor in writing; unauthorised interception can breach the IT Act 2000. Store captures securely and delete them when the case closes.
New to the tool? Start with Wireshark for beginners, then compare with our list of the most important Wireshark filters. Our SOC analyst training includes packet analysis labs.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0