Top 10 Nmap Commands Every Hacker Should Know
Back to Blog
Tools4 min read23,284 views

Top 10 Nmap Commands Every Hacker Should Know

Not a flag dump — learn to read Nmap: how to build a command, how to interpret every port state, a staged workflow, and the ten commands a real assessment actually uses, in order.

Z

ZeroDaysHack Team

November 18, 2026

Nmap is the first tool almost every hacker learns and the last one they stop using. It answers the two questions that open every engagement: what is alive on this network, and what is it running? This guide is not a flag dump — it teaches you to read Nmap: how to build a command, how to interpret every reply, and the ten commands you'll actually reach for, in the order a real assessment uses them.

#Read a command before you run it

An Nmap command looks intimidating until you learn to read it left to right. Every scan is the same shape: the tool, the scan type, what to probe, how fast, where to save, and the target.

Anatomy of an Nmap command, flag by flag
Every Nmap command is: tool · scan type · what to probe · how fast · where to save · scope.

Once you see that structure, a wall of flags becomes a sentence. nmap -sS -sV -p- -T4 -oA scan 10.10.5.0/24 reads as: "SYN-scan every TCP port, identify the service versions, go reasonably fast, save all output formats to files named scan, across this subnet."

#Understand the reply, not just the command

Nmap never gets told "this port is open." It infers state from how the target replies — or doesn't. Misreading these six states is the number-one beginner error.

The six port states Nmap reports and what each one means
Open, closed and filtered are inferences from the reply — 'filtered' is the firewall's answer, not the host's.
StateWhat it meansWhat you do with it
openA service accepted the probeThis is your attack surface
closedHost replied, nothing listeningHost is up; note it
filteredNo reply — something dropped itA firewall is in the way
`open\filtered`Can't tell open from filteredCommon in UDP scans

#Work in stages, not one giant scan

Beginners fire -p- -sV -A at an entire /24 and wait twenty minutes for unreadable output. Professionals narrow at each step: discover live hosts, then scan their ports, then enumerate only what's interesting.

A sane Nmap workflow: discover, then scan, then enumerate
Discover hosts, then port-scan the live ones, then deep-enumerate only what matters.

#The ten commands, in working order

Run these against your own lab. Replace the ranges with your lab's addresses.

1 — Host discovery (who's alive?)

find live hosts without port-scanning
nmap -sn 192.168.56.0/24

2 — Quick top-ports scan (fast first look)

the 1000 most common ports, quickly
nmap -T4 192.168.56.20

3 — All TCP ports (miss nothing)

every one of the 65535 TCP ports
nmap -p- 192.168.56.20

4 — Service and version detection

what software, which version
nmap -sV 192.168.56.20

5 — OS detection

guess the operating system
nmap -O 192.168.56.20

6 — Default scripts + versions (the everyday go-to)

safe default scripts plus versions on specific ports
nmap -sC -sV -p 22,80,443 192.168.56.20

7 — UDP scan (the ports people forget)

UDP is slow but hides DNS, SNMP, DHCP...
nmap -sU --top-ports 50 192.168.56.20

8 — Aggressive scan (loud but thorough)

OS + versions + default scripts + traceroute
nmap -A 192.168.56.20

9 — Vulnerability scripts (NSE)

run the "vuln" script category
nmap --script vuln 192.168.56.20

10 — Save output for your report

all three formats at once: .nmap .gnmap .xml
nmap -sC -sV -oA scans/host20 192.168.56.20

#Timing: fast enough, not reckless

The -T flag sets how aggressively Nmap sends probes, from -T0 (glacial, stealthy) to -T5 (blitz).

TemplateUse it when
-T2You want to be quiet / gentle on fragile targets
-T3The sensible default
-T4A healthy lab or LAN you control — the common choice
-T5You truly don't care about stealth or load

#Reading the version column like a pro

The real value of -sV isn't the port number — it's the banner. Apache 2.4.49, OpenSSH 7.2, vsftpd 2.3.4: a version string is a lead. You take it to a vulnerability database and ask "what's known-broken in exactly this build?" That hand-off — from a scan result to a known weakness — is the whole bridge from scanning to exploitation, and it's where the five-phase method earns its keep.

#Next steps

Nmap tells you what's there; it's the start of the method, not the end. Once you can read a scan fluently, the natural next reads on this blog are Networking for Hacking (so the ports and handshakes actually mean something) and SQL Injection and XSS (what you do once you've found a live web service worth testing). Set up a lab, scan it until the output feels obvious, then go find something to test — with permission.