Skip to main content

NMAP commands

This page contain list of NMAP commands

CommandsDescription
Scan a single IPnmap 10.0.0.1
Scan a hostnmap www.testhostname.com
Scan a range of lPsnmap 10.0.0.1-20
Scan a subnetnmap 10.0.0.0/24
Scan targets from a text filenmap -iL list-of-ips.txt
Scan a single Portnmap -p 22 10.0.0.1
Scan a range of portsnmap -p 1-100 10.0.0.1
Scan 100 most common ports (Fast)nmap —F 10.0.0.1
Scan all 65535 portsnmap -p- 10.0.0.1
Scan using TCP connectnmap -sT 10.0.0.1
Scan using TCP SYN scan (default)nmap -sS 10.0.0.1
Scan UDP portsnmap -sU -p 123,161,162 10.0.0.1
Scan selected ports -ignore discoverynmap -Pn -F 10.0.0.1
Detect OS and Servicesnmap -A 10.0.0.1
Standard service detectionnmap -sV 10.0.0.1
More aggressive Service Detectionnmap -sV --version—intensity 5 10.0.0.1
Lighter banner grabbing detectionnmap -sV --version-intensity 0 10.0.0.1
Save default output to filenmap -oN outputfile.txt 10.0.0.1
Save results as XMLnmap -oX outputfile.xml 10.0.0.1
Save results in a format for grepnmap -oG outputfile.txt 10.0.0.1
Save in all formatsnmap -oA outputfile 10.0.0.1
Scan using default safe scriptsnmap -sV —sC 10.0.0.1
Get help for a scriptnmap --script-help=ssl-heartbleed
Scan using a specific NSE scriptnmap -sV -p 443 —script=sslheartbleed.nse 10.0.0.1
Scan with a set of scriptsnmap -sV --script=smb* 10.0.0.1
Gather page titles from HTTP servicesnmap --script=http-title 10.0.0.0/24
Get HTTP headers of web servicesnmap --script=http-headers 10.0.0.0/24
Find web apps from known pathsnmap --script=http—enum 10.0.0.0/24
Find Information about IP addressnmap --script:asn-query,whois,ipgeolocation-maxmind 10.0.0.0/24