From 2ec6eb5110895c9c08e8cfd04e66f73f6c060f0c Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 14 Mar 2016 03:41:37 +0000 Subject: [PATCH] Only report unique VHosts in http-apache-server-status. Too much output otherwise. --- scripts/http-apache-server-status.nse | 20 ++++++++++---------- scripts/script.db | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/http-apache-server-status.nse b/scripts/http-apache-server-status.nse index 421eba625..3e5126625 100644 --- a/scripts/http-apache-server-status.nse +++ b/scripts/http-apache-server-status.nse @@ -30,7 +30,7 @@ References: -- | Server Built: Jul 24 2015 15:59:00 -- | Server Uptime: 53 minutes 31 seconds -- | Server Load: 0.00 0.01 0.05 --- | Requests: +-- | VHosts: -- |_ www.example.com:80 GET /server-status HTTP/1.1 -- -- @xmloutput @@ -39,8 +39,8 @@ References: -- Jul 24 2015 15:59:00 -- 59 minutes 26 seconds -- 0.01 0.02 0.05 --- --- www.example.com:80 GET /server-status HTTP/1.1 +--
+-- www.example.com:80 --
author = "Eric Gershman" @@ -78,21 +78,21 @@ action = function(host, port) result["Server Uptime"] = string.match(response.body, "Server%suptime:%s*([^<]*).-") do -- skip line if the request is empty - if not string.match(line, "") then - local request = string.match(line, ">([^<]*)([^<]*)") - uniq_requests[request] = 1 + if not string.match(line, "") then + local vhost = string.match(line, ">([^<]*)