From dd0050598baa33550b8b5c75895f64a5ff9b1016 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sun, 20 Dec 2015 05:34:56 +0000 Subject: [PATCH] Print service info for unlisted ports when service tunnel is detected --- CHANGELOG | 6 ++++++ output.cc | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 26fffc9f6..1d15833ec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # Nmap Changelog ($Id$); -*-text-*- +o Print service info in grepable output for ports which are not listed in + nmap-services when a service tunnel (SSL) is detected. Previously, the + service info ("ssl|unknown") was not printed unless the service inside the + tunnel was positively identified. http://seclists.org/nmap-dev/2015/q4/260 + [Daniel Miller] + o Extend libnetutil's isipprivate function to check for 169.254/16 RFC3927 addresses. [Bill Parker] diff --git a/output.cc b/output.cc index c035e5af3..e7b259162 100644 --- a/output.cc +++ b/output.cc @@ -796,15 +796,16 @@ void printportoutput(Target *currenths, PortList *plist) { *p = '|'; p++; } - if (!sd.name) - serviceinfo[0] = '\0'; - else { + if (sd.name || sd.service_fp || sd.service_tunnel != SERVICE_TUNNEL_NONE) { p = serviceinfo; while ((p = strchr(p, '/'))) { *p = '|'; p++; } } + else { + serviceinfo[0] = '\0'; + } log_write(LOG_MACHINE, "%d/%s/%s//%s//%s/", current->portno, state, protocol, serviceinfo, grepvers);