Tcpdump Best Practices

List of interfaces on which tcpdump can listen:

[crayon-66237d031942e510355985/]
Listen on interface eth0:
[crayon-66237d0319437008848843/]
Listen on any available interface :
[crayon-66237d0319439992609630/]
Be verbose while capturing packets:
[crayon-66237d031943b839641871/]
More verbose while capturing packets:
[crayon-66237d031943d359058396/]
Very verbose while capturing packets:
[crayon-66237d031943f524121377/]
Verbose and print the data of each packet in both hex and ASCII, excluding the link level header:
[crayon-66237d0319441246781182/]
Verbose and print the data of each packet in both hex and ASCII, also including the link level header:
[crayon-66237d0319443402647004/]
Less verbose (than the default) while capturing packets:
[crayon-66237d0319445752310992/]
Limit the capture to 100 packets:
[crayon-66237d0319447962058846/]
Record the packet capture to a file called capture.cap:
[crayon-66237d0319449366874411/]
Record the packet capture to a file called capture.cap but display on-screen how many packets have been captured in real-time:
[crayon-66237d031944b892446321/]
Display the packets of a file called capture.cap:
[crayon-66237d031944d266965598/]
Display the packets using maximum detail of a file called capture.cap:
[crayon-66237d031944f054298333/]
Display IP addresses and port numbers instead of domain and service names when capturing packets
[crayon-66237d0319451852920921/]
Capture any packets where the destination host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-66237d0319453578410308/]
Capture any packets where the source host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-66237d0319455980892125/]
Capture any packets where the source or destination host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-66237d0319459920959074/]
Capture any packets where the destination network is 192.168.5.0/24. Display IP addresses and port numbers:
[crayon-66237d031945b823727927/]
Capture any packets where the source network is 192.168.1.0/24. Display IP addresses and port numbers:
[crayon-66237d031945d196235477/]
Capture any packets where the source or destination network is 192.168.5.0/24. Display IP addresses and port numbers:
[crayon-66237d031945f782252927/]
Capture any packets where the destination port is 23. Display IP addresses and port numbers:
[crayon-66237d0319461798255831/]
Capture any packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-66237d0319463757533723/]
Capture only TCP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-66237d0319465083571499/]
Capture only UDP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-66237d0319467940241025/]
Capture any packets with destination IP 192.168.1.1 and destination port 23. Display IP addresses and port numbers:
[crayon-66237d0319469519766402/]
Capture any packets with destination IP 192.168.5.1 and destination port 80 or 443. Display IP addresses and port numbers:
[crayon-66237d031946b622804211/]
Capture any ICMP packets:
[crayon-66237d031946d359308426/]
Capture any ARP packets:
[crayon-66237d031946f395292594/]
Capture either ICMP or ARP packets:
[crayon-66237d0319471341159707/]
Capture any packets that are broadcast or multicast:
[crayon-66237d0319472338571742/]
Capture 500 bytes of data for each packet rather than the default of 68 bytes:
[crayon-66237d0319474790883322/]
Capture all bytes of data within the packet:
[crayon-66237d0319476313995629/]