๐Nmap - CheatSheet

2 min read
โ Basic Syntax
nmap [options] <target>
Examples of :
IP:
192.168.1.1
Hostname:
example.com
Range:
192.168.1.1-50
Subnet:
192.168.1.0/24
๐ข Host Discovery
Purpose | Command |
Ping sweep (live hosts) | nmap -sn 192.168.1.0/24 |
Disable DNS resolution | nmap -n 192.168.1.1 |
Treat host as online | nmap -Pn 192.168.1.1 |
๐ช Port Scanning
Purpose | Command |
Default port scan | nmap 192.168.1.1 |
Scan all ports | nmap -p- 192.168.1.1 |
Scan specific ports | nmap -p 22,80,443 192.168.1.1 |
Top 1000 ports | nmap --top-ports 1000 192.168.1.1 |
๐ Scan Types
Type | Command |
TCP Connect | nmap -sT 192.168.1.1 |
SYN (Stealth) | nmap -sS 192.168.1.1 |
UDP | nmap -sU 192.168.1.1 |
TCP + UDP Combo | nmap -sS -sU 192.168.1.1 |
๐ Detection Features
Purpose | Command |
Service version detection | nmap -sV 192.168.1.1 |
Operating system detection | nmap -O 192.168.1.1 |
Aggressive (all-in-one) scan | nmap -A 192.168.1.1 |
๐ง NSE (Nmap Scripting Engine)
Task | Command |
Default scripts | nmap -sC 192.168.1.1 |
Vulnerability scan | nmap --script vuln 192.168.1.1 |
Specific script | nmap --script http-title 192.168.1.1 |
Multiple scripts (pattern) | nmap --script "http*,ftp*" 192.168.1.1 |
๐๏ธ Output Formats
Format | Command |
Normal | nmap -oN output.txt 192.168.1.1 |
XML | nmap -oX output.xml 192.168.1.1 |
Grepable | nmap -oG output.gnmap 192.168.1.1 |
All formats | nmap -oA fullscan 192.168.1.1 |
โก Performance & Timing
Task | Command |
Set timing (0 to 5) | nmap -T4 192.168.1.1 |
Fast scan (top 100 ports) | nmap -F 192.168.1.1 |
Set minimum packet rate | nmap --min-rate 100 |
๐ซ Firewall Evasion
Task | Command |
Spoof MAC address | nmap --spoof-mac Apple 192.168.1.1 |
Packet fragmentation | nmap -f 192.168.1.1 |
Decoy scan | nmap -D RND:10 192.168.1.1 |
๐ฏ Target List & Exclusion
Task | Command |
Scan targets from file | nmap -iL targets.txt |
Exclude specific IP | nmap 192.168.1.0/24 --exclude 192.168.1.1 |
1
Subscribe to my newsletter
Read articles from Alpesh R Prajapati directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
