Hello,
We use the following Nmap NSE script to identify HTTP services[1]:
author = "Marc Ruef"
license = "(c) 2010 by Marc Ruef"
version = "1.0"
categories = {"default", "safe", "scip"}
require("http")
description = [[]]
portrule = function(host, port)
if port.service == "http" and port.service ~= "ssl/http" and port.service ~= "https" and port.version.service_tunnel ~= "ssl" then
return true
elseif port.protocol == "tcp" and (port.number == 80 or port.number == 81) then
return true
else
return false
end
end
action = function(host, port)
local response = http.get(host, port, "/")
if response.rawheader ~= nil then
sOutput = "Header:\n\n" .. stdnse.format_output(true, response.rawheader)
elseif response.body ~= nil then
if response.body ~= "" then
sOutput = "Body:\n\n" .. response.body
else
sOutput = ""
end
else
sOutput = "It was not possible to fetch a resource with a common http get request. This might be a false positive."
end
return sOutput
end
If you save this script in the scripts folder of your Nmap installation as webdetect.nse, you might want to use nmap -sS -sV --script=webdetect <target> to identify http servcies as quickly and accurate as possible.
Regards,
Marc
[1] http://www.scip.ch/?labs.20101119