Skip to content

Intermediate · Scanning with nmap · topic 13 of 35 · 20 min

nmap scan types

Explanation

nmap is the standard tool for scanning. It can discover hosts, scan ports in different ways, and work quickly or quietly. The common scan types are the TCP connect scan and the SYN ("half-open") scan. You pick ports, speed and output format with simple flags.

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

bash
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)
Basic nmap runs against an authorised lab target. /24 means the whole 192.168.56.x range.

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.

FlagScanNote
-sSSYN "half-open" scanDefault as root; fast
-sTTCP connect scanFull handshake; no root needed
-sUUDP scanFor UDP services like DNS; slow
-PnSkip host discoveryTreat the host as up (e.g. if it ignores pings)

Speed and output

bash
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 later
Timing templates and saving output. Keep your scan files as notes for the report.
Careful: Faster timing (-T4, -T5) is louder and can overwhelm fragile devices. On real engagements, start gentle, respect the rules of engagement, and never blast a production system you were told to treat carefully.

Detection 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 = Network Mapper

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)

Task 1 · Question

nmap is a…

Task 2 · Question

Which flag scans every one of the 65535 ports?

Task 3 · Code · Python

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

Question 1

1.A SYN scan (-sS) is often preferred because it is…

Question 2

2.-Pn tells nmap to…

Question 3

3.A higher -T number means…

Question 4

4.Why save nmap output with -oA?

Read more (free)

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.

From Service, version and OS detection, and NSE

"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.

From Ports, services and what scanning does

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

Answer: SYN, SYN-ACK, ACK

SYN, then SYN-ACK, then ACK.

From TCP/IP and the network layers

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. 1 more topic in “Scanning with nmap” before its exam: Service, version and OS detection, and NSE.
  2. Module 4 exam: scanning with nmap · 12 questions · 20 min, without help. 3 topics of this module still to finish first.
  3. Then the next module, Enumeration and vulnerability assessment. 35 topics left in the course before the final exam.

← Previous: Ports, services and what scanning does