Blog

MCQs

Disclaimer:

Educational Use Only:

The website links provided are to be used strictly for educational and knowledge-gaining purposes only.

No Misuse:

Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.

Respect for Websites and Businesses:

Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.

Acknowledge Value of Knowledge:

Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.

No Endorsement:

The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.

User Responsibility:

By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.


  1. Which command captures all packets on the default network interface?
    a. tcpdump
    b. tcpdump -i
    c. tcpdump -D
    d. tcpdump -r
    Answer: a. tcpdumpsanfoundry+2
  2. Which option allows tcpdump to display all available interfaces?
    a. -W
    b. -D
    c. -X
    d. -A
    Answer: b. -Dgeeksforgeeks+2
  3. To capture packets only from an interface named eth0, which command is used?
    a. tcpdump -i eth0
    b. tcpdump -c eth0
    c. tcpdump -A eth0
    d. tcpdump eth0
    Answer: a. tcpdump -i eth0ionos+2
  4. Which option tells tcpdump to save captured packets to a file?
    a. -A
    b. -r
    c. -w
    d. -n
    Answer: c. -wbaeldung+2
  5. What is the effect of tcpdump -A?
    a. Save output to ASCII file
    b. Display packets in ASCII format
    c. Display all interfaces
    d. Capture only ARP packets
    Answer: b. Display packets in ASCII formathackertarget+2
  6. How can you capture only a certain number of packets with tcpdump?
    a. -n
    b. -X
    c. -c
    d. -F
    Answer: c. -csanfoundry+2
  7. Which option makes tcpdump print packet contents in hex and ASCII?
    a. -X
    b. -A
    c. -n
    d. -w
    Answer: a. -Xgeeksforgeeks+1
  8. To read packets from a previously saved file, what option is used?
    a. -i
    b. -c
    c. -r
    d. -n
    Answer: c. -ribm+2
  9. Which filter would capture all traffic to or from the IP 192.168.1.5?
    a. port 443
    b. src 192.168.1.5
    c. host 192.168.1.5
    d. net 192.168.1.5
    Answer: c. host 192.168.1.5ionos+1
  10. What does the tcpdump -n option do?
    a. Shows numeric addresses, not hostnames
    b. Reads packets from a file
    c. Captures packets in ASCII
    d. Prints data in hex
    Answer: a. Shows numeric addresses, not hostnamessanfoundry+1
  11. Which protocol will be captured by the command tcpdump -i eth0 udp?
    a. TCP
    b. UDP
    c. ICMP
    d. All protocols
    Answer: b. UDPgeeksforgeeks+2
  12. To display TCP sequence numbers as absolute values, which option is used?
    a. -A
    b. -S
    c. -n
    d. -X
    Answer: b. -Ssanfoundry
  13. The command tcpdump -xx does what?
    a. Captures packets with x-forward
    b. Shows packets in hex and ASCII
    c. Captures TCP-only packets
    d. Captures compressed packets
    Answer: b. Shows packets in hex and ASCIIgeeksforgeeks+1
  14. What option is used for quiet output with minimal protocol info?
    a. -n
    b. -q
    c. -X
    d. -S
    Answer: b. -qsanfoundry
  15. Which command will capture packets from a range of ports?
    a. portrange 20-80
    b. tcpdump port 20-80
    c. tcpdump portrange 20-80
    d. tcpdump port=20-80
    Answer: c. tcpdump portrange 20-80ionos
  16. How do you limit the number of bytes captured in each packet?
    a. -w
    b. -r
    c. -s
    d. -X
    Answer: c. -sionos+1
  17. What does this command do: tcpdump -w packets.pcap -i eth0?
    a. Reads packets from packets.pcap
    b. Captures packets from eth0 into a file
    c. Displays ASCII values for packets
    d. Filters only UDP packets
    Answer: b. Captures packets from eth0 into a filebaeldung+2
  18. To capture all IPv6 traffic, which filter is correct?
    a. ip6
    b. ipv4
    c. tcp
    d. udp
    Answer: a. ip6hackertarget+1
  19. What option drops root privileges to a specific user after startup?
    a. -D
    b. -U
    c. -F
    d. -A
    Answer: b. -Usanfoundry
  20. Which of the following captures only ICMP packets?
    a. tcpdump icmp
    b. tcpdump udp
    c. tcpdump tcp
    d. tcpdump ip6
    Answer: a. tcpdump icmpknowledgehut+2
  21. What is the standard file format for tcpdump output files?
    a. txt
    b. log
    c. pcap
    d. cap
    Answer: c. pcapknowledgehut+2
  22. Which tcpdump command filters only packets with destination port 443?
    a. tcpdump port 443
    b. tcpdump dst port 443
    c. tcpdump host 443
    d. tcpdump src port 443
    Answer: b. tcpdump dst port 443ionos
  23. What option reads filter expressions from a file?
    a. -A
    b. -F
    c. -f
    d. -r
    Answer: b. -Fsanfoundry
  24. How can you specify a snaplength with tcpdump?
    a. -N
    b. -s
    c. -p
    d. -X
    Answer: b. -sionos+1
  25. Which of the following would capture only ARP packets?
    a. tcp
    b. ip
    c. arp
    d. udp
    Answer: c. arpionos
  26. What is the default data link type for tcpdump on Ethernet?
    a. IEEE802
    b. EN10MB
    c. TokenRing
    d. Wi-Fi
    Answer: b. EN10MBsanfoundry
  27. To filter packets based on source network, which filter is correct?
    a. src net 10.0.0.0/8
    b. net src 10.0.0.0/8
    c. source net 10.0.0.0/8
    d. src 10.0.0.0/8
    Answer: a. src net 10.0.0.0/8ibm+1
  28. Which filter captures only packets going to IP 10.0.0.7?
    a. src host 10.0.0.7
    b. dst host 10.0.0.7
    c. host 10.0.0.7
    d. tcp port 80
    Answer: b. dst host 10.0.0.7ibm+1
  29. How do you display packet data without timestamps?
    a. -x
    b. -n
    c. -t
    d. -A
    Answer: c. -tsanfoundry
  30. Which protocol keyword captures all DNS traffic?
    a. dns
    b. udp
    c. port 53
    d. port 80
    Answer: c. port 53hackertarget+1
  31. What does tcpdump -c 10 -i eth0 do?
    a. Captures 10 packets from eth0
    b. Captures 10 minutes from eth0
    c. Captures 10 bytes from eth0
    d. Displays 10 available interfaces
    Answer: a. Captures 10 packets from eth0geeksforgeeks+2
  32. Which output type from tcpdump can be opened in Wireshark?
    a. .txt
    b. .pcap
    c. .csv
    d. .log
    Answer: b. .pcapknowledgehut+2
  33. How can tcpdump be set to capture only packets sent or received by a host named server1?
    a. tcpdump host server1
    b. tcpdump src server1
    c. tcpdump dst server1
    d. tcpdump net server1
    Answer: a. tcpdump host server1ibm+1
  34. The option -l in tcpdump does what?
    a. Disables hostname lookup
    b. Buffers output line by line
    c. Lists all interfaces
    d. Reads from a file
    Answer: b. Buffers output line by linesanfoundry
  35. How do you filter traffic between two specific hosts with tcpdump?
    a. host a and host b
    b. tcpdump host a and host b
    c. tcpdump src a dst b
    d. host a or host b
    Answer: d. host a or host bibm+1
  36. Which would capture all traffic not using TCP?
    a. not tcp
    b. !tcp
    c. not port 80
    d. not udp
    Answer: a. not tcpionos
  37. The filter ‘tcp port 23’ will capture
    a. Telnet traffic
    b. HTTP traffic
    c. HTTPS traffic
    d. FTP traffic
    Answer: a. Telnet traffichackertarget+1
  38. To display the difference in time between packets, which option is used?
    a. -t
    b. -tt
    c. -ttt
    d. -l
    Answer: c. -tttsanfoundry
  39. A command that captures all incoming and outgoing traffic on any interface is
    a. tcpdump -i any
    b. tcpdump -D
    c. tcpdump -A
    d. tcpdump -X
    Answer: a. tcpdump -i anygeeksforgeeks+1
  40. The filter ‘tcpdump tcp == 2’ isolates packets withredhat
    a. RST flag
    b. SYN flag
    c. FIN flag
    d. ACK flag
    Answer: b. SYN flagknowledgehut+1
  41. What would ‘tcpdump src net 192.168.0.0/16’ capture?
    a. Packets from network 192.168.0.0/16
    b. Packets to network 192.168.0.0/16
    c. All packets
    d. Only TCP packets
    Answer: a. Packets from network 192.168.0.0/16ibm+1
  42. For verbose output with additional protocol information, which flag is used?
    a. -v
    b. -q
    c. -X
    d. -n
    Answer: a. -vsanfoundry
  43. The filter ‘tcpdump ether host aa:bb:cc:dd:ee:ff’ captures
    a. All IP addresses
    b. Only this Ethernet MAC address
    c. Only TCP traffic
    d. Only UDP traffic
    Answer: b. Only this Ethernet MAC addressionos+1
  44. How can large pcap files be split by tcpdump?
    a. -C
    b. -r
    c. -W
    d. -x
    Answer: a. -Csanfoundry
  45. For capturing traffic between local and remote networks, use
    a. net local and net remote
    b. src and dst net
    c. net x and net y
    d. port 80
    Answer: c. net x and net yionos
  46. The default snaplen for tcpdump is
    a. 64 bytes
    b. 68 bytes
    c. 128 bytes
    d. 512 bytes
    Answer: b. 68 bytessanfoundry
  47. How to capture both inbound and outbound packets on tcp port 8080?
    a. tcpdump port 8080
    b. tcpdump tcp 8080
    c. tcpdump src port 8080
    d. tcpdump dst port 8080
    Answer: a. tcpdump port 8080ionos+1
  48. Which command would show HTTP GET and POST requests?
    a. tcpdump -i eth0 tcp port 80
    b. tcpdump port 21
    c. tcpdump tcp port 443
    d. tcpdump -n
    Answer: a. tcpdump -i eth0 tcp port 80hackertarget+1
  49. To filter by packet size, which option and test could you use?
    a. -s snaplen
    b. len > 1000
    c. -c count
    d. host len
    Answer: b. len > 1000ionos+1
  50. What would ‘tcpdump -i eth0 udp port 53’ capture?
    a. HTTP traffic
    b. DNS queries
    c. FTP data
    d. SMTP
    Answer: b. DNS queriesknowledgehut+2

 

  1. https://www.sanfoundry.com/10-tcpdump-command-usage-examples-linux/
  2. https://www.geeksforgeeks.org/linux-unix/tcpdump-command-in-linux-with-examples/
  3. https://www.redhat.com/en/blog/introduction-using-tcpdump-linux-command-line
  4. https://www.ionos.com/digitalguide/server/configuration/linux-tcpdump-command/
  5. https://www.baeldung.com/linux/tcpdump-command-tutorial
  6. https://hackertarget.com/tcpdump-examples/
  7. https://www.ibm.com/docs/ssw_aix_72/t_commands/tcpdump.html
  8. https://www.knowledgehut.com/blog/security/tcpdump
  9. https://www.sanfoundry.com/computer-network-questions-answers/
  10. https://testbook.com/objective-questions/mcq-on-tcp–5eea6a0939140f30f369d8fc
  11. https://www.interviewbit.com/computer-network-mcq/
  12. https://www.scribd.com/document/655164999/Network-Lab-MCQ
  13. https://www.uninets.com/blog/computer-networks-mcq
  14. https://www.gdcramban.in/MCQ/networkmcq.pdf
  15. https://www.placementpreparation.io/mcq/computer-network/
  16. https://stackoverflow.com/questions/tagged/tcpdump
  17. https://upskilld.com/learn/using-tcpdump-options-filters-and-examples/
  18. https://reck.ac.in/wp-content/uploads/2023/04/DCN_MCQ-Ashwini-.pdf
  19. https://opensource.com/article/18/10/introduction-tcpdump
  20. https://www.youtube.com/watch?v=5cVQcmjxrno

Leave a Reply

Your email address will not be published. Required fields are marked *