Capture SYN and FIN flags tcpdump
Show only connection open/close packets to trace short-lived churning sessions
tcpdump -nn 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0'
more tcpdump
all 18 commands →
Host filter excluding SSH noise
tcpdump -nn -i any host <ip> and not port 22
Full payload hex+ascii dump
tcpdump -nn -s 0 -X -i any port <port>
Ring buffer capture by size
tcpdump -nn -i any -s 0 -C 100 -W 5 -w /tmp/cap.pcap
Time-rotated capture files
tcpdump -nn -i any -G 3600 -w '/tmp/cap-%Y%m%d-%H%M%S.pcap'
Filter an existing pcap offline
tcpdump -nn -r /tmp/cap.pcap 'port 443 and host <ip>'