Nmap Cheatsheet
Nmap (Network Mapper) is an open-source tool used for network discovery and security auditing. It’s a powerful and utility that helps users scan and map networks to find hosts, services, open ports, and more.
This is cheat sheet for nmap commands.
Penetration testing distros like Kali and Parrot os has nmap tool preinstalled. But if you are using any other linux distro, then run the below command according to the distro to install nmap:
For Debian/Ubuntu:
1 |
|
For Fedora:
1 |
|
For Arch Linux:
1 |
|
Note: In all the below command “10.10.0.1” is used as target. Change it according to your target.
Basic Commands:
Check version information:
1 |
|
Check nmap help menu:
1 |
|
Update script database:
1 |
|
List targets only, no scan:
1 |
|
Perform default simple scan:
1 |
|
Host Discovery:
Perform Ping scan to discover online hosts:
1 |
|
Perform only Ping scan, no port scan:
1 |
|
Perform ARP scan:
1 |
|
Perform TCP SYN/ACK, UDP or SCTP discovery to given ports:
1 |
|
Basic Scan Types:
Perform TCP SYN scan (This is default scan in nmap):
1 |
|
Perform TCP Connect scan:
1 |
|
Perform UDP scan:
1 |
|
Perform ACK scan (Firewall evasion)
1 |
|
Perform Version scan (Detect services versions)
1 |
|
Perform Null/FIN/Xmas SCan:
1 |
|
Target Specific Scan:
Scan a single IP:
1 |
|
Scan specific IPs:
1 |
|
Scan a IP range:
1 |
|
Scan network using CIDR notation:
1 |
|
Scan a domain:
1 |
|
Scan targets from a file:
1 |
|
Exclude hosts:
1 |
|
Port Specific Scan:
By default, nmap Scans 1000 most common ports.
To scan specific ports:
1 |
|
To scan all 65535 ports:
1 |
|
To scan most common 100 ports (Fast Scan):
1 |
|
OS Detection:
Detect the operating system:
1 |
|
Guess OS even if unsure:
1 |
|
Timing and Performance:
Set timing (0=slow, 5=fast):
1 |
|
Control probes sent in parallel:
1 |
|
Specify the maximum number of port scan probe retransmissions:
1 |
|
Send packets not slower than [num] per second:
1 |
|
Send packets not faster than [num] per second:
1 |
|
Output and Verbosity:
Save output to a file:
1 |
|
Save output in XML format:
1 |
|
Save output in grepable format:
1 |
|
Save output in all three formats:
1 |
|
Increase verbosity level:
1 |
|
Very verbose:
1 |
|
Nmap Scripting Engine:
Run Default script:
1 |
|
Run specific script:
1 |
|
Run vulnerabilities scanning scripts:
1 |
|
Pass arguments to scripts:
1 |
|
Get help for a specific script:
1 |
|
Firewall Evasion Techniques:
Send Fragmented packets:
1 |
|
Set specific MTU:
1 |
|
Use decoys to hide scan source:
1 |
|
Use a specific source port:
1 |
|
Happy Hacking!