Nmap cheatsheet

Doorzoekbare Nmap-commandoreferentie: host discovery, scantypes, service/OS-detectie, NSE-scripts en timing, met elke optie uitgelegd.

Draait in je browser · er wordt niets verstuurdNieuw

21 commando’s

Host discovery

nmap -sn <target>Ping scan: find which hosts are up on a network without scanning any ports.

Voorbeeld

nmap -sn 192.168.1.0/24

Opties

-snDisable port scanning; only perform host discovery (the "n" is for "no port scan").
nmap -Pn <target>Skip host discovery entirely and treat every target as online, then scan its ports directly.

Useful when a target blocks the ping probes Nmap uses for discovery (common behind a firewall), which would otherwise make Nmap report the host as down and skip it.

Opties

-PnTreat all hosts as online, skip the discovery/ping phase.
nmap -sL <target>List scan: show the targets that a given specification resolves to, without sending any packets to them.

A safe way to check exactly which IPs a CIDR range or hostname list expands to before actually scanning.

nmap <target>Target specification accepts single IPs, hostnames, CIDR ranges, octet ranges, or a file of targets.

Voorbeeld

nmap 192.168.1.1 192.168.1.0/24 192.168.1.1-50 scanme.nmap.org

Opties

-iL <file>Read target list from a file, one target per line.
--exclude <target1,target2,...>Exclude specific hosts from an otherwise broader scan.
--excludefile <file>Exclude hosts listed in a file.

Scan types

nmap -sS <target>TCP SYN scan (the default scan when run with sufficient privileges): sends a SYN packet and reads the response without completing the TCP handshake.

Faster and less intrusive than a full connect scan since the target application typically never sees a completed connection. Requires raw-packet privileges (root/administrator).

nmap -sT <target>TCP connect scan: completes the full TCP three-way handshake using the OS's normal connect() call.

Used automatically when raw-packet privileges are not available (no root/administrator), or IPv6 targets are specified. Slower and more easily logged by the target than -sS.

nmap -sU <target>UDP scan: probes UDP ports instead of TCP.

Significantly slower than a TCP scan because UDP has no handshake to confirm a response, and many systems rate-limit the ICMP "port unreachable" replies Nmap relies on to detect closed ports.

Let op: A UDP scan of all 65535 ports can take a very long time; combine with -p to scope it to a smaller, relevant port list where possible.
nmap -sF <target> nmap -sN <target> nmap -sX <target>FIN, NULL and Xmas scans send unusual TCP flag combinations (FIN only, no flags, or FIN+PSH+URG) that some older or misconfigured firewalls and systems do not log or block, unlike a normal SYN scan.

Only reliable against systems with an RFC 793-compliant TCP stack (mostly older or embedded systems); modern stacks like Windows generally respond the same way to all ports and make these scans unreliable.

nmap -sY <target> nmap -sZ <target>-sY is an SCTP INIT scan (the SCTP equivalent of a TCP SYN scan); -sZ is an SCTP COOKIE-ECHO scan, a stealthier variant that many firewalls do not filter.

SCTP is mainly used in telecom (SS7/SIGTRAN) networks, so these are specialist scan types.

nmap -sO <target>IP protocol scan: determine which IP protocols (TCP, UDP, ICMP, GRE, and so on) a host supports, rather than scanning individual ports.

Useful for discovering protocols other than TCP/UDP that a host or firewall passes, for example whether GRE or ESP (used by some VPNs) is allowed through.

Port specification

nmap -p <ports> <target>Scan only specific ports instead of the default top 1000.

Voorbeeld

nmap -p 22,80,443 <target>
nmap -p 1-1024 <target>
nmap -p- <target>

Opties

-p <n1>,<n2>,...Comma-separated list of specific ports.
-p <n1>-<n2>A port range.
-p-Scan all 65535 ports.
-p U:<ports>,T:<ports>Specify different port lists for UDP (U:) and TCP (T:) in a combined -sU -sT scan.
-FScan only the ports registered in the nmap-services file as "fast" (a smaller subset than the default top 1000).
--top-ports <n>Scan only the n most common ports according to Nmap's internal frequency data.
nmap -F <target>Fast mode: scan fewer ports than the default (the ports in nmap-services flagged as common), trading completeness for speed.

Good for a quick first pass across many hosts; follow up with a full -p- scan on hosts of particular interest.

Service, version & OS detection

nmap -sV <target>Probe open ports to determine the actual service and version running, instead of just guessing from the port number.

Nmap sends protocol-specific probes and matches the responses against its service-probes database; this is how it tells OpenSSH 9.x apart from an unrelated service that happens to also listen on port 22.

Opties

--version-intensity <0-9>How many probes to try. Higher finds more but takes longer; default is 7.
--version-lightShortcut for a low intensity (faster, less thorough).
--version-allTry every available probe (shortcut for intensity 9).
nmap -O <target>Attempt to identify the target's operating system based on subtle differences in how its TCP/IP stack responds to a series of probes.

Needs at least one open and one closed TCP port on the target to work reliably, and requires raw-packet privileges.

Opties

--osscan-guessBe more aggressive about guessing the OS when there is no exact match, at the cost of more false positives.
nmap -A <target>Shortcut that enables OS detection (-O), version detection (-sV), default script scanning (-sC) and traceroute, all in one flag.

Convenient for a thorough first look at a host, but noisier and slower than a targeted scan; the official docs note it should be used thoughtfully rather than as a default for every scan.

NSE scripts

nmap -sC <target>Run the default set of Nmap Scripting Engine (NSE) scripts, a curated, generally safe and useful set tagged "default".

Included automatically by -A; run it on its own to get script output without the extra time cost of OS detection and traceroute.

nmap --script <name-or-category> <target>Run specific NSE scripts by name, category, or a comma-separated combination, instead of the default set.

Voorbeeld

nmap --script http-title,http-headers <target>
nmap --script vuln <target>

Opties

--script <name>One script by filename (without .nse), for example http-title.
--script <category>A whole category, for example vuln, auth, discovery, safe.
--script-args <key=value,...>Pass arguments to a script, for example a custom wordlist or credentials for a brute-force script.
--script-help <name>Show a script's description and arguments without running it.
Let op: Scripts in categories like "vuln", "exploit" or "brute" actively probe for weaknesses or attempt logins, which can trigger alerts, lock out accounts, or affect service stability. Only use them against systems you are authorized to test.

Timing & performance

nmap -T<0-5> <target>Timing templates trade scan speed against stealth and reliability, from 0 (slowest, most evasive) to 5 (fastest, most aggressive).

Opties

-T0Paranoid: extremely slow, intended to evade intrusion detection systems.
-T1Sneaky: slow, also IDS-evasion focused.
-T2Polite: slows down to use less bandwidth and target resources.
-T3Normal: the default, no particular adjustment.
-T4Aggressive: assumes a fast, reliable network; recommended for scanning hosts you control.
-T5Insane: fastest, sacrifices accuracy for speed; may miss results on slower networks.
Let op: Aggressive timing (-T4/-T5) on a fragile network device or an unreliable link can produce inaccurate results (ports reported closed/filtered that are actually open) or overload the target.
nmap --min-rate <n> <target> nmap --max-rate <n> <target>Directly control how many packets per second Nmap sends, instead of using a timing template.

Opties

--min-rate <n>Never send slower than this many packets per second.
--max-rate <n>Never send faster than this many packets per second, useful to avoid overwhelming a sensitive target or link.

Output

nmap -oN <file> <target> nmap -oX <file> <target> nmap -oG <file> <target> nmap -oA <basename> <target>Save scan results to a file in a specific format.

Opties

-oN <file>Normal output, the same text shown on screen.
-oX <file>XML output, suitable for parsing by other tools (including Nmap's own diff/compare tooling).
-oG <file>Grepable output, one line per host, easy to parse with grep/awk.
-oA <basename>Save in all three formats at once, using <basename>.nmap, .xml and .gnmap.
nmap -v <target> nmap -vv <target> nmap -d <target>Increase output detail. -v (repeatable) increases general verbosity; -d (repeatable) adds low-level debugging information.

-v shows discovered open ports as the scan runs instead of only at the end; -d is mainly useful when reporting a bug or understanding exactly what Nmap is doing.

De omschrijvingen in dit naslagwerk zijn voorlopig in het Engels.

Uitleg

Zoek of filter op groep en kopieer een commando met één klik. Open een commando voor uitleg, een voorbeeld en elke optie die het accepteert, met een waarschuwing bij alles dat verstorend kan zijn of alleen mag draaien op systemen waarvoor je toestemming hebt.

🔒 Je invoer blijft in je browser en wordt nergens naartoe gestuurd.

Veelgestelde vragen

Waarom is een UDP-scan zo veel trager dan een TCP-scan?

UDP heeft geen handshake om een reactie te bevestigen, dus Nmap vertrouwt op ICMP "port unreachable"-antwoorden om gesloten poorten te herkennen, en veel systemen rate-limiten die. Beperk -sU met -p tot specifieke poorten waar mogelijk.

Wat nu?

Meer in dit onderdeel

  • Cisco IOS cheatsheetDoorzoekbare Cisco IOS/IOS-XE-referentie: interfaces, VLAN’s, routering, access lists, port security, STP, EtherChannel, SNMP en NAT, met elke parameter uitgelegd.
  • FortiGate (FortiOS) cheatsheetDoorzoekbare FortiGate CLI-commandoreferentie: systeem, netwerk, firewallbeleid, VPN en diagnose, met elke parameter uitgelegd.
  • Palo Alto (PAN-OS) cheatsheetDoorzoekbare PAN-OS CLI-commandoreferentie: security policy, NAT, VPN en diagnose, met elke parameter uitgelegd.

Ook handig

Een probleem gevonden of een suggestie? Laat het ons weten