Using tcpdump
The tcpdump
tool is used to collect and analyze network packets. It is ideal for the analysis of individual packages and for their consistency. In the case of automatic processing, tcpdump
has several advantages.
To read a previously recorded pcap
file, you can use the following command:
tcpdump -nnr dump.pcap
The default tcpdump
displays information about each packet, while the output format is protocol-dependent:
TCP: [Timestamp] [Layer 3 Protocol] [Source IP]. [Source Port]> [Destination IP]. [Destination Port]: [TCP Flags], [TCP Sequence Number], [TCP Acknowledgement Number], [TCP Windows Size] , [Data Length] UDP: [Timestamp] [Layer 3 Protocol] [Source IP]. [Source Port]> [Destination IP]. [Destination Port]: [Layer 4 Protocol], [Data Length]
In addition to make the output more informative, -v -vvv
can be used, as in the following example:
tcpdump -nnvvvr dump.pcap
With the -x
option, you can makeĀ tcpdump
output packets in theĀ heh...