1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

With --version-trace, show the names of probes as they are sent. Also

show the names of probes that had a match with --version-trace (used to
only happen with -d2). The patch is from Tom Sellers.
This commit is contained in:
david
2009-06-08 23:42:57 +00:00
parent 7c63ab6bcd
commit 4e117783a1
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
# Nmap Changelog ($Id$); -*-text-*- # Nmap Changelog ($Id$); -*-text-*-
o The --version-trace option now shows the names of the probes as they
are sent. The patch was from Tom Sellers.
o [Ncat] SSL in listen mode was made to work on systems like BSD in o [Ncat] SSL in listen mode was made to work on systems like BSD in
which a socket inherits its blocking of non-blocking status from the which a socket inherits its blocking of non-blocking status from the
listening socket. Thanks to Daniel Roethlisberger for reporting the listening socket. Thanks to Daniel Roethlisberger for reporting the

View File

@@ -1719,6 +1719,11 @@ static void adjustPortStateIfNeccessary(ServiceNFO *svc) {
const u8 *probestring; const u8 *probestring;
int probestringlen; int probestringlen;
// Report data as probes are sent if --version-trace has been requested
if (o.debugging > 1 || o.versionTrace()) {
log_write(LOG_PLAIN, "Service scan sending probe %s to %s:%hu (%s)\n", probe->getName(), svc->target->targetipstr(), svc->portno, proto2ascii(svc->proto));
}
assert(probe); assert(probe);
if (probe->isNullProbe()) if (probe->isNullProbe())
return 0; // No need to send anything for a NULL probe; return 0; // No need to send anything for a NULL probe;
@@ -2144,12 +2149,12 @@ static void servicescan_read_handler(nsock_pool nsp, nsock_event nse, void *myda
// WOO HOO!!!!!! MATCHED! But might be soft // WOO HOO!!!!!! MATCHED! But might be soft
if (MD->isSoft && svc->probe_matched) { if (MD->isSoft && svc->probe_matched) {
if (strcmp(svc->probe_matched, MD->serviceName) != 0) if (strcmp(svc->probe_matched, MD->serviceName) != 0)
error("WARNING: service %s:%hu had allready soft-matched %s, but now soft-matched %s; ignoring second value", svc->target->NameIP(), svc->portno, svc->probe_matched, MD->serviceName); error("WARNING: service %s:%hu had already soft-matched %s, but now soft-matched %s; ignoring second value", svc->target->NameIP(), svc->portno, svc->probe_matched, MD->serviceName);
// No error if its the same - that happens frequently. For // No error if its the same - that happens frequently. For
// example, if we read more data for the same probe response // example, if we read more data for the same probe response
// it will probably still match. // it will probably still match.
} else { } else {
if (o.debugging > 1) { if (o.debugging > 1 || o.versionTrace()) {
if (MD->product || MD->version || MD->info) if (MD->product || MD->version || MD->info)
log_write(LOG_PLAIN, "Service scan match (Probe %s matched with %s): %s:%hu is %s%s. Version: |%s|%s|%s|\n", log_write(LOG_PLAIN, "Service scan match (Probe %s matched with %s): %s:%hu is %s%s. Version: |%s|%s|%s|\n",
probe->getName(), (*probe->fallbacks[fallbackDepth]).getName(), probe->getName(), (*probe->fallbacks[fallbackDepth]).getName(),