Tcpdump Best Practices

List of interfaces on which tcpdump can listen:

[crayon-6ac10496bd3e6352237031/]
Listen on interface eth0:
[crayon-6ac10496bd3ed980612082/]
Listen on any available interface :
[crayon-6ac10496bd3ef397564603/]
Be verbose while capturing packets:
[crayon-6ac10496bd3f0523766272/]
More verbose while capturing packets:
[crayon-6ac10496bd3f2920108218/]
Very verbose while capturing packets:
[crayon-6ac10496bd3f3781493915/]
Verbose and print the data of each packet in both hex and ASCII, excluding the link level header:
[crayon-6ac10496bd3f4802768306/]
Verbose and print the data of each packet in both hex and ASCII, also including the link level header:
[crayon-6ac10496bd3f5743105329/]
Less verbose (than the default) while capturing packets:
[crayon-6ac10496bd3f7617987180/]
Limit the capture to 100 packets:
[crayon-6ac10496bd3f8513510924/]
Record the packet capture to a file called capture.cap:
[crayon-6ac10496bd3f9295987050/]
Record the packet capture to a file called capture.cap but display on-screen how many packets have been captured in real-time:
[crayon-6ac10496bd3fa981334903/]
Display the packets of a file called capture.cap:
[crayon-6ac10496bd3fc261591389/]
Display the packets using maximum detail of a file called capture.cap:
[crayon-6ac10496bd3fd902238760/]
Display IP addresses and port numbers instead of domain and service names when capturing packets
[crayon-6ac10496bd3fe635129896/]
Capture any packets where the destination host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-6ac10496bd3ff732462693/]
Capture any packets where the source host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-6ac10496bd400699018919/]
Capture any packets where the source or destination host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-6ac10496bd402112387150/]
Capture any packets where the destination network is 192.168.5.0/24. Display IP addresses and port numbers:
[crayon-6ac10496bd403073453838/]
Capture any packets where the source network is 192.168.1.0/24. Display IP addresses and port numbers:
[crayon-6ac10496bd404382655366/]
Capture any packets where the source or destination network is 192.168.5.0/24. Display IP addresses and port numbers:
[crayon-6ac10496bd406449764823/]
Capture any packets where the destination port is 23. Display IP addresses and port numbers:
[crayon-6ac10496bd407150326431/]
Capture any packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-6ac10496bd408429426293/]
Capture only TCP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-6ac10496bd409127309592/]
Capture only UDP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-6ac10496bd40b188432391/]
Capture any packets with destination IP 192.168.1.1 and destination port 23. Display IP addresses and port numbers:
[crayon-6ac10496bd40c672224887/]
Capture any packets with destination IP 192.168.5.1 and destination port 80 or 443. Display IP addresses and port numbers:
[crayon-6ac10496bd40d273358990/]
Capture any ICMP packets:
[crayon-6ac10496bd40e206347050/]
Capture any ARP packets:
[crayon-6ac10496bd410959718193/]
Capture either ICMP or ARP packets:
[crayon-6ac10496bd411813802401/]
Capture any packets that are broadcast or multicast:
[crayon-6ac10496bd412213479360/]
Capture 500 bytes of data for each packet rather than the default of 68 bytes:
[crayon-6ac10496bd413204781166/]
Capture all bytes of data within the packet:
[crayon-6ac10496bd415561470066/]