How do you capture traffic with tcpdump?
IntermediateConceptCommand-Line Tools & Diagnostics
Answer
sudo tcpdump -i any -nn port 443 and host 10.0.1.5
sudo tcpdump -i eth0 -nn -s0 -w capture.pcap 'tcp port 8080'
sudo tcpdump -i eth0 -nn 'tcp[tcpflags] & (tcp-syn|tcp-rst) != 0'
sudo tcpdump -nn -A -i lo port 8080 # print ASCII payload
Use -nn to skip name lookups, always filter, and rotate big captures with -C 100 -W 10. Open the pcap in Wireshark for deeper analysis.
More on Command-Line Tools & Diagnostics
How do you check if a remote port is open?BeginnerHow do you list listening ports and the processes that own them?BeginnerWhat does `ping` tell you and what does it not?BeginnerHow does traceroute work and how do you read the output?BeginnerWhat is mtr and why is it better than traceroute?IntermediateHow do you query DNS with dig and read the answer?Beginner