Intermediate · Scanning with nmap · topic 13 of 35 · 20 min
nmap scan types
Explanation
What nmap is
nmap (Network Mapper) is a free, open-source scanner. It is the tool most testers reach for first. You give it one or more targets and some flags, and it reports which hosts are up and which ports are open. Everything here should be run only against your lab or an authorised target.
Host discovery and a basic scan
nmap 192.168.56.0/24 # which hosts are up in this lab range?
nmap 192.168.56.102 # scan the most common 1000 ports
nmap -p 22,80,443 192.168.56.102 # scan only these ports
nmap -p- 192.168.56.102 # scan all 65535 ports (slower)Two important scan types
A TCP connect scan (-sT) completes the full handshake to each port, like a normal connection. It is reliable and needs no special privileges, but it is easy to log. A SYN scan (-sS) sends only the first step of the handshake and never finishes it; it is faster and a little quieter, which is why it is often the default when run as root. Both simply ask "is this port open?" — neither breaks in.
| Flag | Scan | Note |
|---|---|---|
| -sS | SYN "half-open" scan | Default as root; fast |
| -sT | TCP connect scan | Full handshake; no root needed |
| -sU | UDP scan | For UDP services like DNS; slow |
| -Pn | Skip host discovery | Treat the host as up (e.g. if it ignores pings) |
Speed and output
nmap -T4 192.168.56.102 # faster timing (T0 slow ... T5 fastest)
nmap -oN scan.txt 192.168.56.102 # save normal output to a file
nmap -oA myscan 192.168.56.102 # save in all formats for laterDetection and defence
Detection: a burst of connection attempts across many ports from one source is a classic scan signature. Firewalls and IDS/IPS raise alerts on it; a SIEM can correlate it with other events. Defence: close unused ports, rate-limit, and tune IDS to alert on scans. Testers should assume a competent blue team will see the scan and may ask about it.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
nmap scan types · 1/7
nmap is the standard, free port scanner.
Prefer a video by a teacher? Find free videos on “nmap scan types tutorial sS sT beginners” on YouTube ↗
In real life: A tidy first scan
On an authorised test, a tester runs nmap -sS -T3 -oA client-initial against the in-scope host range, saving all output formats. She finds three live hosts and a handful of open ports, and keeps the saved files as evidence for the report. She deliberately chose -T3 (normal) rather than -T5, because the rules of engagement asked her not to stress the systems.
Practice (0/3 done)
nmap is a…
Which flag scans every one of the 65535 ports?
nmap -p lets you list ports like "22,80,443". Write parse_ports("22,80,443") returning the list of integers [22, 80, 443]. Ignore any empty pieces.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Service, version and OS detection, and NSEScanning with nmap · same module
- Ports and protocolsCyber Security: from zero to SOC analyst · Networking for security
- TCP/IP and the network layersCyber Security: from zero to SOC analyst · Networking for security
- Enumeration: digging into servicesEnumeration and vulnerability assessment
- CDP and LLDP: discovering neighboursComputer Networking (CCNA level) · Switching and VLANs
- TCP, UDP and port numbersComputer Networking (CCNA level) · How networks work
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
A SYN scan (-sS) is often preferred because it is…
Answer: Faster and does not complete the handshake
It sends only the first handshake step; faster and slightly quieter, but still detectable.
-Pn tells nmap to…
Answer: Skip host discovery and treat the host as up
-Pn is useful when a host ignores pings but is actually up.
A higher -T number means…
Answer: Faster and louder
Timing templates go from -T0 (slow) to -T5 (fastest, loudest).
Why save nmap output with -oA?
Answer: It keeps evidence and notes for the report
Saved output is your evidence and reference for the report.
-O in nmap attempts to…Related
Answer: Guess the operating system
-O does OS detection.
"Filtered" in a scan usually means…Related
Answer: A firewall blocked the reply, so you cannot tell
Filtered means something (often a firewall) stopped the reply.
Which port range does your computer usually pick its source port from?Related
Answer: 49152–65535
Clients use dynamic (ephemeral) ports, 49152–65535 in the IANA range.
From Ports and protocols
What is the correct order of the TCP handshake?Related
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 1 more topic in “Scanning with nmap” before its exam: Service, version and OS detection, and NSE.
- Module 4 exam: scanning with nmap · 12 questions · 20 min, without help. 3 topics of this module still to finish first.
- Then the next module, Enumeration and vulnerability assessment. 35 topics left in the course before the final exam.