
The field text on its own may sometimes work (e.g. List possible fields: tshark -G Fields Cheatsheet Show detailed view of http packets and summaries of others: tshark -r -O http Print packet summaries for TCP packets to port 71: tshark -r -Y "tcp.dstport = 71"ĭisplay contents of TCP stream between 10.0.0.1 port 123 and 10.0.0.2 port 456: tshark -r -z "follow,tcp,ascii,10.0.0.1:123,10.0.0.2:456"ĭecrypt WPA traffic ( -o : overrides preference) and print http file data: tshark -r -o wlan.enable_decryption:TRUE -o "uat:80211_keys:\"wpa-pwd\",\"password: -o 'uat:rsa_keys:"./server_private_key.pem",""' -Tfields -e textĭecrypt with pre master secret: tshark -r -o 'tls.keylog_file./premastersecret.txt' -T fields -e Print X.509 certs: tshark -r -T fields -R "" -e x509sat.printableString List User-Agents: tshark -r -T fields -e er_agent Print field-formatted: tshark -r -T fields -e -e. You cannot use them on an existing file or when reading from stdin for this reason.Print TCP conversations: tshark -r -z conv,tcp (add -q to suppress packet info) Tshark -r file.pcap -Y "icmp.resp_not_found" will do the job.Ĭapture filters cannot be this intelligent because their keep/drop decision is based on a single pass.Ĭapture filters operate on raw packet bytes with no capture format bytes getting in the way. ForĮxample, if you want to see all pings that didn’t get a response, Select for expert infos that can be determined with a multipass analysis. By comparison, display filters are more versatile, and can be used to

Wireshark uses two types of filters: Capture Filters and Display Filters. If this intrigues you, capture filter deconstruction awaits. To see how your capture filter is parsed, use dumpcap. For example, to capture pings or tcp traffic on port 80, use icmp or tcp port 80. To specify a capture filter, use tshark -f "$". As libpcap parses this syntax, many networking programs require it.

Capture filters are based on BPF syntax, which tcpdump also uses. Quicklinks: Wireshark Wiki | User Guide | pcap-filter manpageĬapture filters are used to decrease the size of captures by filtering out packets before they are added. 2 min | Ross Jacobs | ApTable of Contents
