Show packet content in detail

Very verbose output with the ASCII content of PostgreSQL packets

tcpdump -i eth0 -vvv -A -s 0 port 5432

tool
tcpdump18 commands
tags
tcpdumpnetworklinuxdebug

More tcpdump commands

  • tcpdump -i eth0 -c 100 -w capture.pcap

    Stop after 100 packets and save them to capture.pcap

  • tcpdump -nn 'tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn'

    Catch only SYNs that open a connection (no SYN-ACK) to spot scans or SYN floods

  • tcpdump -nn 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0'

    Show only packets that open or close connections to track short-lived sessions

  • tcpdump -nn -i any host <ip> and not port 22

    Watch traffic to and from a host but hide your own SSH session

  • tcpdump -nn -s 0 -X -i any port <port>

    Show full packet bodies in hex and ASCII, -s 0 makes sure nothing is cut off

all 18 tcpdump commands