Essential Wireshark Filters for Cybersecurity Professionals

Wireshark uses two kinds of filters. Capture filters (Berkeley Packet Filter syntax, such as host 10.0.0.5 and port 443) decide what is recorded. Display filters (Wireshark syntax, such as ip.addr == 10.0.0.5 && tls) decide what you see in a capture.

Jul 22, 2025 - 12:40
Updated: 
104.7k

Security Tools, Authorized Labs & CTFs in Cybersecurity & Ethical Hacking · Explainer

Essential Wireshark Filters for Cybersecurity Professionals

Quick answer: Wireshark uses two kinds of filters. Capture filters (Berkeley Packet Filter syntax, such as host 10.0.0.5 and port 443) decide what is recorded. Display filters (Wireshark syntax, such as ip.addr == 10.0.0.5 && tls) decide what you see in a capture. The most useful security display filters isolate a host or conversation, show DNS queries and HTTP requests, find TCP SYN scans, highlight clear-text credentials, inspect TLS handshakes and server names, and spot retransmissions or resets. Learn a few operators and you can build any filter you need.

Key takeaways

  • Capture filters reduce file size; display filters help analysis.
  • Display filters use field names such as ip.src, dns.qry.name and tls.handshake.extensions_server_name.
  • tshark applies the same filters from the command line for automation.
  • Encrypted traffic still shows metadata such as server names and certificates.
  • Capture only on networks you own or are authorised to monitor.

Table of Contents

What Is the Difference Between Capture and Display Filters?

Capture filterDisplay filter
When appliedWhile capturingAfter capture, any time
Syntaxpcap-filter (BPF)Wireshark filter language
Exampletcp port 80 and host 192.168.1.10http && ip.addr == 192.168.1.10
EffectUnmatched packets are never savedUnmatched packets are hidden, not deleted

Which Operators Should You Know?

OperatorMeaningExample
==, !=Equal, not equaltcp.port == 22
&&, ||, !And, or, notdns || http
containsField contains bytes or texthttp.user_agent contains "curl"
matchesRegular expressiondns.qry.name matches "\.(zip|top)$"
inValue in a settcp.port in {80 443 8080}

Which Basic Filters Are Used Most?

ip.addr == 10.0.0.5                      # traffic to or from a host
ip.src == 10.0.0.5 && ip.dst == 8.8.8.8  # one direction
tcp.stream eq 7                          # one TCP conversation
dns                                      # all DNS
dns.qry.name contains "example"          # specific lookups
http.request                             # HTTP requests only
http.response.code >= 400                # HTTP errors
icmp                                     # ping and ICMP errors
!(arp || stp || mdns)                    # hide common noise

Which Filters Help with Security Investigations?

GoalDisplay filter
SYN scan (SYN without ACK)tcp.flags.syn == 1 && tcp.flags.ack == 0
Connection resetstcp.flags.reset == 1
Clear-text login protocolsftp || telnet || pop || imap || http.authorization
HTTP POST requests (form submissions)http.request.method == "POST"
Suspicious user agentshttp.user_agent contains "python" || http.user_agent contains "curl"
Long DNS names (possible tunnelling)len(dns.qry.name) > 50
SMB file activitysmb2.cmd == 5 (create) or smb2
Kerberos traffickerberos
ARP spoofing hintsarp.duplicate-address-detected
Wi-Fi deauthentication frameswlan.fc.type_subtype == 0x0c

The full list of field names is in the display filter reference.

How Do You Analyse TLS Traffic?

tls.handshake.type == 1                              # Client Hello
tls.handshake.extensions_server_name contains "bank" # server names requested (SNI)
tls.handshake.type == 11                             # certificates
tls.record.version == 0x0301                         # legacy TLS 1.0 records

To decrypt traffic from your own browser for troubleshooting, set the SSLKEYLOGFILE environment variable before starting the browser and point Wireshark to that file under the TLS protocol preferences, as described on the Wireshark TLS wiki. Keep key log files secret and delete them afterwards.

How Do You Use Filters with tshark?

# Capture 60 seconds of DNS on eth0 into a file (capture filter)
tshark -i eth0 -f "udp port 53" -a duration:60 -w dns.pcapng

# Read a file and list DNS queries (display filter + fields)
tshark -r dns.pcapng -Y "dns.flags.response == 0" -T fields -e frame.time -e ip.src -e dns.qry.name

# Top talkers by IP conversation
tshark -r capture.pcapng -q -z conv,ip

See the tshark manual for more options.

What Mistakes Do Beginners Make?

  • Using display syntax in the capture filter box, or the reverse.
  • Writing ip.addr != 10.0.0.5 when they mean !(ip.addr == 10.0.0.5); the first still matches packets where either address differs.
  • Capturing everything on busy links and creating huge files.
  • Capturing traffic on networks without permission.

Related: Wi-Fi troubleshooting and Kismet. WebAsha offers network forensics and SOC training.

References

Frequently Asked Questions

Capture filters decide what is recorded using BPF syntax; display filters decide what you see in Wireshark.

Use the display filter ip.addr == 10.0.0.5, or the capture filter host 10.0.0.5.

Filter tcp.flags.syn == 1 && tcp.flags.ack == 0 to see SYN packets without acknowledgements.

Use tls.handshake.extensions_server_name to see the server names requested in TLS handshakes.

Yes, for your own sessions, using a TLS key log file from the browser via SSLKEYLOGFILE.

Wireshark’s command-line version, which uses the same filters for scripted analysis.

It matches packets where either address differs. Use !(ip.addr == X) instead.

Only on networks you own or are authorised to monitor; capturing others’ traffic can be illegal.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.