Skip to content

Security Operations / Network monitoring · Step 4 of 6

Lesson: Wireshark Display FiltersSwitch
← Security Operations

Security investigations

Wireshark Display Filters

Narrow a capture to the packets you care about using display filters.

Wireshark can show thousands of packets. A display filter hides the ones that do not match. It does not delete anything, so clearing the filter brings them all back. Only analyse traffic you are allowed to see.

Two different filter languages

Capture filters decide what gets recorded, and use libpcap syntax such as tcp port 443. Display filters work on packets already captured and use Wireshark's own syntax, such as tcp.port == 443. Mixing them up is a common mistake.

Basic filters

Type these in the filter bar:

dns
ip.addr == 10.0.0.5
ip.src == 10.0.0.5 && tcp.dstport == 443
tcp.port == 80 || tcp.port == 443
!arp

ip.addr matches source or destination. tcp.port does the same for ports. Combine with && (and), || (or) and ! (not). Use parentheses when you mix them.

To exclude a host, write !(ip.addr == 10.0.0.5). The form ip.addr != 10.0.0.5 has changed meaning between Wireshark versions, so the first form is clearer.

Useful for troubleshooting

dns.flags.rcode != 0
tcp.flags.syn == 1 && tcp.flags.ack == 0
tcp.flags.reset == 1
tcp.analysis.retransmission
http.response.code >= 400

These show DNS errors, connection attempts, TCP resets, suspected retransmissions and HTTP errors. tcp.analysis results are Wireshark's own inference from what it captured. HTTP fields are only visible when the traffic is unencrypted or Wireshark can decrypt it.

A filter with valid syntax can still ask the wrong question.

On the command line, tshark accepts the same language with -Y:

$ tshark -r web.pcapng -Y "dns.flags.rcode != 0"

Try it

Capture a few seconds of your own machine's traffic, run dig example.com while capturing, then apply dns. Find the query and its response. Encrypted DNS or a local cache may change what you see.

Check your understanding

Wireshark Display Filters

All 3 sections · no timer

Unlimited retries

Questions from every section are combined into one assessment. Answer them all correctly to complete the article.

Your completion saves in this browser. Sign in to sync it to your account.