April 18

Software: Other Applications: Wireshark Capture Filter Examples

Capture only traffic to or from IP address 192.168.1.2:

host 192.168.1.2

Capture traffic to or from a range of IP addresses:

net 192.168.1.0/24

or

net 192.168.1.0 mask 255.255.255.0

Capture traffic from a range of IP addresses:

src net 192.168.1.0/24

or

src net 192.168.1.0 mask 255.255.255.0

Capture traffic to a range of IP addresses:

dst net 192.168.1.0/24

or

dst net 192.168.1.0 mask 255.255.255.0

Capture only DNS (port 53) traffic:

port 53

Capture non-HTTP and non-SMTP traffic on your server (both are equivalent):

host www.example.com and not (port 80 or port 25)

host www.example.com and not port 80 and not port 25

Capture except all ARP and DNS traffic:

port not 53 and not arp

Capture traffic within a range of ports

(tcp[0:2] > 1500 and tcp[0:2] < 1550) or (tcp[2:2] > 1500 and tcp[2:2] < 1550)

or, with newer versions of libpcap (0.9.1 and later):

tcp portrange 1501-1549

Capture only Ethernet type EAPOL:

ether proto 0x888e

Reject ethernet frames towards the Link Layer Discovery Protocol Multicast group:

not ether dst 01:80:c2:00:00:0e

Capture only IP traffic – the shortest filter, but sometimes very useful to get rid of lower layer protocols like ARP and STP:

Ip

Capture only unicast traffic – useful to get rid of noise on the network if you only want to see traffic to and from your machine, not, for example, broadcast and multicast announcements:

not broadcast and not multicast

Capture SIP Traffic

port 5060

Capture Mitel Voice Traffic

For this to work you need to turn off Voice Encryption in System Options Assignment

udp portrange 50000-50511

By: cmac


Copyright 2021. All rights reserved.

Posted April 18, 2012 by Timothy Conrad in category "Software

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B