Ubuntu/Debian:
sudo apt update
sudo apt install nmap
CentOS/RHEL:
sudo yum install nmap
Scan a Single Target:
nmap 192.168.1.1
Scan Multiple Targets:
nmap 192.168.1.1 192.168.1.2
Scan a Range of IPs:
nmap 192.168.1.1-10
Scan Specific Ports:
nmap -p ,
Scan All Ports:
nmap -p-
Scan for Open Ports Only:
nmap --open
SYN Scan (Stealth Scan):
nmap -sS
TCP Connect Scan:
nmap -sT
UDP Scan:
nmap -sU
Ping Scan:
nmap -sn
Detect Services:
nmap -sV
Detect OS:
nmap -O
Run Default Scripts:
nmap -sC
Run Specific Scripts:
nmap --script
Save Output to a File:
nmap -oN
Save Output in XML Format:
nmap -oX
Set Timing Template:
nmap -T<0-5>
Adjust Max Retries:
nmap --max-retries
Fragment Packets:
nmap -f
Decoy Scan:
nmap -D ,,ME
Idle Scan:
nmap -sI
IPv6 Scan:
nmap -6
Scan Behind Firewall (using proxies):
nmap --proxies
Scan with Custom Data Length:
nmap --data-length
List Available Scripts:
ls /usr/share/nmap/scripts/
Run Vulnerability Scripts:
nmap --script vuln
Run Safe Scripts:
nmap --script safe
Compare Two Nmap Output Files:
ndiff
Compare Multiple Nmap Output Files:
ndiff
Zenmap is a graphical front-end for Nmap that makes it easier to run scans and visualize results.
Install Zenmap:
sudo apt install zenmap
Launch Zenmap:
zenmap
Check Nmap Version:
nmap --version
Debugging Output:
nmap -d
Verbose Output:
nmap -v
Official Nmap Documentation:
Nmap Manual
Nmap Mailing List:
Nmap Development Mailing List
Nmap Scripting Engine (NSE) Documentation:
NSE Documentation