This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
tcpdump
¶
tcpdump
is a command line network monitoring and data acquisition tool. It is capable of sniffing
packets and "dumping" information.
Reference(s)
Table of contents¶
Install¶
Config¶
In order for normal users to run tcpdump
the program should be built with the suid
flag
enabled and the user(s) should be added to the tcpdump
group:
Use¶
-
List available interfaces:
-
Listen to a specific interface:
-
Write output to a file:
-
Read input from file:
-
Capture for the next 42 packets only:
-
Print packets in ASCII format:
-
Print packets (header AND DATA) in HEX and ASCII:
-
Print IP address not names
-
Capture only TCP packets:
-
Capture only UDP packets:
-
Capture only from source IP (e.g. 50.116.66.139):
-
Capture only packets to destination IP (e.g. 50.116.66.139):
-
Capture packets from a specific port (e.g. 22):
-
Capture packets from a specific port range (e.g.
5064-5065
): -
Capture packets from a specific host and port (e.g. 10.0.0.0 and 22):
-
Print an optional packet number at the beginning of the line:
-
Print less protocol information so output lines are shorter:
If this cheat sheet has been useful to you, then please consider leaving a star here.