Nmap Cheat Sheet & Commands (Beginners Guide)
๐ฅ๏ธ What is Nmap?
Nmap (Network Mapper) is an open-source network scanning tool used by ethical hackers to:
- ๐ Discover live hosts
- ๐ก Detect open ports & services
- ๐ฅ๏ธ Identify operating systems
- ๐งช Test network defenses
๐ Why Nmap Matters in Ethical Hacking
- โ Maps entire networks quickly
- โ Reveals potential entry points
- โ Essential in CEH v13 exam prep
- โ Used in real-world pentesting labs (TryHackMe, HackTheBox)
๐ Top 10 Nmap Commands for Beginners
| โก Command | ๐ Purpose | ๐ ๏ธ Example |
|---|---|---|
nmap -sn 192.168.1.0/24 | Ping sweep โ find active hosts | Scan WiFi devices |
nmap -sS target.com | SYN scan โ stealthy check | Evade detection |
nmap -sT target.com | TCP connect โ non-root use | Beginner-friendly |
nmap -sV target.com | Version detection | Spot software version |
nmap -O target.com | OS detection | Learn target system |
nmap -A target.com | Aggressive scan | Deep fingerprinting |
nmap -p1-1000 target.com | Ports 1-1000 | Fast audit |
nmap -p- target.com | All ports (1-65535) | Complete sweep |
nmap -Pn target.com | Treat host as โupโ | Bypass firewall block |
nmap -sU target.com | UDP scan | Find DNS, SNMP, DHCP |
๐งญ Scan Types Made Simple
- ๐ฆ Ping Sweep (
-sn) โ Find live hosts - ๐ต๏ธ SYN Scan (
-sS) โ Stealthy & fast - ๐ TCP Connect (
-sT) โ For non-root users - ๐ UDP Scan (
-sU) โ Detect hidden UDP services - ๐ฅ๏ธ OS Detection (
-O) โ Profile the system - ๐งฉ Aggressive Mode (
-A) โ Collect everything
๐ Quick Nmap Cheat Sheet
| ๐ท๏ธ Flag | ๐ฏ Category | ๐ Function |
|---|---|---|
-sn | Host Discovery | List active devices |
-sS / -sT | Scan Types | SYN stealth / TCP connect |
-sU | Scan Type | UDP scan |
-O | OS Detection | Guess system type |
-sV | Version | Detect software version |
-p / -p- | Ports | Specify ranges or all |
-Pn | Discovery | Skip ping, assume host up |
-A | Aggressive | Deep scan + traceroute |
-T<0-5> | Timing | Speed vs stealth |
โ๏ธ Safe & Legal Use of Nmap
- ๐ Always get permission before scanning
- ๐ก๏ธ Use test labs (TryHackMe, HackTheBox)
- โฑ๏ธ Avoid disruptive scans in production
- ๐ Document findings for reports
๐ฏ CEH v13 Strategy Checklist
๐ Knowledge Exam
- Know scan types: SYN = stealth, TCP connect = simple, UDP = hidden services
- Map switch to purpose:
-O= OS detection,-sV= version detection,-A= aggressive - Red flag terms: โfilteredโ vs โclosedโ vs โopenโ โ know the difference
๐ ๏ธ Practical Exam
- Start with host discovery:
nmap -sn 192.168.1.0/24 - Move to stealth:
nmap -sS -p- target - Add details:
nmap -sV -O target - Export results:
nmap -oN results.txt target
โ Key Takeaways
- ๐ Nmap is the #1 recon tool for ethical hackers
- ๐งฉ Learn 10 core commands before diving deeper
- ๐ก๏ธ Practice in labs to avoid legal risks
- ๐ Nmap mastery is critical for CEH v13 success
๐ Final Note
Mastering Nmap builds the foundation for all ethical hacking skills. Start with the basics, practice safely, and build muscle memory with real-world labs.

