NOTE

tcpdump

1. Usage 1.1. Get the Network Interface Name tcpdump D ifconfig 1.2. Capture Packets Basic usage Advanced syntax Type keywords: host, port. Specify transmission direction: src, dst. Protocol keywords: tcp, udp. Logical operators: and, or. 1.3. Export

Operating Systems / LinuxCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. Usage

1.1. Get the Network Interface Name

  • tcpdump -D
  • ifconfig

1.2. Capture Packets

  • Basic usage
tcpdump -i network-interface-name
  • Advanced syntax
    • Type keywords: host, port.
    • Specify transmission direction: src, dst.
    • Protocol keywords: tcp, udp.
    • Logical operators: and, or.

1.3. Export

tcpdump -i network-interface-name -v -nn tcp port port-number -w test.cap

1.4. Analyze with Wireshark or tcpdump

tcpdump -r test.cap

2. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub