brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: nmap -sU finds UDP services that a normal scan never sees

Nmap
~/tips/tip-nmap-udp-scan-top-ports

sudo nmap -sU -p 53,67,123,161 192.0.2.10

Scan the UDP side of a host, where DNS, NTP and similar services listen.

A default nmap run only looks at TCP. DNS, NTP, SNMP and plenty of other services use UDP, so a host can look quiet while it is happily answering.

The UDP scan needs root, and I start with a short port list:

sudo nmap -sU -p 53,67,123,161 192.0.2.10

You can combine it with a TCP SYN scan to cover both in one run:

sudo nmap -sS -sU -p T:22,80,443,U:53,123 192.0.2.10

The result needs some care. open means something replied. closed means the host sent back a port unreachable message. Many ports show as open|filtered, which means nothing came back at all, so nmap can’t tell a silent service from a firewall that drops packets. Adding -sV often helps to separate the two, because it sends probes a real service will answer.

Patience is part of it. Many hosts limit how fast they send those unreachable messages, and the nmap manual notes that scanning all 65,536 UDP ports at one such reply per second takes more than 18 hours. Name the ports you want, or use --top-ports, before you try anything bigger. Only scan machines you own or have permission to test.

Further reading: Nmap port scanning techniques

More Nmap tips nmap --packet-trace -p 22,80 192.0.2.10 nmap -p 22,80,443 -oG scan.gnmap 192.0.2.0/24 nmap -sV 192.0.2.10 nmap -sL 192.0.2.0/28 nmap -oX before.xml 192.0.2.10 All Nmap tips (12) All topics

Link