mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 20:51:30 +00:00
Only report unique VHosts in http-apache-server-status. Too much output otherwise.
This commit is contained in:
@@ -30,7 +30,7 @@ References:
|
|||||||
-- | Server Built: Jul 24 2015 15:59:00
|
-- | Server Built: Jul 24 2015 15:59:00
|
||||||
-- | Server Uptime: 53 minutes 31 seconds
|
-- | Server Uptime: 53 minutes 31 seconds
|
||||||
-- | Server Load: 0.00 0.01 0.05
|
-- | Server Load: 0.00 0.01 0.05
|
||||||
-- | Requests:
|
-- | VHosts:
|
||||||
-- |_ www.example.com:80 GET /server-status HTTP/1.1
|
-- |_ www.example.com:80 GET /server-status HTTP/1.1
|
||||||
--
|
--
|
||||||
-- @xmloutput
|
-- @xmloutput
|
||||||
@@ -39,8 +39,8 @@ References:
|
|||||||
-- <elem key="Server Built">Jul 24 2015 15:59:00</elem>
|
-- <elem key="Server Built">Jul 24 2015 15:59:00</elem>
|
||||||
-- <elem key="Server Uptime">59 minutes 26 seconds</elem>
|
-- <elem key="Server Uptime">59 minutes 26 seconds</elem>
|
||||||
-- <elem key="Server Load">0.01 0.02 0.05</elem>
|
-- <elem key="Server Load">0.01 0.02 0.05</elem>
|
||||||
-- <table key="Requests">
|
-- <table key="VHosts">
|
||||||
-- <elem>www.example.com:80	GET /server-status HTTP/1.1</elem>
|
-- <elem>www.example.com:80</elem>
|
||||||
-- </table>
|
-- </table>
|
||||||
|
|
||||||
author = "Eric Gershman"
|
author = "Eric Gershman"
|
||||||
@@ -78,21 +78,21 @@ action = function(host, port)
|
|||||||
result["Server Uptime"] = string.match(response.body, "Server%suptime:%s*([^<]*)</")
|
result["Server Uptime"] = string.match(response.body, "Server%suptime:%s*([^<]*)</")
|
||||||
result["Server Load"] = string.match(response.body, "Server%sload:%s*([^<]*)</")
|
result["Server Load"] = string.match(response.body, "Server%sload:%s*([^<]*)</")
|
||||||
|
|
||||||
result.Requests = {}
|
result.VHosts = {}
|
||||||
local uniq_requests = {}
|
local uniq_requests = {}
|
||||||
|
|
||||||
-- Parse the Apache client requests into the result table
|
-- Parse the Apache client requests into the result table
|
||||||
for line in string.gmatch(response.body, "<td nowrap>.-</td></tr>") do
|
for line in string.gmatch(response.body, "<td nowrap>.-</td></tr>") do
|
||||||
-- skip line if the request is empty
|
-- skip line if the request is empty
|
||||||
if not string.match(line, "<td%snowrap></td><td%snowrap></td></tr>") then
|
if not string.match(line, "<td%snowrap></td><td%snowrap></td></tr>") then
|
||||||
local request = string.match(line, ">([^<]*)</td><td") .. "\t" .. string.match(line, ">([^<]*)</td></tr>")
|
local vhost = string.match(line, ">([^<]*)</td><td")
|
||||||
uniq_requests[request] = 1
|
uniq_requests[vhost] = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for request,count in pairs(uniq_requests) do
|
for request,count in pairs(uniq_requests) do
|
||||||
table.insert(result.Requests,request)
|
table.insert(result.VHosts,request)
|
||||||
end
|
end
|
||||||
table.sort(result.Requests)
|
table.sort(result.VHosts)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ Entry { filename = "hostmap-robtex.nse", categories = { "discovery", "external",
|
|||||||
Entry { filename = "http-adobe-coldfusion-apsa1301.nse", categories = { "exploit", "vuln", } }
|
Entry { filename = "http-adobe-coldfusion-apsa1301.nse", categories = { "exploit", "vuln", } }
|
||||||
Entry { filename = "http-affiliate-id.nse", categories = { "discovery", "safe", } }
|
Entry { filename = "http-affiliate-id.nse", categories = { "discovery", "safe", } }
|
||||||
Entry { filename = "http-apache-negotiation.nse", categories = { "discovery", "safe", } }
|
Entry { filename = "http-apache-negotiation.nse", categories = { "discovery", "safe", } }
|
||||||
|
Entry { filename = "http-apache-server-status.nse", categories = { "discovery", "safe", } }
|
||||||
Entry { filename = "http-auth-finder.nse", categories = { "discovery", "safe", } }
|
Entry { filename = "http-auth-finder.nse", categories = { "discovery", "safe", } }
|
||||||
Entry { filename = "http-auth.nse", categories = { "auth", "default", "safe", } }
|
Entry { filename = "http-auth.nse", categories = { "auth", "default", "safe", } }
|
||||||
Entry { filename = "http-avaya-ipoffice-users.nse", categories = { "exploit", "vuln", } }
|
Entry { filename = "http-avaya-ipoffice-users.nse", categories = { "exploit", "vuln", } }
|
||||||
|
|||||||
Reference in New Issue
Block a user