While Windows raw sockets can send and receive ICMP packets, Nmap relies on
libpcap packet capture to spot responses, so if pcap isn't available
(--unprivileged or Npcap not installed), we need to fall back to TCP connect for
host discovery, just like we do for unprivileged users on other operating
systems. Previous behavior was a fatal error suggesting unhelpfully to use
--unprivileged.
This is the flag for the -R option. "always" is more appropriate than
"all," since "resolveall.nse" does something different, and there is a
"resolve_all" function that does that thing as well, unrelated to the -R
option.
Fixed a discrepancy between the number of targets selected with -iR and
the number of hosts scanned. Because "up" hosts did not count towards
the number of hosts in a hostgroup, Nmap would run an extra Ping scan
phase on that number of new targets before scanning. Those extra targets
in the last hostgroup would result in output like "Nmap done: 1056 IP
addresses" when the user specified -iR 1000.
https://security.stackexchange.com/questions/138150/scans-more-ips-than-asked
On reading 'T', 'U', 'S', or 'P', getpts_aux would unconditionally
consume the character before checking to see whether it was followed by
a ':'. You could insert 'T', 'U', 'S', or 'P' in several places and it
would just be ignored, which is different treatment than other letters
got.
Behavior before:
nmap -p 9
# scans port 9
nmap -p discard
# scans port 9
nmap -p Tdiscard
# scans port 9
nmap -p T:Tdiscard
# scans port 9
nmap -p Tdi*ard
# scans port 9
nmap -p Xdiscard
# Error #485: Your port specifications are illegal. Example of proper form: "-100,200-1024,T:3000-4000,U:60000-"
Behavior after:
nmap -p 9
# scans port 9
nmap -p discard
# scans port 9
nmap -p Tdiscard
# Error #485: Your port specifications are illegal. Example of proper form: "-100,200-1024,T:3000-4000,U:60000-"
nmap -p T:Tdiscard
# Error #485: Your port specifications are illegal. Example of proper form: "-100,200-1024,T:3000-4000,U:60000-"
nmap -p Tdi*ard
# Error #485: Your port specifications are illegal. Example of proper form: "-100,200-1024,T:3000-4000,U:60000-"
nmap -p Xdiscard
# Error #485: Your port specifications are illegal. Example of proper form: "-100,200-1024,T:3000-4000,U:60000-"