Wirechark has some comprehensive packet filtering capabilities, and display filters let you utilize these multi-pass packet processing capabilities. This goes far beyond just filtering based on IP, port and protocol.
Essential Links:
- Getting Started Guide: https://www.maketecheasier.com/use-display-filters-in-wireshark/
- Basic Filter Syntax: https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html
- Full Display Filter Docs: https://www.wireshark.org/docs/dfref/
- Full Protocol References: https://wiki.wireshark.org/ProtocolReference
You can debug filters using the dftest command
Cheat Sheet
I created this list from the Wiki, to be a Ctrl + F personal reference to common display filters
Operators
eqor==neor!=gtor>ltor<geor>=leor<=
Logic
andor&&- Logical ANDoror||- Logical ORxoror^^- Logical XORnotor!- Logical NOT[n] [β¦]- Sub-String Operator
Ethernet
eth.addreth.dsteth.igeth.leneth.lgeth.multicasteth.srceth.trailereth.type
IEEE 802.1Q
vlan.cfivlan.etypevlan.idvlan.lenvlan.priority- `vlan.trailer
IPv4
ip.addrip.checksum_badip.checksum_goodip.checksumip.dsfield.ceip.dsfield.dscpip.dsfield.ectip.dsfieldip.dst_hostip.dstip.flags.dfip.flags.mfip.flags.rbip.flagsip.frag_offsetip.fragment.errorip.fragment.multipletailsip.fragment.overlap.conflictip.fragment.overlapip.fragment.toolongfragmentip.fragmentip.fragmentsip.hdr_lenip.hostip.idip.lenip.protoip.reassembled_inip.src_hostip.srcip.tos.costip.tos.delayip.tos.precedenceip.tos.reliabilityip.tos.throughputip.tosip.ttlip.version
IPv6
ipv6.addripv6.classipv6.dst_hostipv6.dst_optipv6.dstipv6.flowipv6.fragment.erroripv6.fragment.idipv6.fragment.moreipv6.fragment.multipletailsipv6.fragment.offsetipv6.fragment.overlap.conflictipv6.fragment.overlapipv6.fragment.toolongfragmentipv6.fragmentipv6.fragmentsipv6.hlimipv6.hop_optipv6.hostipv6.mipv6_home_addressipv6.mipv6_lengthipv6.mipv6_typeipv6.nxtipv6.opt.pad1ipv6.opt.padnipv6.plenipv6.reassembled_inipv6.routing_hdr.addripv6.routing_hdr.leftipv6.routing_hdr.typeipv6.routing_hdripv6.src_hostipv6.srcipv6.version
ARP
arp.dst.hw_macarp.dst.proto_ipv4arp.hw.sizearp.hw.typearp.opcodearp.proto.sizearp.proto.typearp.src.hw_macarp.src.proto_ipv4
TCP
tcp.acktcp.checksum_badtcp.checksum_goodtcp.checksumtcp.continuation_totcp.dstporttcp.flags.acktcp.flags.cwrtcp.flags.ecntcp.flags.fintcp.flags.pushtcp.flags.resettcp.flags.syntcp.flags.urgtcp.flagstcp.hdr_lentcp.lentcp.nxtseqtcp.options.cctcp.options.ccechotcp.options.ccnewtcp.options.echo_replytcp.options.echotcp.options.md5tcp.options.mss_valtcp.options.msstcp.options.qstcp.options.sack_letcp.options.sack_permtcp.options.sack_retcp.options.sacktcp.options.time_stamptcp.options.wscale_valtcp.options.wscaletcp.optionstcp.pdu.last_frametcp.pdu.sizetcp.pdu.timetcp.porttcp.reassembled_intcp.segment.errortcp.segment.multipletailstcp.segment.overlap.conflicttcp.segment.overlaptcp.segment.toolongfragmenttcp.segmenttcp.segmentstcp.seqtcp.srcporttcp.time_deltatcp.time_relativetcp.urgent_pointertcp.window_size
UDP
udp.checksum_badudp.checksum_goodudp.checksumudp.dstportudp.lengthudp.portudp.srcport
Frame Relay
fr.becnfr.chdlctypefr.control.ffr.control.ftypefr.control.n_rfr.control.n_sfr.control.pfr.control.s_ftypefr.control.u_modifier_cmdfr.control.u_modifier_respfr.controlfr.crfr.dcfr.defr.dlcifr.dlcore_controlfr.eafr.fecnfr.lower_dlcifr.nlpidfr.second_dlcifr.snap.ouifr.snap.pidfr.snaptypefr.third_dlcifr.upper_dlci
ICMPv6
icmpv6.all_compicmpv6.checksum_badicmpv6.checksumicmpv6.codeicmpv6.compicmpv6.haad.ha_addrsicmpv6.identifiericmpv6.option.cgaicmpv6.option.lengthicmpv6.option.name_type.fqdnicmpv6.option.name_typeicmpv6.option.name_x501icmpv6.option.rsa.key_hashicmpv6.option.typeicmpv6.optionicmpv6.ra.cur_hop_limiticmpv6.ra.reachable_timeicmpv6.ra.retrans_timericmpv6.ra.router_lifetimeicmpv6.recursive_dns_servicmpv6.type
PPP
ppp.addressppp.controlppp.directionppp.protocol
RIP
rip.auth.passwdrip.auth.typerip.commandrip.familyrip.iprip.metricrip.netmaskrip.next_hoprip.route_tagrip.routing_domainrip.version
MPLS
mpls.bottommpls.cw.controlmpls.cw.resmpls.expmpls.labelmpls.oam.bip16mpls.oam.defect_locationmpls.oam.defect_typempls.oam.frequencympls.oam.function_typempls.oam.ttsimpls.ttl
BGP
bgp.aggregator_asbgp.aggregator_originbgp.as_pathbgp.cluster_identifierbgp.cluster_listbgp.community_asbgp.community_valuebgp.local_prefbgp.mp_nlri_tnl_idbgp.mp_reach_nlri_ipv4_prefixbgp.mp_unreach_nlri_ipv4_prefixbgp.multi_exit_discbgp.next_hopbgp.nlri_prefixbgp.originbgp.originator_idbgp.typebgp.withdrawn_prefix
ICMP
icmp.checksum_badicmp.checksumicmp.codeicmp.identicmp.mtuicmp.redir_gwicmp.seqicmp.type
DTP
dtp.neighbordtp.tlv_lendtp.tlv_typedtp.versionvtp.neighbor
VTP
vtp.codevtp.conf_rev_numvtp.followersvtp.md5_digestvtp.md_lenvtp.mdvtp.seq_numvtp.start_valuevtp.upd_idvtp.upd_tsvtp.versionvtp.vlan_info.802_10_indexvtp.vlan_info.isl_vlan_idvtp.vlan_info.lenvtp.vlan_info.mtu_sizevtp.vlan_info.status.vlan_suspvtp.vlan_info.tlv_lenvtp.vlan_info.tlv_typevtp.vlan_info.vlan_name_lenvtp.vlan_info.vlan_namevtp.vlan_info.vlan_type
HTTP
http.accept_encodinghttp.accept_languagehttp.accepthttp.authbasichttp.authorizationhttp.cache_controlhttp.connectionhttp.content_encodinghttp.content_lengthhttp.content_typehttp.cookiehttp.datehttp.hosthttp.last_modifiedhttp.locationhttp.notificationhttp.proxy_authenticatehttp.proxy_authorizationhttp.proxy_connect_hosthttp.proxy_connect_porthttp.refererhttp.request.methodhttp.request.urihttp.request.versionhttp.requesthttp.response.codehttp.responsehttp.serverhttp.set_cookiehttp.transfer_encodinghttp.user_agenthttp.www_authenticatehttp.x_forwarded_for
Example Usage
(Adapted from Chris Greer's Blog Post)
ip.addr == 10.0.0.1- Sets a filter for any packet with 10.0.0.1, as either the source or destip.addr==10.0.0.1 && ip.addr==10.0.0.2- sets a conversation filter between the two defined IP addressestcp.time_delta > .250- sets a filter to display all tcp packets that have a delta time of greater than 250mSec in the context of their streamtcp.port==4000- Sets a filter for any TCP packet with 4000 as a source or dest porttcp.flags == 0x012- Displays all TCP SYN/ACK packets - shows the connections that had a positive response. Related to this is tcp.flags.syn==1ip.addr == 10.0.0.0/24- Shows packets to and from any address in the 10.0.0.0/24 spaceframe contains traffic- Displays all packets that contain the word βtrafficβ. Excellent when searching on a specific string or user ID!(arp or icmp or stp)- Masks out arp, icmp, stp, or whatever other protocols may be background noise. Allowing you to focus on the traffic of interesteth[0x47:2] == 01:80- This is an example of an offset filter. It sets a filter for the HEX values of 0x01 and 0x80 specifically at the offset location of 0x47tcp.analysis.flags && !tcp.analysis.window_update- Displays all retransmissions, duplicate acks, zero windows, and more in the trace. Helps when tracking down slow application performance and packet loss. It will not include the window updates, since these aren't really important for me to see in most cases