Let's think about this for a moment
Nmap (Network Mapper) is a tool that scans an IP range or a single host to find open ports and running services — it's the most commonly used tool during the Active Recon stage (previous lesson) of a pentest/security assessment. A scan result shows three port statuses — Open (a service is running there), Closed (the port is reachable but no service is listening), and Filtered (a firewall is blocking it, so Nmap itself can't determine the real status).
Let's connect it to a real scenario
Run `nmap 192.168.56.101` (the VM's internal IP) against your lab VM (Metasploitable, Basic lesson 4) and you'll likely find ports 21 (FTP), 22 (SSH), 80 (HTTP), and 3306 (MySQL) open, among others — Metasploitable deliberately leaves plenty of vulnerable services running. Keep reminding yourself (Basic lesson 2) that scanning a real system without authorization is a legal offense.
Let's look at an example together
# Basic scan of a single host (your own lab VM)
nmap 192.168.56.101
# Scan a range of your lab network
nmap 192.168.56.0/24
# See what Nmap version you have
nmap --versionPORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
80/tcp open http
3306/tcp open mysqlTry it in 5 minutes
Run `nmap <lab-vm-ip>` against your lab VM (set up in Basic lesson 4) — look at the port list in the output and jot down notes on which services are running.
A quick word of caution
Running an Nmap scan (especially the aggressive scan options) against a production system without authorization can disrupt network traffic (and can even crash a system in some cases) — only practice this against your lab VM.