Network discovery and security auditing scanner used for host discovery, port scanning, and service detection.
nmap {flag-i} {flag-i-2} {exclude} {excludefile} {flag-s} ๐ flag-i ๐ flag-i-2 ๐ exclude ๐ excludefile ๐ flag-s nmap {flag-i} {flag-i-2} {exclude} {excludefile} {flag-s} Sandbox: execFile · Timeout: 300s · Container: instrumentisto/nmap
network.discovery.host network.scan.port network.scan.service security.fingerprint.os security.fingerprint.service security.audit.script security.evasion.firewall | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
flag-i | string | No | - | Set the flag-i parameter | -i |
flag-i-2 | string | No | - | Set the flag-i-2 parameter | -i |
exclude | string | No | - | Set the exclude parameter | --exclude <host1[,host2][,host3],...> |
excludefile | file | No | - | Set the excludefile parameter | --excludefile <exclude_file> |
flag-s | string | No | - | List Scan - simply list targets to scan | -s |
flag-s-2 | string | No | - | Ping Scan - disable port scan | -s |
flag-P | string | No | - | Treat all hosts as online -- skip host discovery | -P |
flag-P-2 | string | No | - | TCP SYN, TCP ACK, UDP or SCTP discovery to given ports | -P |
flag-P-3 | string | No | - | ICMP echo, timestamp, and netmask request discovery probes | -P |
flag-P-4 | string | No | - | Set the flag-P-4 parameter | -P |
flag-n | string | No | sometimes | Never do DNS resolution/Always resolve | -n, -R |
dns-servers | string | No | - | Set the dns-servers parameter | --dns-servers <serv1[,serv2],...> |
system-dns | string | No | - | Set the system-dns parameter | --system-dns |
traceroute | string | No | - | Set the traceroute parameter | --traceroute |
flag-s-3 | string | No | - | TCP SYN/Connect()/ACK/Window/Maimon scans | -s |
flag-s-4 | string | No | - | UDP Scan | -s |
flag-s-5 | string | No | - | TCP Null, FIN, and Xmas scans | -s |
scanflags | string | No | - | Set the scanflags parameter | --scanflags <flags> |
flag-s-6 | string | No | - | Set the flag-s-6 parameter | -s |
flag-s-7 | string | No | - | SCTP INIT/COOKIE-ECHO scans | -s |
flag-s-8 | string | No | - | IP protocol scan | -s |
flag-b | string | No | - | Set the flag-b parameter | -b |
flag-p | string | No | - | Set the flag-p parameter | -p |
exclude-ports | string | No | - | Set the exclude-ports parameter | --exclude-ports <port ranges> |
flag-r | string | No | - | Scan ports sequentially - don't randomize | -r |
top-ports | integer | No | - | Set the top-ports parameter | --top-ports <number> |
port-ratio | string | No | - | Set the port-ratio parameter | --port-ratio <ratio> |
flag-s-9 | string | No | - | Probe open ports to determine service/version info | -s |
version-intensity | integer | No | - | Set the version-intensity parameter | --version-intensity <level> |
version-light | string | No | - | Set the version-light parameter | --version-light |
PE | boolean | No | - | /PP/PM: ICMP echo, timestamp, and netmask request discovery probes | -PE |
PO | boolean | No | - | IP Protocol Ping | -PO |
PS | boolean | No | - | /PA/PU/PY[portlist]: TCP SYN, TCP ACK, UDP or SCTP discovery to given ports | -PS |
Pn | boolean | No | - | Treat all hosts as online -- skip host discovery | -Pn |
append-output | string | No | - | --append-output | |
badsum | string | No | - | --badsum | |
data | string | No | - | --data <hex string> | |
data-length | integer | No | - | --data-length <num> | |
data-string | string | No | - | --data-string <string> | |
datadir | string | No | - | --datadir <dirname> | |
flag-6 | string | No | - | Enable IPv6 scanning | -6 |
flag-D | string | No | - | -D | |
flag-S | string | No | - | -S | |
flag-T | string | No | - | Set timing template (higher is faster) | -T, -5 |
flag-d | string | No | - | Increase debugging level (use -dd or more for greater effect) | -d |
flag-e | string | No | - | -e | |
flag-h | string | No | - | Print this help summary page | -h |
flag-o | file | No | - | and Grepable format, respectively, to the given filename | -o, -o, -o, -o |
flag-o-2 | string | No | - | -o | |
flag-s-10 | string | No | - | equivalent to --script=default | -s |
flag-v | string | No | - | Increase verbosity level (use -vv or more for greater effect) | -v |
host-timeout | number | No | - | --host-timeout <time> | |
iL | boolean | No | - | Input from list of hosts/networks | -iL |
iR | boolean | No | - | Choose random targets | -iR |
iflist | string | No | - | --iflist | |
ip-options | string | No | - | --ip-options <options> | |
max-rate | integer | No | - | --max-rate <number> | |
max-retries | string | No | - | --max-retries <tries> | |
min-hostgroup | string | No | - | -h, --min-hostgroup | |
min-parallelism | string | No | - | -p, --min-parallelism | |
min-rate | integer | No | - | --min-rate <number> | |
min-rtt-timeout | string | No | - | probe round trip time | -r, -t, -r, -t, --min-rtt-timeout |
mtu | string | No | - | -f, --mtu <val> | |
no-stylesheet | string | No | - | --no-stylesheet | |
noninteractive | string | No | - | --noninteractive | |
oA | boolean | No | - | Output in the three major formats at once | -oA |
oX | boolean | No | - | Output scan in normal, XML, s|<rIpt kIddi3, | -oX, -oS, -oG |
open | string | No | - | --open | |
osscan-guess | string | No | - | --osscan-guess | |
osscan-limit | string | No | - | --osscan-limit | |
packet-trace | string | No | - | --packet-trace | |
privileged | string | No | - | --privileged | |
proxies | string | No | - | --proxies <url1,[url2],...> | |
reason | string | No | - | --reason | |
resume | string | No | - | --resume <filename> | |
sC | boolean | No | - | equivalent to --script=default | -sC |
sI | boolean | No | - | Idle scan | -sI |
sL | boolean | No | - | List Scan - simply list targets to scan | -sL |
sN | boolean | No | - | /sF/sX: TCP Null, FIN, and Xmas scans | -sN |
sO | boolean | No | - | IP protocol scan | -sO |
sS | boolean | No | - | /sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans | -sS |
sU | boolean | No | - | UDP Scan | -sU |
sV | boolean | No | - | Probe open ports to determine service/version info | -sV |
sY | boolean | No | - | /sZ: SCTP INIT/COOKIE-ECHO scans | -sY |
scan-delay | number | No | - | --scan-delay, --max-scan-delay <time> | |
script | string | No | - | directories, script-files or script-categories | --script |
script-args | string | No | - | --script-args | |
script-args-file | string | No | - | --script-args-file | |
script-help | array | No | - | <Lua scripts> is a comma-separated list of script-files or script-categories | --script-help |
script-trace | string | No | - | --script-trace | |
script-updatedb | string | No | - | --script-updatedb | |
send-eth | string | No | - | --send-eth, --send-ip | |
sn | boolean | No | - | Ping Scan - disable port scan | -sn |
source-port | string | No | - | -g, --source-port <portnum> | |
spoof-mac | string | No | - | --spoof-mac <mac address/prefix/vendor name> | |
stylesheet | string | No | - | --stylesheet <path/URL> | |
ttl | string | No | - | -t, -l, --ttl <val> | |
unprivileged | string | No | - | --unprivileged | |
version-all | string | No | - | --version-all | |
version-trace | string | No | - | --version-trace | |
webxml | string | No | - | --webxml |
| Type | Description | MIME | Schema | Trust |
|---|---|---|---|---|
network.scan.nmap.xml | Structured Nmap XML output with port and service details | application/xml | 1.0.0 | verified |
network.scan.nmap.json | JSON-formatted scan results | application/json | 1.0.0 | verified |
network.scan.nmap.grepable | Legacy grepable format for text processing | text/plain | - | community |
Inputs
network.target.ip Target IP address or hostname
network.target.range IP range or CIDR notation
Outputs
network.scan.nmap.xml Structured scan results in XML format
network.scan.nmap.json Scan results as JSON
network_trafficraw_socket_access Produces
network.scan.nmap.xmlnetwork.scan.nmap.jsonConsumes
network.target.ipnetwork.target.range| Resource | Value |
|---|---|
| CPU | medium |
| Memory | 256 MB |
| Network | high |
| Disk I/O | low |
Basic port scan of a target
nmap -sS -T4 scanme.nmap.org Full service and OS detection
nmap -sS -sV -O -T4 scanme.nmap.org Scan specific ports with default NSE scripts
nmap -sS -sC -p 22,80,443 scanme.nmap.org UDP scan of top 100 ports
nmap -sU --top-ports 100 scanme.nmap.org Nmap's `krb5-enum-users` script attempts to bruteforce and enumerate valid Active Directory accounts through Kerberos Pre-Authentication
nmap -p 88 --script=krb5-enum-users --script-args krb5-enum-users.realm='test.local',userdb=usernames.txt 10.10.10.1 Darkiros RECON: Nmap - hosts alive
nmap -sn [ip_range] Darkiros RECON: Nmap - classic scan
nmap -sC -sV [ip] Darkiros RECON: Nmap - read targets from file
nmap -iL [file] Darkiros RECON: Nmap - scan all port full
nmap -Pn -sC -sV -p [port] [ip] -oN scan.txt --reason --script=vuln Darkiros RECON: Nmap - UDP scan
nmap -sU [ip] Darkiros RECON: Nmap - SMB signin disabled
nmap -Pn -sS -T4 --open --script smb-security-mode -p 445 [ip] Darkiros RECON: Nmap - kerberos user enumeration
nmap -p 88 --script krb5-enum-users --script-args krb5-enum-users.realm=[domain] [dc-ip] Darkiros RECON: Nmap - showmount
nmap -sV --script=nfs-showmount [ip] Darkiros RECON: VNC - nmap enum
nmap -sV -p [port|5900] --script=realvnc-auth-bypass,vnc-info,vnc-title [ip] Darkiros RECON: mssql - enum
nmap --script ms-sql-info,ms-sql-empty-password,ms-sql-xp-cmdshell,ms-sql-config,ms-sql-ntlm-info,ms-sql-tables,ms-sql-hasdbaccess,ms-sql-dac,ms-sql-dump-hashes --script-args mssql.instance-port=1433,mssql.username=sa,mssql.password=,mssql.instance-name=MSSQLSERVER -sV -p [port|1433] [IP] Darkiros RECON: nmap - pop3 infos
nmap --script "pop3-capabilities or pop3-ntlm-info" -sV -port [port] [ip] Darkiros RECON: nmap - mysql enumeration
nmap -sV -p 3306 --script mysql-audit,mysql-databases,mysql-dump-hashes,mysql-empty-password,mysql-enum,mysql-info,mysql-query,mysql-users,mysql-variables,mysql-vuln-cve2012-2122 [ip] Darkiros ATTACK/CONNECT: nmap - FTP enum anonym
nmap --script ftp-anon -p 21 [ip] Darkiros ATTACK/CONNECT: nmap - x11 check anonymous connection
nmap --script x11-access -p 6000-6063 -sV [ip] Darkiros RECON: nmap - snmp scan
nmap -sU -p 161 -sC --open [ip] Darkiros ATTACK/BRUTEFORCE: nmap - snmp brute force
nmap -sU -p 161 --script snmp-brute --script-args snmpbrute.communitiesdb=[wordlist] [ip] NetRunners Active Directory/enumeration
nmap -p- --open -sS --min-rate 5000 -n -Pn {{IP}} -vvv NetRunners KERBEROS/enumeration
nmap -p- --open -sS --min-rate 5000 -n -Pn {{IP}} -vvv NetRunners web/enumeration
nmap -p- --open -sS --min-rate 5000 -n -Pn {{IP}} -vvv Single target scan:
nmap [target] Scan from a list of targets:
nmap -iL [list.txt] Scan port for all available A records (useful when multiple A records are returned by the DNS server)
nmap --script resolveall \ cheat.sheets: nmap
--script-args newtargets,resolveall.hosts=[target] -p [port] iPv6:
nmap -6 [target] OS detection:
nmap -O --osscan_guess [target] Save output to text file:
nmap -oN [output.txt] [target] Save output to xml file:
nmap -oX [output.xml] [target] Scan a specific port:
nmap -p [port] [target] Do an aggressive scan:
nmap -A [target] Speedup your scan: -n => disable ReverseDNS --min-rate=X => min X packets / sec
nmap -T5 --min-parallelism=50 -n --min-rate=300 [target] Traceroute:
nmap -traceroute [target] Example: Ping scan all machines on a class C network
nmap -sP 192.168.0.0/24 Use some script:
nmap --script default,safe Loads the script in the default category, the banner script, and all .nse files in the directory /home/user/customscripts.
nmap --script default,banner,/home/user/customscripts Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy.
nmap --script 'http-*' Loads every script except for those in the intrusive category.
nmap --script "not intrusive" Loads those scripts that are in both the default and safe categories.
nmap --script "default and safe" Loads scripts in the default, safe, or intrusive categories, except for those whose names start with http-.
nmap --script "(default or safe or intrusive) and not http-*" Scan for the heartbleed -pT:443 => Scan only port 443 with TCP (T:)
nmap -T5 --min-parallelism=50 -n --script "ssl-heartbleed" -pT:443 127.0.0.1 Show all information (debug mode)
nmap -d ... Discover DHCP information on an interface
nmap --script broadcast-dhcp-discover -e eth0 Nmap (Network Mapper) is the industry-standard open-source utility for network discovery, security auditing, and vulnerability assessment. It uses raw IP packets to determine which hosts are available on a network, what services those hosts are offering, what operating systems they are running, and what packet filters/firewalls are in use.
| Scan Flag | Type | Description | Requires Privilege |
|---|---|---|---|
-sS |
SYN scan | Half-open TCP scan (stealth) | Yes |
-sT |
TCP connect scan | Full TCP connection scan | No |
-sU |
UDP scan | UDP service discovery | Yes |
-sA |
ACK scan | Firewall rule mapping | Yes |
-sV |
Version detection | Service version fingerprinting | Varies |
-sC |
Default scripts | Common NSE script execution | Varies |
NSE extends nmap with over 600 scripts for:
vuln category scriptsdiscovery, safe categoriesauth categorybrute categoryexploit category# Run all vulnerability scripts
nmap --script vuln target
# Run all safe scripts for service enumeration
nmap -sV --script "safe or discovery" target
# Normal output (default)
nmap target
# XML output (machine-parseable)
nmap -oX scan.xml target
# Grepable output (legacy)
nmap -oG scan.gnmap target
# JSON output (modern structured)
nmap -oJ scan.json target
# All formats simultaneously
nmap -oA scan target
-sS) require root privileges on Linux/MacOS-T5) can cause denial-of-service; use responsibly-D) or idle scans (-sI) for operational stealth