Most time lost in a packet capture is lost typing filters that silently match nothing, or match far more than the analyst thinks. This cheat sheet collects tested Wireshark display filters for security triage, grouped by task: DNS, HTTP, TLS server names, SMB, Kerberos and NTLM, plus hunting patterns, the operator and function reference, and the difference between display and capture filters. Field names were checked against the Wireshark Display Filter Reference, which lists them for releases up to 4.6. It is for SOC analysts, incident responders and network engineers who already capture traffic. For capture design, TLS decryption, TShark automation and safe handling of captures, see the Wireshark for Security Analysis Guide.
This is an independent guide from NHI Mgmt Group, based on Wireshark's public documentation as of November 2026. It is not sponsored or reviewed by the Wireshark project. Dissector fields change between releases, so confirm field names against the current Display Filter Reference.
Key takeaways
- Display filters never discard data. They hide packets already captured, so you can refine them freely; capture filters use a different syntax (libpcap) and drop packets for good.
- Field names come from dissectors. If a filter turns red or matches nothing, check the exact field in the Display Filter Reference or by right clicking a field and choosing Apply as Filter.
- Negation is the classic trap. Since Wireshark 3.6,
!=means "all not equal", soip.addr != 10.0.0.5removes every packet involving that host; older playbooks may assume the opposite. - Protocol fields beat port numbers.
dns,httpandtlsmatch by dissector, which catches services on odd ports that atcp.portfilter misses. - Save the filter with the evidence. Record every filter used to reach a finding so another analyst can reproduce it, and turn repeat filters into saved filter buttons for the team.
How to use this template
- Replace placeholders:
10.0.0.5,example.organd[Organisation]values are examples. Swap in the host, domain, realm or share from your case. - Start broad, then narrow: open the capture with a protocol filter (
dns,kerberos), then addandclauses. Use Statistics, Conversations and Protocol Hierarchy first to see what is actually in the file. - Check the version: run Help, About Wireshark and confirm the release. Fields such as
tls.handshake.ja4exist only from 4.2 onwards; older sensors and analyst laptops may not know them. - Script the keepers: the same filters work in TShark with
-Y, so a filter proven in the GUI can run across a folder of captures. - Adapt for [Organisation]: add your internal resolver addresses, domain controllers, proxy ranges and approved TLS destinations to the hunting filters, and store the result in your runbook.
Syntax basics
A display filter is a protocol name, a field, or a comparison between a field and a value, joined with logical operators. A bare protocol or field name tests for presence: tls shows every frame the TLS dissector decoded, and http.authorization shows every frame with that header.
| Pattern | Example | What it matches |
|---|---|---|
| Protocol present | dns | Frames decoded as DNS, on any port |
| Field present | http.cookie | Frames carrying a Cookie header |
| Field equals value | ip.src == 10.0.0.5 | Source address is 10.0.0.5 |
| Subnet (CIDR) | ip.addr == 192.168.0.0/24 | Either address in the subnet |
| Set membership | tcp.port in {80, 443, 8080} | Any of the listed ports |
| Range in a set | tcp.port in {443, 4430..4434} | 443 or 4430 to 4434 |
| String contains | http.user_agent contains "curl" | Substring, case sensitive |
| Regular expression | http.host matches "acme\\.(org|com|net)" | PCRE2 match, case insensitive |
| Combined | dns and not ip.addr == 10.0.0.53 | DNS not involving the internal resolver |
- Strings: use double quotes. Regular expressions are parsed twice (by Wireshark, then PCRE2), so backslashes are doubled; a raw string such as
r"\(X11;"avoids the doubling. - Brackets: group with parentheses, for example
(dns or http) and ip.src == 10.0.0.5. Without them, mixedandandorclauses are easy to misread. - Colour feedback: green means valid syntax, red means invalid, yellow warns that the filter may not do what you expect (often a
!=on a multi value field).
Protocol filters
Filters by task, using field names listed in the Wireshark Display Filter Reference. Numeric values (record types, message types, status codes) come from the protocol specifications.
DNS
| Task | Filter |
|---|---|
| Queries only | dns.flags.response == 0 |
| Responses only | dns.flags.response == 1 |
| A name and its subdomains | dns.qry.name contains "example.org" |
| Failed lookups (NXDOMAIN) | dns.flags.rcode == 3 |
| TXT queries (record type 16) | dns.qry.type == 16 |
| Long query names | dns.qry.name.len > 50 |
| Answers resolving to a given address | dns.a == 203.0.113.10 |
| Very short TTLs in answers | dns.resp.ttl < 60 |
| Responses with many answers | dns.count.answers > 10 |
HTTP (cleartext)
| Task | Filter |
|---|---|
| All requests | http.request |
| POST requests | http.request.method == "POST" |
| Server errors | http.response.code >= 500 |
| Requests to a host | http.host == "example.org" |
| Unusual or scripted clients | http.user_agent matches "(?i)(curl|python|powershell|wget)" |
| Basic authentication in cleartext | http.authbasic or http.authorization contains "Basic" |
| Long URIs | len(http.request.uri) > 200 |
| Redirects and where they go | http.location |
| Executable downloads by content type | http.content_type contains "application/x-msdownload" |
TLS
| Task | Filter |
|---|---|
| Client Hello (handshake type 1) | tls.handshake.type == 1 |
| Server name (SNI) is a domain | tls.handshake.extensions_server_name == "example.org" |
| SNI matches a pattern | tls.handshake.extensions_server_name matches "\\.(top|xyz)$" |
| Client Hello with no SNI | tls.handshake.type == 1 and not tls.handshake.extensions_server_name |
| Certificates in the clear (TLS 1.2 and earlier) | tls.handshake.type == 11 |
| Legacy record versions (TLS 1.0 = 0x0301, 1.1 = 0x0302) | tls.record.version in {0x0301, 0x0302} |
| Alerts (failed handshakes) | tls.alert_message |
| ALPN offered | tls.handshake.extensions_alpn_str == "h2" |
| Fingerprint present (JA3 from 3.6, JA4 from 4.2) | tls.handshake.ja4, tls.handshake.ja3 |
In TLS 1.3 the server certificate is encrypted, so tls.handshake.type == 11 only shows it if you supplied decryption secrets. The SNI is still visible unless Encrypted Client Hello is in use. See the JA3 and JA4 TLS Fingerprinting Guide.
SMB2/3, Kerberos and NTLM
| Task | Filter |
|---|---|
| Session setup (SMB2 command 1) | smb2.cmd == 1 |
| Tree connects to shares (command 3) | smb2.cmd == 3 |
| Admin share access | smb2.tree matches "(?i)(ADMIN|C|IPC)\\$$" |
| File opens (Create, command 5) for a name | smb2.cmd == 5 and smb2.filename contains ".ps1" |
| SMB errors | smb2.nt_status != 0 |
| Accounts authenticating over SMB | smb2.acct |
| Kerberos AS-REQ / TGS-REQ (types 10 and 12) | kerberos.msg_type in {10, 12} |
| Kerberos errors (KRB-ERROR, type 30) | kerberos.msg_type == 30 |
| Pre-authentication failed (error 24) | kerberos.error_code == 24 |
| Unknown client principal (error 6) | kerberos.error_code == 6 |
| Tickets for a service | kerberos.SNameString == "MSSQLSvc" |
| RC4 encryption type (23) in tickets | kerberos.etype == 23 |
| NTLM authenticate messages (type 3) | ntlmssp.messagetype == 0x00000003 |
| NTLM user names | ntlmssp.auth.username |
SMB 3 encryption hides commands and file names; you will see only the encrypted transform. See the SMB Protocol Security and Signing Guide and Kerberos vs NTLM.
Security hunting filters
Hunting filters narrow a large capture to traffic worth a closer look. None of them proves malice on its own: each result needs context from logs, the asset owner or threat intelligence.
| Hypothesis | Filter | What to check next | ATT&CK |
|---|---|---|---|
| Hosts bypassing the internal resolver | dns and not ip.addr in {10.0.0.53, 10.0.0.54} | Which process and why; DoH on 443 will not show here | T1071.004 DNS |
| DNS tunnelling or exfiltration | dns.qry.name.len > 50 or dns.qry.type == 16 | Volume per domain, entropy of labels | T1071.004, T1048 |
| Cleartext credentials on the wire | http.authbasic or ftp.request.command == "PASS" | Rotate the secret and move the service to TLS | T1040 Network Sniffing (the exposure) |
| Kerberoasting style ticket requests | kerberos.msg_type == 12 and kerberos.etype == 23 | Many service tickets from one client in a short window | T1558.003 Kerberoasting |
| Password spraying against Kerberos | kerberos.error_code == 24 | Many users failing from one source | T1110.003 Password Spraying |
| Lateral movement over admin shares | smb2.cmd == 3 and smb2.tree contains "ADMIN$" | Source host, account, follow-on service creation | T1021.002 SMB/Windows Admin Shares |
| Port scanning | tcp.flags.syn == 1 and tcp.flags.ack == 0 | Statistics, Conversations: one source, many destinations | T1046 Network Service Discovery |
| Rejected connections | tcp.flags.reset == 1 | Scans, blocked egress, failing services | T1046 |
| Downloads of scripts and binaries | http.request.uri matches "\\.(exe|dll|ps1|hta|vbs)$" | Export the object, hash it, check reputation | T1105 Ingress Tool Transfer |
- Beaconing: filter on one destination (
ip.dst == 203.0.113.10 and tcp.flags.syn == 1), then use Statistics, I/O Graphs to look for regular intervals. Long captures are better analysed with flow tooling; see the Beaconing and C2 Detection Guide. - Time window around an alert: select the alert packet, then use a field reference,
frame.time_relative >= ${frame.time_relative} - 300, to show the five minutes before it. - Noise reduction: exclude known good traffic with a saved clause, for example
not (arp or mdns or ssdp or llmnr), before you start reading. - Tunnelled traffic: the layer operator reads the inner header of encapsulated traffic:
ip.addr#2 == 192.168.30.40matches only the second IP layer.
For hunt planning and hypotheses beyond a single capture, see Network Threat Hunting and How to Hunt for Kerberoasting.
Operators and functions
| English | C-like | Meaning |
|---|---|---|
eq (any_eq) | == | Equal (any occurrence if the field repeats) |
ne (all_ne) | != | Not equal (all occurrences) |
all_eq | === | Equal (all occurrences) |
any_ne | !== | Not equal (any occurrence) |
gt, lt, ge, le | >, <, >=, <= | Greater, less, greater or equal, less or equal |
contains | Protocol, field or slice contains a value | |
matches | ~ | Perl compatible regular expression (PCRE2) |
and, or, xor, not | &&, ||, ^^, ! | Logical operators |
in | Set membership, with .. ranges |
The negation trap in practice: to hide one host, write !(ip.addr == 10.0.0.5) or ip.addr != 10.0.0.5 on 3.6 and later; both now exclude every frame where either address is 10.0.0.5. To keep frames where at least one address differs, use ip.addr !== 10.0.0.5. English operators are case insensitive from Wireshark 5.0.
| Function or feature | Example | Use |
|---|---|---|
len() | len(http.request.uri) > 100 | Byte length of a string or bytes field |
lower(), upper() | lower(http.server) contains "apache" | Case insensitive substring tests |
count() | count(ip.addr) > 2 | Number of occurrences in a frame (tunnels, ICMP errors) |
string() | string(frame.number) matches "[13579]$" | Treat a non-string field as text |
max(), min() | max(tcp.srcport, tcp.dstport) <= 1024 | Both ports in the well known range |
Slice [n:m] | eth.src[0:3] == 00:00:83 | Vendor prefix (OUI) of a MAC address |
Bitwise AND & | tcp.flags & 0x02 | Test single flag bits |
| Arithmetic in braces | frame.cap_len < { 14 + ip.hdr_len + tcp.hdr_len } | Frames with no TCP payload captured |
Field reference ${} | http and ip.dst eq ${dns.a} | Compare with the selected packet's value |
Raw bytes @ | @field == aa:bb | Compare undecoded bytes instead of the displayed value |
Subtraction needs a space before the minus sign (A - B), because A-B can be read as a field name.
Display vs capture filters
Capture filters are written in the libpcap language (documented in the pcap-filter manual page) and decide what is stored. Display filters use Wireshark's own field language and decide what is shown. The syntaxes are not interchangeable: host 10.0.0.5 is a capture filter, ip.addr == 10.0.0.5 is a display filter.
| Aspect | Capture filter | Display filter |
|---|---|---|
| Language | libpcap / BPF primitives: host, net, port, src, dst | Dissector fields: ip.src, dns.qry.name |
| When applied | Before packets are written | After capture, on loaded packets |
| Effect | Excluded packets are lost | Packets are hidden, never deleted |
| Protocol awareness | Header offsets, ports and addresses only | Full decode, including application fields |
| Where used | Capture Options, dumpcap and TShark -f, tcpdump | Display filter bar, TShark -Y, colouring rules |
| Example: one host | host 10.0.0.5 | ip.addr == 10.0.0.5 |
| Example: telnet except from one host | tcp port 23 and not src host 10.0.0.5 | tcp.port == 23 and ip.src != 10.0.0.5 |
| Example: DNS | port 53 | dns (also matches DNS on other ports) |
When to use which: capture filters keep sensor files small on busy links and limit the personal data you collect, so use them for scope (the host or segment approved for capture). Use display filters for analysis. If you are unsure what an incident involved, capture wider for a short, bounded window and filter on display, because a capture filter cannot be undone. See the Network Monitoring and Packet Capture Guide.
Framework fit: packet analysis supports NIST CSF 2.0 DE.AE-02 (potentially adverse events are analysed), NIST SP 800-53 SI-4 System Monitoring, ISO/IEC 27001:2022 Annex A 8.16 Monitoring activities and CIS Controls v8.1 Control 13 Network Monitoring and Defense.
Practitioner checklist
- Confirm the Wireshark release on every analyst workstation and sensor, and keep it current.
- Store [Organisation]'s resolvers, domain controllers and proxies as saved filter clauses.
- Start every capture review with Protocol Hierarchy and Conversations before filtering.
- Filter by protocol name rather than port where the dissector exists.
- Review older playbooks for
!=filters written before Wireshark 3.6. - Record the exact filter beside each finding in the case notes.
- Turn every cleartext credential found into a rotation ticket and a transport fix.
- Use capture filters only for approved scope; analyse with display filters.
- Share proven filters as filter buttons or TShark scripts across the SOC.
Standards and references
- Wireshark: User's Guide, Building Display Filter Expressions
- Wireshark: User's Guide, Filtering While Capturing
- Wireshark: Display Filter Reference, TLS
- Wireshark: Display Filter Reference, DNS
- Wireshark: Display Filter Reference, HTTP
- Wireshark: Display Filter Reference, SMB2
- Wireshark: Display Filter Reference, Kerberos
- IETF: RFC 4120, The Kerberos Network Authentication Service (V5)
Related NHI Mgmt Group resources: Wireshark for Security Analysis Guide · Network Forensics Guide · Network Threat Hunting · DNS Security Guide