Make --version-all send all version probes

This commit is contained in:
dmiller 2018-02-06 04:33:57 +00:00
parent 06c38c79dd
commit 5ea4a27650
2 changed files with 8 additions and 2 deletions

View file

@ -1,5 +1,9 @@
#Nmap Changelog ($Id$); -*-text-*-
o --version-all now turns off the soft match optimization, ensuring that all
probes really are sent, even if there aren't any existing match lines for the
softmatched service. [Daniel Miller]
o Increased effectiveness of service scan soft matches. Previously, all probes
which matched the port being scanned would be sent regardless of whether the
service was soft matched; softmatch lines only restricted non-port-matching

View file

@ -1847,7 +1847,9 @@ bool dropdown = false;
// For the first run, we only do probes that match this port number
if ((proto == (*current_probe)->getProbeProtocol()) &&
(*current_probe)->portIsProbable(tunnel, portno) &&
(!softMatchFound || (*current_probe)->serviceIsPossible(probe_matched))) {
// Skip the probe if we softmatched and the service isn't available via this probe.
// --version-all avoids this optimization here and in PROBESTATE_NONMATCHINGPROBES below.
(!softMatchFound || o.version_intensity >= 9 || (*current_probe)->serviceIsPossible(probe_matched))) {
// This appears to be a valid probe. Let's do it!
return *current_probe;
}
@ -1869,7 +1871,7 @@ bool dropdown = false;
if ((proto == (*current_probe)->getProbeProtocol()) &&
!(*current_probe)->portIsProbable(tunnel, portno) &&
(*current_probe)->getRarity() <= o.version_intensity &&
(!softMatchFound || (*current_probe)->serviceIsPossible(probe_matched))) {
(!softMatchFound || o.version_intensity >= 9 || (*current_probe)->serviceIsPossible(probe_matched))) {
// Valid, probe. Let's do it!
return *current_probe;
}