UDP Scanning with Nmap
Learn how Nmap's -sU option discovers UDP services, interprets open, closed, and open|filtered states, and validates findings safely.
UDP scanning helps you discover services that a TCP-focused assessment can miss. This lesson explains how Nmap probes UDP ports, why results are often slower or less certain than TCP results, and how to plan, interpret, validate, and document an authorized UDP scan.
Why UDP scanning matters
UDP, or User Datagram Protocol, is a connectionless transport protocol used by many important network services. TCP services often receive priority because TCP provides a visible connection process and is common for web, remote-access, and file-transfer applications. However, omitting UDP can leave important infrastructure undiscovered.
UDP services commonly appear in infrastructure, identity, monitoring, time-synchronization, and local-network environments. Examples include:
- DNS, commonly associated with UDP port 53, provides name resolution.
- SNMP, commonly associated with UDP ports 161 and 162, supports monitoring and management.
- DHCP, commonly associated with UDP ports 67 and 68, assigns network configuration to clients.
- NTP, commonly associated with UDP port 123, synchronizes system clocks.
- NetBIOS Name Service, commonly associated with UDP port 137, supports name resolution on some Windows networks.
The security and operational importance of a UDP port depends on the host's role, exposure, authentication controls, network location, and service configuration.
How UDP differs from TCP scanning
TCP normally uses a connection handshake. A scanner can often infer a TCP port's state from responses to packets such as a SYN. UDP does not use a TCP-style handshake: a scanner sends a datagram, and the application may respond, ignore it, or be prevented from responding by a firewall.
This makes UDP classification slower and less definitive. An application-level response is useful evidence that a service is listening, while an ICMP error can indicate that a port is closed. Silence alone does not tell Nmap whether a service ignored the probe or a filter blocked the traffic.
The Nmap UDP scan option
Nmap enables UDP scanning with -sU. The basic command structure is:
nmap -sU <target>
Replace <target> with an authorized IP address, hostname, or approved target range. For example:
nmap -sU 192.168.5.102
Depending on the operating system and Nmap installation, UDP scanning may require elevated privileges for raw-packet operations. If Nmap reports permission or raw-packet restrictions, use an authorized administrative account according to local policy.
How Nmap evaluates UDP ports
Nmap sends UDP probes to the selected ports and evaluates returned traffic, error messages, and the absence of a response:
- An application-level UDP response generally indicates that the port is open.
- An ICMP port-unreachable response generally indicates that the port is closed. ICMP is a network-layer protocol used, among other purposes, to report delivery errors.
- No response commonly produces open|filtered. The port may be open but silently ignoring the probe, or a firewall may be filtering the probe or its response.
ICMP filtering and ICMP rate limiting can make a scan slower and make closed-port results less conclusive. Rate limiting means the network restricts how frequently it sends ICMP error responses.
UDP probe outcome flow
A simplified interpretation looks like this:
- Scanner sends a UDP probe to the target port.
- A UDP application response provides evidence for open.
- An ICMP port-unreachable response provides evidence for closed.
- No response leaves the result as open|filtered.
Nmap UDP port states
| State | Typical Nmap evidence | Meaning | Recommended next step |
|---|---|---|---|
| open | Nmap received an application-level UDP response. | There is evidence that a UDP service is listening. | Identify and assess the service in the context of the host and scope. |
| closed | Nmap received an ICMP port-unreachable response. | There is evidence that no UDP service is listening on that port. | Confirm the result if the port is expected to be active. |
| open|filtered | No response or a response that cannot distinguish service behavior from filtering. | Inconclusive; the port may be open, filtered, or silently ignoring the probe. | Do not treat it as confirmation. Use focused probing, service detection, and authorized protocol validation. |
In a scan report, Nmap displays the port number, transport protocol, state, and a detected or inferred service name. For example, 123/udp identifies port 123 using UDP. The service label may be a known name such as NTP, or it may be unknown when Nmap lacks enough evidence to map the port confidently.
Common UDP services to prioritize
| UDP port | Typical service | Why it may matter during an authorized assessment |
|---|---|---|
| 53 | DNS | Name resolution and DNS server exposure can affect internal discovery and application operation. |
| 67/68 | DHCP | DHCP controls address and network configuration and is especially relevant on local networks. |
| 123 | NTP | Time synchronization affects authentication, logging, certificates, and distributed systems. |
| 137 | NetBIOS Name Service | May reveal or support legacy Windows naming and local-network functionality. |
| 161/162 | SNMP | Monitoring and management interfaces may expose device information or operational capabilities if poorly controlled. |
Reading a UDP scan report
Begin by checking whether Nmap considers the host up. The report may include host reachability information and latency, which is an estimate of how quickly the target responded. A host can be reachable while many of its UDP ports remain difficult to classify.
Next, inspect the port table. A typical row has this conceptual structure:
PORT STATE SERVICE
123/udp open ntp
137/udp open|filtered netbios-ns
49152/udp closed unknown
123/udpwithopenandntpindicates evidence of an active NTP service.137/udpwithopen|filteredis not confirmation that NetBIOS Name Service is available. The probe received no conclusive response.- A high-numbered port such as
49152/udpmay use a dynamic, application-specific, or nonstandard service. Anunknownlabel means Nmap could not map it to a known service with confidence.
Nmap may summarize large groups of ports instead of printing every row, for example by stating that many ports are in the same open|filtered state. Such a summary means those ports share the reported state; it does not mean they are all confirmed open.
Targeted UDP scanning
Focused scans are often more efficient than scanning every UDP port. Select ports based on the target's role, expected services, network position, and assessment scope.
nmap -sU -p 53,67,68,123,137,161,162 192.168.5.102
The -p option limits the scan to the listed ports. This example checks common DNS, DHCP, NTP, NetBIOS, and SNMP ports.
For broad discovery, -p- selects ports 1 through 65535:
nmap -sU -p- 192.168.5.102
A full UDP range scan can take a long time and generate substantial traffic. Use it only when the scope, available time, network capacity, and authorization support it.
Useful Nmap UDP scan options
| Option | Purpose | Example usage | Operational consideration |
|---|---|---|---|
-sU | Enable UDP port scanning. | nmap -sU 192.168.5.102 | May require elevated privileges. |
-p | Select specific ports or port lists. | -p 53,123,161 | Focused selection usually reduces scan time. |
-p- | Scan ports 1 through 65535. | -p- | Can be slow and noisy; confirm scope first. |
-sV | Request service and version identification. | -sU -sV -p 53,123,161 | Adds probes and time; results may still be inconclusive. |
-oA | Save normal, XML, and grepable output. | -oA udp-scan | Protect saved results because they may contain sensitive network information. |
Service detection and result validation
A UDP finding should be validated before it becomes a firm assessment conclusion. Use Nmap service detection on selected ports where appropriate:
nmap -sU -sV -p 53,123,161 192.168.5.102
-sV adds service probing and may identify the application or version. It can increase scan duration, and some UDP services still provide too little information for reliable identification. In an authorized environment, follow up with protocol-specific checks that match the service and the rules of engagement.
Assess each confirmed or suspected service in context:
- What role does the host perform?
- Is the service intended to be exposed to this network?
- Does it require authentication or restrict clients?
- Do firewall and access-control policies match the intended design?
- Does the service version require patching or further review?
Save results for reporting, repeatable testing, and comparison with later scans:
nmap -sU -p 53,123,161 -oA udp-scan 192.168.5.102
The base name udp-scan causes Nmap to create normal, XML, and grepable output files.
Performance and scan planning
UDP scans commonly take longer than basic TCP scans because UDP has no handshake that quickly confirms or rejects every port. A service may remain silent, firewalls may drop packets, packets may be lost, and devices may rate-limit ICMP errors. Nmap must often wait for timeouts before moving on.
- Start with relevant UDP ports and expand the selection based on findings.
- Allow adequate time for slow or filtered networks.
- Consider packet loss, firewall policy, service behavior, and ICMP rate limiting when interpreting results.
- Avoid aggressive timing against fragile networks or devices. Faster timing can reduce reliability and may overload sensitive services.
- Coordinate scans with network owners when monitoring, capacity, or operational risk is a concern.
Troubleshooting common results
Most ports are open|filtered
UDP applications may ignore the probe, a firewall may silently drop traffic, or return traffic and ICMP errors may be filtered. Do not interpret open|filtered as proof that a service is open. Test expected ports explicitly, use -sV where appropriate, and compare the result with the host role and firewall policy.
The scan takes much longer than expected
Common causes include missing UDP responses, ICMP port-unreachable rate limiting, packet loss, and a large port range. Start with selected ports, allow adequate time, and avoid overly aggressive timing that could lower accuracy or affect the network.
A port has an unknown service label
Nmap may not recognize the port, the service may use a nonstandard port, or the response may not provide enough evidence. Run service detection against that specific port and use approved protocol-aware validation. Document it as unidentified until the evidence supports a service classification.
An expected port is closed or absent
Confirm the target address, route, VLAN, interface binding, and scan scope. The service may not listen on the tested interface, filtering may alter the observed response, or the service may use a nonstandard port. Verify configuration from an authorized administrative perspective and scan the expected port explicitly.
Nmap cannot perform the scan
The account may lack required privileges, endpoint controls may restrict raw-packet operations, or the installed Nmap build may not support the intended method. Use appropriate authorized administrative privileges, follow operating-system and organizational policy, and confirm the Nmap installation.
Practical workflow
- Confirm authorization, target scope, timing, and network-impact limits.
- Run a focused UDP scan against ports relevant to the host's role.
- Review host status, latency, individual rows, and summarized states.
- Treat
open|filteredas inconclusive rather than as an open-port confirmation. - Use
-sVand approved protocol-specific checks to validate important findings. - Assess exposure, access controls, service configuration, and host purpose.
- Save output and record command parameters, date, scope, and interpretation.
- Expand to a full UDP range only when the assessment requires it and the operational constraints allow it.
Key exam notes
-sUis Nmap's UDP scan option.- UDP is connectionless and does not use a TCP-style handshake.
- An application-level UDP response usually indicates
open. - An ICMP port-unreachable response usually indicates
closed. - No response commonly produces
open|filtered, which is inconclusive. - UDP scans can be slow because of filtering, packet loss, silent services, and ICMP rate limiting.
- Use focused ports first, validate important findings with service detection, and scan only authorized targets.
Related Nmap concepts
Review User Datagram Protocol basics, TCP fundamentals, service and version detection, Nmap port states, and saving Nmap output to extend this workflow.