Nmap is the most widely used tool for network discovery and security auditing. From simple port scans to complex vulnerability assessments.
Basic scans¶
Quick scan¶
nmap target.com
All ports + service detection¶
nmap -sV -p- target.com
OS detection + scripts¶
nmap -sV -sC -O target.com
UDP scan¶
nmap -sU –top-ports 100 target.com
Stealth scan (SYN)¶
nmap -sS -T4 target.com
NSE scripts¶
Vulnerability scanning¶
nmap –script vuln target.com
SSL audit¶
nmap –script ssl-enum-ciphers -p 443 target.com
HTTP enumeration¶
nmap –script http-enum -p 80,443 target.com
Brute force¶
nmap –script ssh-brute -p 22 target.com
Output formats¶
nmap -oA scan_results target.com # All formats nmap -oX scan.xml target.com # XML for parsing nmap -oG scan.grep target.com # Grepable
Key Takeaway¶
nmap -sV -sC -O for a complete audit. NSE scripts for vulnerability scanning. Always with the owner’s permission.