Security Operations
An analyst must capture only traffic to or from 203.0.113.50 on port 443 and save it to a file for later review. Which command does this?
Show the answer
Correct answerA. tcpdump -i eth0 -w cap.pcap host 203.0.113.50 and port 443
AWhy this is right: The -w flag writes to a file, and host and port together restrict capture to that host's port 443 traffic in both directions.
BWhy not this: The src qualifier captures only packets sent by the host, missing traffic sent to it.
CWhy not this: The -r flag reads an existing capture file; it does not write a new capture from the interface.
DWhy not this: The or operator matches all traffic of that host and all port 443 traffic, which is far broader than required.
The -w flag writes packets to a file, and the filter host AND port limits capture to that host's port 443 traffic in both directions. Using or would also capture every host's port 443 traffic.