Reconnaissance and Enumeration

Over SSH on a headless Linux host, a tester must capture only TCP port 80 traffic to and from 10.0.0.5 into a file to open later in Wireshark. Which command does this?

Show the answer

Correct answerA. tcpdump -i eth0 -w web.pcap host 10.0.0.5 and tcp port 80

AWhy this is right: Captures live with -w to a pcap file, using valid BPF filter syntax for the host and TCP port 80.

BWhy not this: The -r flag reads an existing file instead of capturing live traffic, so nothing new is recorded.

CWhy not this: ip.addr and tcp.port are Wireshark display-filter syntax and are not valid in a tcpdump capture filter.

DWhy not this: Valid syntax, but it captures UDP port 80 and so misses the required TCP web traffic.

tcpdump writes packets to a file with -w and limits what it captures with a BPF capture filter such as host and tcp port. The Wireshark-style ip.addr and tcp.port expressions are display-filter syntax, which tcpdump's capture filter does not accept.