Apro due finestre di terminale sulla mia macchina Linux. Su uno, ho Netcat ascoltare una porta UDP e su altri I nmap -sU quella porta. Netcat riceve la connessione e i dati, ma nmap segnala la porta udp chiusa. Vedo anche una porta ICMP irraggiungibile nei log di nmap (non sono sicuro del motivo per cui il sistema operativo lo sta inviando). Ho provato anche --max-retries 1. Qualsiasi consiglio è molto apprezzato.
$ nc -l -u -p 12345 -v
listening on [any] 12345 ...
connect to [127.0.0.1] from localhost [127.0.0.1] 65188
test
In una finestra diversa
$ sudo nmap -Pn -sU -p 12345 localhost --data-string test -vvv --packet-trace
Starting Nmap 6.49BETA4 ( https://nmap.org ) at 2015-10-15 19:29 EDT
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.
Initiating UDP Scan at 19:29
Scanning localhost (127.0.0.1) [1 port]
SENT (0.0481s) UDP 127.0.0.1:65188 > 127.0.0.1:12345 ttl=42 id=17191 iplen=32
RCVD (0.0479s) UDP 127.0.0.1:65188 > 127.0.0.1:12345 ttl=42 id=17191 iplen=32
SENT (1.0482s) UDP 127.0.0.1:65189 > 127.0.0.1:12345 ttl=59 id=50254 iplen=32
RCVD (1.0482s) UDP 127.0.0.1:65189 > 127.0.0.1:12345 ttl=59 id=50254 iplen=32
RCVD (1.0482s) ICMP [127.0.0.1 > 127.0.0.1 Port 12345 unreachable (type=3/code=3) ] IP [ttl=64 id=4558 iplen=60 ]
Completed UDP Scan at 19:29, 1.20s elapsed (1 total ports)
Nmap scan report for localhost (127.0.0.1)
Host is up, received user-set (0.000067s latency).
Other addresses for localhost (not scanned): ::1
Scanned at 2015-10-15 19:29:52 EDT for 2s
PORT STATE SERVICE REASON
12345/udp closed unknown port-unreach ttl 64
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 1.25 seconds
Raw packets sent: 2 (64B) | Rcvd: 3 (124B)