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-"
clang 3.4.1 on FreeBSD gave this warning:
nmap.cc:3064:48: warning: use of logical '||' with constant operand
[-Wconstant-logical-operand]
return file_is_readable(filename_returned) || 1;
nmap.cc:3064:48: note: use '|' for a bitwise operation
Changed to match the intent: return 1 if file_is_readable returns 0, otherwise
return that non-0 value.
In addition to silencing an unnecessary fatal error when nmap-os-db is
not found but user has requested -6, this should make start times a bit
more efficient, since only 1 or the other database is loaded. Patch by
Alexandru Geana
Fixes#97
The message stating that an unknown -P* option was used contained
references to old, deprecated forms:
-PT (now -PA)
-PB (now -PE -PA)
-PI (now -PE)
Additionally, -PR was missing.
Changes:
* Fix a collision of the name PS_NONE with a different constant in shlobj.h
* Update solution and project files for VS2013
* Update the NSIS installer to reference the VC 2013 redistributable