Prepare for the CompTIA PenTest+ Exam. Enhance your skills with practice questions and detailed explanations. Ace your test and advance your cybersecurity career!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which command-line tool would you use to scan network ports and services?

  1. Snort

  2. Nmap

  3. Wireshark

  4. Tcpdump

The correct answer is: Nmap

The command-line tool used to scan network ports and services is Nmap. Nmap, short for Network Mapper, is a powerful open-source tool designed specifically for network discovery and security auditing. It can quickly identify hosts and services on a network, as well as determine the state of various ports. With Nmap, users can conduct tasks ranging from simple to complex network scans, providing invaluable insight for penetration testing and network management. Each of the other tools serves different purposes. Snort is primarily an intrusion detection and prevention system, focusing on monitoring traffic for suspicious activity, rather than scanning ports. Wireshark is a network protocol analyzer that captures and analyzes packet data in real-time, which is useful for troubleshooting and understanding network traffic but not specifically for port scanning. Tcpdump is a command-line packet analyzer that allows users to capture and display packet information but does not provide the comprehensive scanning capabilities of Nmap. Therefore, Nmap stands out as the most suitable tool for conducting network port and service scans.