The network scanner's most useful options for discovery, port scanning, service detection and safe output, for authorised testing of your own networks.
Scan only networks you own or are authorised in writing to test. Scanning other people's systems can be unlawful under the Computer Misuse Act and may breach your hosting provider's terms.
By default Nmap scans the 1,000 most common TCP ports.
The default scan is a SYN scan (-sS), which needs root or administrator rights; without them Nmap uses a TCP connect scan (-sT).
Service and version detection (-sV) and scripts (-sC) make scans slower and noisier but far more useful.
Discovery
Command
Purpose
nmap -sn 10.0.0.0/24
Host discovery only, no port scan
nmap -Pn 10.0.0.5
Skip discovery; treat host as up (for hosts that block ping)
nmap -sL 10.0.0.0/24
List targets and reverse DNS without sending probes to them
Port scanning
Command
Purpose
nmap 10.0.0.5
Default: top 1,000 TCP ports
nmap -p 22,80,443 10.0.0.5
Specific ports
nmap -p- 10.0.0.5
All 65,535 TCP ports
nmap --top-ports 100 10.0.0.5
Most common 100 ports
nmap -sS 10.0.0.5
SYN (half open) scan, needs privileges
nmap -sT 10.0.0.5
Full TCP connect scan
nmap -sU --top-ports 20 10.0.0.5
UDP scan of common ports (slow)
Service and OS detection
Command
Purpose
nmap -sV 10.0.0.5
Service and version detection
nmap -sC 10.0.0.5
Run the default script category (some are intrusive)
nmap -O 10.0.0.5
Operating system detection
nmap -A 10.0.0.5
-sV, -sC, -O and traceroute together
nmap --script ssl-enum-ciphers -p 443 host
TLS versions and ciphers
nmap --script vuln 10.0.0.5
Vulnerability scripts (intrusive; check before use)
Timing and output
Command
Purpose
-T3 (default), -T4
Timing templates; -T4 is faster and suitable for reliable networks
--max-rate 100
Cap packets per second to avoid disrupting fragile devices
-oA scanname
Save normal, XML and grepable output together
-oX scan.xml
XML output for import into other tools
--reason
Show why each port state was decided
Practitioner note
On operational technology, medical devices and older network equipment, scanning can crash services. Agree a low rate (--max-rate) and a testing window with the system owner, and exclude fragile ranges explicitly with --exclude. Keep the -oA output as evidence of exactly what was scanned and when.