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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user