Why is an authorised Nmap UDP scan (-sU) of a firewalled test server so slow, and why does it list most ports as open|filtered?
answer
- most answers never arrive
- ICMP errors are rate limited
- one error per second on some kernels
- silence has two meanings
- a protocol-specific payload helps
basics
~20 sA UDP scan sends a datagram per port, and only a UDP reply (open) or an ICMP port unreachable (closed) is conclusive. Silence is reported open|filtered, and retransmissions plus rate-limited ICMP errors make the scan slow.
solid answer
~30 s`-sU` sends a datagram to each port; there is no handshake to read. A UDP reply proves `open`, ICMP port unreachable (type 3, code 3) means `closed`, other unreachable codes mean `filtered`, and no answer after retransmissions is `open|filtered`. Open services often stay silent to an empty datagram, so many open ports hide in that state next to dropped ones. Closed ports are slow too, because many hosts rate-limit ICMP unreachable errors; a limit of one per second would stretch a 65,536-port scan past 18 hours. Version detection (`-sV`) helps separate open ports, and the state remains an inference.
code
bash · 2 lines# TCP SYN and UDP scans of the 20 most common ports, 30 minutes per host at most
sudo nmap -sS -sU --top-ports 20 --host-timeout 30m 192.0.2.10go deeper
Recall that an ICMP port unreachable means closed, a UDP reply means open, and silence is open|filtered.
Explain why most open ports stay silent, why ICMP rate limits stretch the scan, and what -sV adds.
Plan a UDP audit: popular ports first, a recorded vantage point, owner listings to resolve open|filtered, and a report that names the ports left unresolved.
Decide the standing policy on UDP coverage: the time budget, the services that must be resolved and who signs for the ones left ambiguous.
## What the scan sends Nmap's UDP scan (`-sU`) sends a UDP datagram to every targeted port. For some common ports such as 53 and 161 the datagram carries a protocol-specific payload to improve the response rate; for most ports it is empty unless `--data` or `--data-length` is given. UDP has no handshake, so there is no reset to read. Like the other raw scans it needs raw-packet privilege; it can be combined with one TCP scan type in the same run. ## Reading the answers | What comes back | State | |---|---| | A UDP datagram from the service | `open` | | ICMP port unreachable (type 3, code 3) | `closed` | | Other ICMP unreachable errors (type 3, code 0, 1, 2, 9, 10 or 13) | `filtered` | | Nothing, after retransmissions | `open|filtered` | Only the first row proves anything about a listener. A service that does not understand an empty datagram usually stays silent, so many open UDP ports land in `open|filtered`, mixed in with ports a filter dropped. ## Why it is slow 1. **Open and filtered ports rarely reply.** Nmap has to time out and then retransmit just in case the probe or the reply was lost. 2. **Closed ports are often the bigger problem.** They usually return an ICMP port unreachable error, but many hosts rate-limit those errors by default. Linux and Solaris are described as strict; the reference guide's example is a Linux 2.4.20 kernel limiting destination unreachable messages to one per second, which makes a 65,536-port scan take more than 18 hours (check the target's current setting rather than assuming that figure). 3. **Nmap detects the limit and slows down** to avoid sending packets the target will drop. The reference guide's ideas for keeping a UDP scan practical are legitimate scoping choices: scan more hosts in parallel, scan the popular ports first, scan from behind the firewall where the scope allows it, and use `--host-timeout` to skip slow hosts. ## Narrowing the ambiguity - **Version detection** (`-sV`) can help separate truly open ports from filtered ones, because it sends service-specific probes that can draw a real response. - **The vantage point** matters: a scan from inside the firewall tells you what the host does, one from outside tells you what the filter permits. - **The system owner's own listing** of listening UDP sockets is the authoritative answer for the host and should be compared with the scan, not replaced by it. The state is the tool's inference. An `open|filtered` line is a work item, not a finding. ## Do not skip UDP DNS, SNMP and DHCP (registered ports 53, 161/162 and 67/68) are three of the most common UDP services. The reference guide calls ignoring UDP because it is slow and difficult a mistake, since vulnerable UDP services are common. Plan the time for it instead. ## What the defender sees - A burst of datagrams from one source to many UDP ports, usually with an empty body. - ICMP port unreachable errors going back, and gaps in them when the host's rate limit engages; the pattern of replies is itself visible. - Real-looking requests to services on ports such as 53 or 161, because Nmap sends a protocol-specific payload there, so those daemons may log a query that came from the scanner. A typical bounded audit command combines both protocols for the most common ports and caps the time: ```bash sudo nmap -sS -sU --top-ports 20 --host-timeout 30m 192.0.2.10 ```
- Why does version detection help with open|filtered UDP ports?Version detection sends probes crafted for particular services, which can draw a real UDP response that an empty datagram would not. A genuine reply proves the port is open and names the service, while a port that stays silent remains open|filtered. The reference guide recommends it for separating truly open ports from filtered ones.
- A UDP scan from outside labels port 161 open|filtered, but the owner's listing shows a listener there; what does that tell you?It shows the scan's silence was ambiguous, as expected. The service may have ignored a probe it did not accept, or a filter may have dropped the datagram or the reply. The owner's listing settles the host side, and the scan result stays useful as evidence about what the filter permits from that vantage point.
- How do you keep a UDP audit practical without dropping UDP from scope?Scan the popular ports first rather than all 65,536, run hosts in parallel, scan from inside the firewall where the scope allows it, and use `--host-timeout` to skip a host that is too slow. Report the ports skipped so the gap is on record rather than silently ignored.
- UDP scanning is the same as TCP scanning but with UDP packets
- No reply to a UDP probe means the port is closed
- An open|filtered port is confirmed open
- UDP ports are not worth scanning because they are slow
- ICMP port unreachable replies always arrive at full speed