CompTIACompTIA
XK0-005 · Question #1232
XK0-005 Question #1232: Real Exam Question with Answer & Explanation
The correct answer is D: tcpdump -i eth0 port 80 -w test.pcap. To capture only HTTP protocol data and save it to a pcap file, tcpdump with a port filter and write option is the correct command.
System Management
Question
A junior systems administrator needs to make a packet capture file that will only capture HTTP protocol data to a file called test.pcap. Which of the following commands would allow the administrator to accomplish this task?
Options
- Anetcat -p 80 -w test.pcap
- Btshark -r test.pcap -o http
- Ctcpdump -i eth0 port 80 -r test.pcap
- Dtcpdump -i eth0 port 80 -w test.pcap
Explanation
To capture only HTTP protocol data and save it to a pcap file, tcpdump with a port filter and write option is the correct command.
Common mistakes.
- A.
netcatis a networking utility for reading/writing data across connections, not for capturing raw packets to a pcap file. - B.
tshark -r test.pcap -o httpis used to read and analyze an existing pcap file, not to capture live traffic, and-osets preferences, not a capture filter. - C.
tcpdump -i eth0 port 80 -r test.pcapuses-rto read from a pcap file, not to capture live traffic and write to one.
Concept tested. Packet capture with tcpdump
Topics
#Packet Capture#tcpdump#Network Monitoring#Command-line Tools
Community Discussion
No community discussion yet for this question.