Nmap is the primary tool used forport scanning, making option B the correct answer. Port scanning is a core activity during the reconnaissance and scanning phases of penetration testing, where the goal is to identify open, closed, or filtered ports on target systems.
Nmap allows ethical hackers to discover which services are running, their versions, and potential misconfigurations. It supports multiple scan types, including TCP SYN scans, UDP scans, and service detection scans, making it highly versatile and efficient.
Option A is incorrect because Metasploit is primarily an exploitation framework, not a dedicated port scanner. Option C is incorrect because Shodan is an internet-wide search engine, not a direct scanning tool used against specific targets.
Understanding port scanning is essential for identifying attack surfaces. Open ports often expose services that may contain vulnerabilities or misconfigurations. Ethical hackers use Nmap responsibly to map networks and guide further testing.
From a defensive perspective, regular port scanning helps organizations identify unnecessary services and enforce least-exposure principles. Nmap remains one of the most fundamental tools in ethical hacking and network security.