1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-03 05:09:14 +00:00

Don't set_port_version just from a 200 response.

Require a more positive page body match before doing that.
http://seclists.org/nmap-dev/2013/q1/304
This commit is contained in:
david
2013-03-05 21:20:45 +00:00
parent 5edcec7a9a
commit 3150d2fff6
8 changed files with 38 additions and 24 deletions

View File

@@ -62,8 +62,6 @@ action = function( host, port )
if response['status-line'] and response['status-line']:match("200%s+OK") and response['body'] then
local body = response['body']:gsub("%%","%%%%")
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,body))
port.version.name = "hbase-region"
port.version.product = "Apache Hadoop Hbase"
if body:match("HBase%s+Version</td><td>([^][<]+)") then
local version = body:match("HBase%s+Version</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s:Hbase Version %s"):format(SCRIPT_NAME,version))
@@ -92,7 +90,11 @@ action = function( host, port )
end
end
end
nmap.set_port_version(host, port)
if #result > 0 then
port.version.name = "hbase-region"
port.version.product = "Apache Hadoop Hbase"
nmap.set_port_version(host, port)
end
return stdnse.format_output(true, result)
end
end