Discover hosts, open ports, running services, and operating systems using Nmap. Learn service enumeration techniques including SMB, SNMP, banner grabbing, and Metasploit auxiliary modules for comprehensive network reconnaissance.
Network Mapper (Nmap) is a powerful open-source tool for network discovery and security auditing. It sends packets to target hosts and analyzes responses to map network topology and identify services.
Nmap helps penetration testers identify live hosts, discover open ports, detect running services, determine OS versions, and find potential vulnerabilities in target networks during reconnaissance phase.
Host Discovery
Identify which hosts are online using ping scans, ARP requests, and protocol-specific probes
Port Scanning
Discover open, closed, and filtered ports using various scan techniques (TCP, UDP, SYN, etc.)
Service Detection
Detect running services, application versions, and sometimes even specific software builds
OS Detection
Fingerprint operating systems using TCP/IP stack implementation differences
nmap [Scan Type] [Options] [Target Specification]
Example:
nmap -sS -p 1-1000 192.168.1.1Meaning:
SYN scan ports 1-1000 on target
Practice Nmap scanning techniques on the intentionally vulnerable Metasploitable2 virtual machine. This lab environment is designed for learning penetration testing tools safely.
# 1. Find Metasploitable2 IP nmap -sn 192.168.1.0/24
# 2. Full port scan nmap -p- [TARGET_IP]
# 3. Service detection nmap -sV [TARGET_IP]
# 4. OS detection nmap -O [TARGET_IP]
# 5. Vulnerability scan nmap --script vuln [TARGET_IP]
# 6. SMB enumeration enum4linux -a [TARGET_IP]
# 7. SNMP enumeration snmpwalk -c public -v1 [TARGET_IP]
# 8. Banner grabbing nc -nv [TARGET_IP] 22
# 9. Metasploit modules msfconsole -q -x "use auxiliary/scanner/smb/smb_version; set RHOSTS [TARGET_IP]; run; exit"
# 10. Save all results nmap -oA metasploitable_scan -sV -O [TARGET_IP]
Multiple Web Services
Apache, Tomcat, and other web servers on different ports
Database Services
MySQL, PostgreSQL, and other databases exposed
Vulnerable Services
Backdoors, weak configurations, and known vulnerabilities
OS Detection
Linux-based system with specific kernel version
SMB Shares
Anonymous access to shares like /tmp and /www
SNMP Access
Public community string with system information
Document your enumeration results in this format:
+--------+-----------+------------------+------------------+ | Port | Service | Version | Potential Risk | +--------+-----------+------------------+------------------+ | 21 | ftp | vsFTPd 3.0.3 | Anonymous access | | 22 | ssh | OpenSSH 7.6p1 | Weak crypto | | 23 | telnet | Linux telnet | Clear text | | 80 | http | Apache 2.4.29 | Web vulns | | 445 | smb | Samba 3.0.20 | Share access | | 161 | snmp | NET-SNMP | Info disclosure | +--------+-----------+------------------+------------------+