Table of contents
Wireshark has a huge variety of different filters. And there is a huge documentation devoted to these filters. This documentation is not easy to understand. I have compiled the most interesting Wireshark Filters for me – for novice users this can become something like a reference for Wireshark filters. By the way, here in the comments you can share filters that you like – I will add them to this list.
Remember that Wireshark has display filters and capture filters. Here I consider the display filters that are entered in the main window of the program in the top field below the menu and icons of the main functions.
To fully understand the importance of filters and their meanings, it is necessary to understand how the network works.
Some filters are written here in a general form, and some are made as literal examples. Remember that in any case you can substitute your data, for example, change the port number to any one of your interest, and also do the same with the IP address, MAC address, time value, etc.
Filters can have different values, for example, it can be a string, a hexadecimal format or a number.
If an inaccurate entry is sought (better suited for non-numeric values) then contains is used. For example, to show TCP packets containing the string hackware you need the following filter:
tcp contains hackware
Operators are used to find exact values. Consider them:
|<=/le||Less than or equal|
|>=/ge||Greater than or equal|
As you can see, there are two versions, for example, if we want to indicate that the filter value is equal to something, then we can use == or eq.
Filters using logical operands can be used to build rather complex structures, but apparently, usage of the same filter with comparison operators is buggy. For example, as here in an attempt to filter not one port, but the range of ports:
tcp.port>=8000 && tcp.port<=8180
But actually the filter value (in this case, tcp.port) is overwritten by the last value, so as a result, instead of the expected behavior, we get the result of only the last part, in this case it is
Keep in mind this bug!
When using with == (equal), this bug is missing.
Logical operators allow you to create detailed filters using several conditions at once. It is recommended to use brackets additionally, because otherwise you may not get the result you expect.
|AND/&&||Logical AND, data is output if they match to both parts of the filter. For example, the ip.src==192.168.1.1 and tcp filter will show only packets that originate from 192.168.1.1 and which are associated with the TCP protocol. Only data matching both conditions will be displayed.|
|OR/||||Logical OR, it is enough that only one condition is true; if both are true, then this also fine. For example, the tcp.port==80 or tcp.port==8080 filter will show TCP packets that are related (are the source or destination) to port 80 or 8080.|
|NOT/!||Boolean is NOT used when we want to exclude some packages. That is, all packets will be shown, except those that satisfy the condition following the NOT. For example, the filter !dns will show all packets except DNS.|
Show HTTP or DNS traffic:
http or dns
Show all traffic except ARP, ICMP and DNS:
!(arp or icmp or dns)
Show packets only sent or received on the wlan0 interface:
frame.interface_name == "wlan0"
To show ARP traffic:
Show ARP protocol frames sent from device with MAC address 00:c0:ca:96:cf:cb:
arp.src.hw_mac == 00:c0:ca:96:cf:cb
Show ARP protocol frames sent from a device with an IP address 192.168.50.90:
arp.src.proto_ipv4 == 192.168.50.90
Show ARP protocol frames sent to a device with a MAC address 00:00:00:00:00:00 (this address is used when the protocol tries to find out the target MAC address. Another popular address that can confuse you is ff:ff:ff:ff:ff:ff, this is broadcast address, that is, messages with this address are for all devices on the local network):
arp.dst.hw_mac == 00:00:00:00:00:00
Show ARP protocol frames sent to the device having the IP address 192.168.50.1:
arp.dst.proto_ipv4 == 192.168.50.1
Show Ethernet traffic:
Show frames (in general, all frames, not just ARP, as it was in the previous examples) sent from a device that has the MAC address 00:c0:ca:96:cf:cb:
eth.src == 00:c0:ca:96:cf:cb
Show frames sent to device with MAC address 78:cd:8e:a6:73:be:
eth.dst == 78:cd:8e:a6:73:be
Show IP traffic (this includes TCP, UDP, as well as application layer protocols DNS, HTTP – that is, almost everything except the data link layer protocols that do not use IP addresses for data transmission (in local Ethernet networks they use MAC addresses)):
More precisely, it means IPv4 traffic, which is usually called just IP (Internet Protocol).
Show traffic associated with a specific IP address (enter it instead of x.x.x.x). Packets will be shown in which this IP address is the source of the data OR the recipient:
ip.addr == x.x.x.x
Show traffic associated with these two IP addresses. According to the only possible situation, one of these addresses is the source, and the second is the destination address.
ip.addr == x.x.x.x && ip.addr == y.y.y.y
Show traffic originated from the host with the IP address 18.104.22.168:
ip.src == 22.214.171.124
Show traffic whose destination is the host with the IP address 126.96.36.199:
ip.dst == 188.8.131.52
Please note, IP protocol operates with IP addresses, but does not operate with ports. Ports are part of the TCP and UDP protocols. IP protocol is only responsible for routing traffic between nodes.
Show IPv6 traffic (Internet Protocol version 6):
Other filters with an IP address are similar for IPv6 and IPv4.
To see only TCP traffic:
Show traffic whose source or destination port is a specific port, for example, 8080:
Show traffic originating from port 80:
tcp.srcport == 80
Show the traffic that is sent to the service listening on port 80:
tcp.dstport == 80
Show TCP packets with the SYN flag enabled:
Show TCP packets with the SYN flag enabled and the ACK flag disabled:
tcp.flags.syn==1 && tcp.flags.ack==0
Similarly for other flags:
You can also use syntax like tcp.flags == 0x0XX, for example:
- FIN is tcp.flags == 0x001
- SYN is tcp.flags == 0x002
- RST is tcp.flags == 0x004
- ACK is tcp.flags == 0x010
- ACK and FIN set simultaneously is tcp.flags == 0x011
- ACK and SYN set simultaneously is tcp.flags == 0x012
- ACK and RST set simultaneously is tcp.flags == 0x014
To show packages containing any string, for example, the hackware string:
tcp contains hackware
Follow TCP stream number X:
tcp.stream eq X
Filter by stream number:
tcp.seq == x
Show transmitted packets. Helps track application performance and packet loss:
This filter displays problematic packets (lost segments, transmiting, etc.) TCP Keep-Alive packets pass this filter, but they are not an indication of problems.
Filters to assess the quality of a network connection.
The following specifications apply to TCP frames. Moreover, they are not based on frame headers – the considered characteristics (data omission, duplicates) are assigned by the Wireshark program based on the analysis.
The filter displays information about frames with the ACK flag, which are duplicates. A large number of such frames may be a sign of communication problems:
tcp.analysis.duplicate_ack_num == 1
Show frames for which the previous segment is not captured:
This is normal at the beginning of data capture – because the information is not intercepted from the very beginning of the session.
To display frames that are retransmission (resend):
Show frames that are not received in the correct order:
To see only UDP traffic:
Flags are not used for UDP. For this protocol, you can only specify the port.
Show traffic originating from port 53:
udp.srcport == 53
Show the traffic that is sent to the service listening on port 53:
udp.dstport == 53
A UDP packet containing a specific string, for example, a hackware string:
udp contains hackware
To see only ICMP traffic:
To see only ICMP v6 traffic (sixth version)
Show all answers to ping:
Show all ping requests:
Show all unreachable/prohibited host and port errors
Show all attempts to redirect routing using ICMP:
Other ICMP types and CODE options are here: https://www.frozentux.net/iptables-tutorial/iptables-tutorial.html#TCPOPTIONS
An example of using the CODE value, the following filter will show messages about the port unreachable:
icmp.type == 3 && icmp.code == 3
For the application protocols of HTTP, DNS, SSH, FTP, SMTP, RDP, SNMP, RTSP, GQUIC, CDP, LLMNR, SSDP there are filters that are called like the protocols themselves, but are written in small letters.
For example, to see HTTP traffic:
To see the traffic of the new HTTP/2 protocol:
Remember that when deciding which protocol the transmitted data belongs to, the program considers the used port number. If a non-standard port is used, the program will not be able to find the necessary data. For example, if you connect to SSH on port 1234, the ssh filter will not find SSH traffic.
A filter that shows only the data sent by the POST method:
http.request.method == "POST"
A filter that shows only the data transmitted by the GET method:
http.request.method == "GET"
Search for requests to a specific site (host):
http.host == "<URL>"
Search requests to a specific site by part of the name:
http.host contains "here.particle.name"
Filter for outputting HTTP requests in which cookies were transmitted:
Requests in which the server has set cookies in the user's browser.
To search for any transferred images:
http.content_type contains "image"
To search for certain types of images:
http.content_type contains "gif" http.content_type contains "jpeg" http.content_type contains "png"
To search for files of a specific type:
Search for requests for files of a certain type. For example, to search for transferred ZIP archives:
http.request.uri contains "zip"
Instead of http.request.uri for greater accuracy, you can use the http.request.uri.path or http.request.uri.query filters, for example, to search for requests to download JPG files (links to pictures):
http.request.uri.path contains "jpg"
You can also filter requests that contain a specific HTTP REFERRER header value. For example, to search for queries in which the referrer is ru-board.com:
http.referer contains "ru-board.com"
Search requests with any authorization. Similarly, with the help of contains you can search for certain types of authorization:
Search for files in the HTTP stream:
To see which HTTP data is delayed, use the following construct:
It will show traffic received after 1 second.
To investigate problems, you can analyze the status of HTTP response codes. For example, the following filter will show traffic for which a 404 Not Found error was received (page not found):
http.request && !(http.request.uri contains ".ico" or http.request.uri contains ".css" or http.request.uri contains ".js" or http.request.uri contains ".gif" or http.request.uri contains ".jpg")
To see all DNS queries and answers:
To see which DNS queries took a lot of time:
The answers that came more than a second after sending the request will be shown.
This filter shows which dns requests cannot be correctly resolved:
dns.flags.rcode != 0
Show only DNS queries:
dns.flags.response == 0
Show only DNS responses:
dns.flags.response == 1
Show requests and responses in which the IP for google.com is searched:
dns.qry.name == "google.com"
Show DNS requests and responses for A record:
dns.qry.type == 1
Show DNS requests and responses for AAAA records:
dns.qry.type == 28
Show answers in which 184.108.40.206 is sent for the A record as IP:
dns.a == 220.127.116.11
Show replies in which 2a01:4f8:172:1d86::1 sent to the AAAA as IP
dns.aaaa == 2a01:4f8:172:1d86::1
Find certain value (apollo.archlinux.or) of CNAME:
dns.cname == "apollo.archlinux.org"
Show answers longer than 30:
dns.resp.len > 30
Show requests with a length of more than 25:
Show DNS server responses for which recursion is available:
dns.flags.recavail == 1
Show DNS server responses for which recursion is not available:
dns.flags.recavail == 0
Is recursion desirable (if the requested DNS server does not have host name information, should it query other DNS servers for this information):
dns.flags.recdesired == 1
If 1 is set, then recursion is needed, if 0 is set, then it is not desirable.
Whether to accept unauthenticated data (0 means do not accept, 1 means accept):
dns.flags.checkdisable == 0
To see how IP addresses are assigned by DHCP:
To show DHCP requests:
bootp.option.dhcp == 3
To show DHCP Discover:
bootp.option.dhcp == 1
SMB filter. This filter in the Info column shows the entire tree (ball) of connections, open directories and open files in the trace.
smb2.cmd==3 or smb2.cmd==5
Show elements of four-ways handshakes (i.e. EAPOL protocol frames):
Show Beacon frames:
wlan.fc.type_subtype == 0x08
Show Probe Response frames:
wlan.fc.type_subtype == 0x05
Show all at once: EAPOL, beacons, Probe Response:
wlan.fc.type_subtype == 0x08 || wlan.fc.type_subtype == 0x05 || eapol
Show wireless frames for a specific device with the BSSID MAC address:
Show EAPOL, Beacons, Probe Response for a specific device with a MAC address of 28:28:5D:6C:16:24:
(wlan.fc.type_subtype == 0x08 || wlan.fc.type_subtype == 0x05 || eapol) && wlan.addr==28:28:5D:6C:16:24
Show all PMKID:
eapol && wlan.rsn.ie.pmkid
Show PMKID, Beacons, Probe Response:
(wlan.fc.type_subtype == 0x08 || wlan.fc.type_subtype == 0x05 || (eapol && wlan.rsn.ie.pmkid))
Show PMKID, Beacons, Probe Response for access point with MAC address 40:3D:EC:C2:72:B8:
(wlan.fc.type_subtype == 0x08 || wlan.fc.type_subtype == 0x05 || (eapol && wlan.rsn.ie.pmkid)) && wlan.addr==40:3D:EC:C2:72:B8
Show only the first message of the handshake:
wlan_rsna_eapol.keydes.msgnr == 1
Show only the second message of the handshake (can be used for the handshake Message of any number):
wlan_rsna_eapol.keydes.msgnr == 2
Show frames for access points with a speed (Data Rate) of 1 Mb/s:
wlan_radio.data_rate == 1
Show frames for access points at speeds above 10 Mb/s:
wlan_radio.data_rate > 10
Show access points on a specific frequency:
radiotap.channel.freq == 2412
Show access points with a certain signal level:
wlan_radio.signal_dbm > -50
Filters associated with the presence of an antenna on a device:
radiotap.present.antenna == 1
radiotap.antenna == 1
If you know other interesting Wireshark filters, please share them in the comment section.
- Rogue Wi-Fi AP with mitmAP: setting up and data analysis (41.5%)
- How to intercept and analyze traffic in open Wi-Fi (40.9%)
- bettercap 2.x: how to install and use in Kali Linux (37.5%)
- Sniffer for Windows: Intercepter-NG manual (37.5%)
- Ettercap user manual: man-in-the-middle attack (MitM), password interception, HSTS bypass, data modification on the fly, custom filters and plug-ins usage, BeEF hooks, infection with backdoors (37.5%)
- All Airgeddon Hints (RANDOM - 4%)