Network mapper (NMAP) is an opensource security tool used for network exploration, security scanning and auditing
In this article, I will be listing some important Nmap commands that will make network assessment easy. Let’s go!
- Scan single Ipaddress:
nmap ipaddress - Scan a host:
nmap server1.abc.xyz - Scan a host with more information:
nmap -v server1.abc.xyz - Scan multiple Ipaddress:
nmap ipaddress1 ipaddress2 … ipaddress n - Scan a range of Ipaddress using a wildcard:
nmap 192.168.0. * - Scan an entire subnet:
nmap 192.168.1.0/24 - Read a list of hostnames/network from a file:
nmap -iL /path/ eg nmap -iL /temp/host.txt - Exclude hosts or ipaddress:
namp 192.168.1.0/24 – exclude 192.168.1.5 or 192.168.1.0/24 – excludefile /temp/host.txt - Turn on OS and version detection:
nmap -A ipaddress nmap -V -A ipaddress - Find out if the network is behind a firewall:
nmap -sA ipaddress - Scan host when protected by firewall:
namp -PN ipaddress - Scan ipv6 address:
nmap -6 ipv6 address - Scan network for devices that are up (ping scan):
namp -sP ipaddress - Run a fast scan:
nmap -F ipaddress - Display reason why a port is in a particular state:
nmap –reason ipaddress - Display only open ports:
nmap –open ipaddress - Display all packets sent and received:
nmap –packet-trace ipaddress - Display all interfaces and routes:
nmap –iflist - Scan a specific port:
nmap -p80 ipaddress - Scan multiple ports:
nmap -p 21,80 ipaddress - Scan a range of ports:
nmap -p 21 – 443 ipaddress - Scan TCP Port:
nmap -p T:80 ipaddress - Scan UDP Port:
nmap -p U:80 ipaddress - Scan ports with wildcard:
nmap -p“*” ipaddress - Combine options:
namp -p U: 21,53,443 T: 21-80, 443 ipaddress/hostname - Scan top ports:
nmap –top-ports 5 ipaddress - Scan all devices fast (Quick scan):
nmap -T5 ipaddress (T5: fastest, T1: slowest) - Detect
OS: nmap -O ipaddress or nmap -O –osscan-guess ipaddress - Detect remote services:
nmap -sV ipaddress - Scan host using TCP ACK and TCP SYN. This is used if firewall is blocking standard ICMP pings
- ACK:
nmap -PA ipaddress - SYN:
nmap -PS ipaddress - Scan using UPD ping:
nmap -PU ipaddress - Stealth Scan:
nmap -sS ipaddress - OS fingerprinting:
nmap -sT ipaddress - Scan most used UDP ports:
nmap -sU ipaddress - Scan IP protocol supported by machine:
nmap -sO ipaddress - Scan a firewall for security weakness
- Null Scan:
nmap -sN ipaddress - Fin Scan:
nmap -sF ipaddress - Scan with decoy ipaddress:
nmap -n -D ipaddress1, decoy ipaddress2, your ipaddress, decoy ipaddress - Scan firewall spoofing MAC Address:
nmap –spoof-mac “your mac address” ipaddress - Save scan output to a text file:
nmap -oN /fliepath/ ipaddress
I hope you find this cheatsheet useful.



Leave a Reply