From 57bdde922e835e80f0883130df7893b293b5fdf2 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 Dec 2010 00:44:04 +0000 Subject: [PATCH] Allow the first line of a service fingerprint to wrap. Service fingerprints are supposed to be wrapped at 74 columns. The first line was sometimes 148 columns because the preamble, SF-Port1234-TCP:V=5.36TEST2%I=7%D=12/15%Time=4D096053%P=i686-pc-windows-windows wasn't allowed to be wrapped, so this problem occurred whenever the preamble was longer than 74 bytes. --- service_scan.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service_scan.cc b/service_scan.cc index a3fd6831f..50b5cc76f 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -1449,7 +1449,8 @@ void ServiceNFO::addToServiceFingerprint(const char *probeName, const u8 *resp, if (servicefplen == 0) { timep = time(NULL); ltime = localtime(&timep); - servicefplen = Snprintf(servicefp, spaceleft, "SF-Port%hu-%s:V=%s%s%%I=%d%%D=%d/%d%%Time=%X%%P=%s", portno, proto2ascii_uppercase(proto), NMAP_VERSION, (tunnel == SERVICE_TUNNEL_SSL)? "%T=SSL" : "", o.version_intensity, ltime->tm_mon + 1, ltime->tm_mday, (int) timep, NMAP_PLATFORM); + len = Snprintf(buf, sizeof(buf), "SF-Port%hu-%s:V=%s%s%%I=%d%%D=%d/%d%%Time=%X%%P=%s", portno, proto2ascii_uppercase(proto), NMAP_VERSION, (tunnel == SERVICE_TUNNEL_SSL)? "%T=SSL" : "", o.version_intensity, ltime->tm_mon + 1, ltime->tm_mday, (int) timep, NMAP_PLATFORM); + addServiceString(buf, servicewrap); } // Note that we give the total length of the response, even though we