From wikistone
Jump to: navigation, search
Line 6: Line 6:
 
* -x : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet.
 
* -x : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet.
 
* -X : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex and ASCII. This is very handy for analysing new protocols.
 
* -X : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex and ASCII. This is very handy for analysing new protocols.
−
* -s : 1500: Snarf snaplen bytes of data from each packet rather than the default of 68. This is useful to see lots of information.
+
* -s : 0: Snarf up to snaplen bytes of data from each packet rather than the default of 68, 0 is no size limit. This is useful to see lots of information.
 
* -i : eth1 : Monitor eth1 interface
 
* -i : eth1 : Monitor eth1 interface
 
* src [net] : source host / network(CIDR)
 
* src [net] : source host / network(CIDR)

Revision as of 13:39, 1 May 2017

Text Dump

Monitor all traffic on port 25:

tcpdump -vv -X -s 1500 -i eth1 port 25

  • -vv : More verbose output
  • -x : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet.
  • -X : When parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex and ASCII. This is very handy for analysing new protocols.
  • -s : 0: Snarf up to snaplen bytes of data from each packet rather than the default of 68, 0 is no size limit. This is useful to see lots of information.
  • -i : eth1 : Monitor eth1 interface
  • src [net] : source host / network(CIDR)
  • dst [net] : destination host / network(CIDR)

File Dump

tcpdump -i [interface] -s 0 -w [file] src net a.b.c.d/24

  • -s : bytes per packet to capture, default is 68 L3 bytes (96 L2), set to 0 to get all bytes in the packet