Port Specification & Scan Order
1. -p
nmap -p 80,443 <target> # Scan ports 80 and 443 nmap -p 1-1023 <target> # Scan ports 1 to 1023 nmap -p 80,443,1000-2000 <target> # Scan ports 80, 443, and 1000-2000 nmap -p U:53,111,137,T:21-25 <target> # Scan specific UDP and TCP ports nmap -p ftp,http* <target> # Scan FTP and ports beginning with 'http'
2. --exclude-ports
nmap --exclude-ports 80,443 <target> # Exclude ports 80 and 443 from scanning nmap --exclude-ports 1-1023 <target> # Exclude ports 1-1023 from scanning
3. -F (Fast scan)
nmap -F <target> # Scan the top 100 most common ports
4. -r (Don't randomize ports)
5. --port-ratio
6. --top-ports
Summary Example Commands
Last updated