1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-06 06:29:03 +00:00

Whitespace in hbase-* hadoop-*.

This commit is contained in:
david
2012-01-14 01:03:18 +00:00
parent 86c042302f
commit de0f92ea9a
7 changed files with 181 additions and 181 deletions

View File

@@ -10,7 +10,7 @@ Information gathered:
* Average load
* Zookeeper quorum server
* Associated region servers
For more information about Hbase, see:
* http://hbase.apache.org/
* http://wiki.apache.org/hadoop/Hbase
@@ -22,7 +22,7 @@ For more information about Hbase, see:
-- nmap --script hbase-master-info -p 60010 host
--
-- @output
-- | hbase-master-info:
-- | hbase-master-info:
-- | Hbase Version: 0.90.1
-- | Hbase Compiled: Wed May 11 22:33:44 PDT 2011, bob
-- | HBase Root Directory: hdfs://master.example.com:8020/hbase
@@ -53,65 +53,65 @@ end
action = function( host, port )
local result = {}
local result = {}
local region_servers = {}
local uri = "/master.jsp"
stdnse.print_debug(1, ("%s:HTTP GET %s:%s%s"):format(SCRIPT_NAME, host.targetname or host.ip, port.number, uri))
local response = http.get( host.targetname or host.ip, port.number, uri )
stdnse.print_debug(1, ("%s: Status %s"):format(SCRIPT_NAME,response['status-line'] or "No Response"))
stdnse.print_debug(1, ("%s: Status %s"):format(SCRIPT_NAME,response['status-line'] or "No Response"))
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))
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,body))
port.version.name = "hbase-master"
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))
table.insert(result, ("Hbase Version: %s"):format(version))
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))
table.insert(result, ("Hbase Version: %s"):format(version))
port.version.version = version
end
if body:match("HBase%s+Compiled</td><td>([^][<]+)") then
local compiled = body:match("HBase%s+Compiled</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Hbase Compiled %s"):format(SCRIPT_NAME,compiled))
table.insert(result, ("Hbase Compiled: %s"):format(compiled))
end
if body:match("Directory</td><td>([^][<]+)") then
local compiled = body:match("Directory</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: HBase RootDirectory %s"):format(SCRIPT_NAME,compiled))
table.insert(result, ("HBase Root Directory: %s"):format(compiled))
end
if body:match("Hadoop%s+Version</td><td>([^][<]+)") then
local version = body:match("Hadoop%s+Version</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Hadoop Version %s"):format(SCRIPT_NAME,version))
table.insert(result, ("Hadoop Version: %s"):format(version))
end
if body:match("Hadoop%s+Compiled</td><td>([^][<]+)") then
local compiled = body:match("Hadoop%s+Compiled</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Hadoop Compiled %s"):format(SCRIPT_NAME,compiled))
table.insert(result, ("Hadoop Compiled: %s"):format(compiled))
end
if body:match("average</td><td>([^][<]+)") then
local average = body:match("average</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Average Load %s"):format(SCRIPT_NAME,average))
table.insert(result, ("Average Load: %s"):format(average))
end
if body:match("Quorum</td><td>([^][<]+)") then
local quorum = body:match("Quorum</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Zookeeper Quorum %s"):format(SCRIPT_NAME,quorum))
table.insert(result, ("Zookeeper Quorum: %s"):format(quorum))
end
if body:match("HBase%s+Compiled</td><td>([^][<]+)") then
local compiled = body:match("HBase%s+Compiled</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Hbase Compiled %s"):format(SCRIPT_NAME,compiled))
table.insert(result, ("Hbase Compiled: %s"):format(compiled))
end
if body:match("Directory</td><td>([^][<]+)") then
local compiled = body:match("Directory</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: HBase RootDirectory %s"):format(SCRIPT_NAME,compiled))
table.insert(result, ("HBase Root Directory: %s"):format(compiled))
end
if body:match("Hadoop%s+Version</td><td>([^][<]+)") then
local version = body:match("Hadoop%s+Version</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Hadoop Version %s"):format(SCRIPT_NAME,version))
table.insert(result, ("Hadoop Version: %s"):format(version))
end
if body:match("Hadoop%s+Compiled</td><td>([^][<]+)") then
local compiled = body:match("Hadoop%s+Compiled</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Hadoop Compiled %s"):format(SCRIPT_NAME,compiled))
table.insert(result, ("Hadoop Compiled: %s"):format(compiled))
end
if body:match("average</td><td>([^][<]+)") then
local average = body:match("average</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Average Load %s"):format(SCRIPT_NAME,average))
table.insert(result, ("Average Load: %s"):format(average))
end
if body:match("Quorum</td><td>([^][<]+)") then
local quorum = body:match("Quorum</td><td>([^][<]+)"):gsub("%s+", " ")
stdnse.print_debug(1, ("%s: Zookeeper Quorum %s"):format(SCRIPT_NAME,quorum))
table.insert(result, ("Zookeeper Quorum: %s"):format(quorum))
if target.ALLOW_NEW_TARGETS then
if quorum:match("([%w%.]+)") then
local newtarget = quorum:match("([%w%.]+)")
stdnse.print_debug(1, ("%s: Added target: %s"):format(SCRIPT_NAME, newtarget))
local status,err = target.add(newtarget)
end
if quorum:match("([%w%.]+)") then
local newtarget = quorum:match("([%w%.]+)")
stdnse.print_debug(1, ("%s: Added target: %s"):format(SCRIPT_NAME, newtarget))
local status,err = target.add(newtarget)
end
end
end
end
for line in string.gmatch(body, "[^\n]+") do
stdnse.print_debug(3, ("%s: Line %s\n"):format(SCRIPT_NAME,line))
if line:match("maxHeap") then
local region_server= line:match("\">([^][<]+)</a>")
stdnse.print_debug(1, ("%s: Region Server %s"):format(SCRIPT_NAME,region_server))
stdnse.print_debug(3, ("%s: Line %s\n"):format(SCRIPT_NAME,line))
if line:match("maxHeap") then
local region_server= line:match("\">([^][<]+)</a>")
stdnse.print_debug(1, ("%s: Region Server %s"):format(SCRIPT_NAME,region_server))
table.insert(region_servers, region_server)
if target.ALLOW_NEW_TARGETS then
if region_server:match("([%w%.]+)") then