mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Whitespace in hbase-* hadoop-*.
This commit is contained in:
@@ -38,22 +38,22 @@ end
|
||||
|
||||
action = function( host, port )
|
||||
|
||||
local result = {}
|
||||
local result = {}
|
||||
local uri = "/browseDirectory.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"))
|
||||
if response['status-line'] and response['status-line']:match("200%s+OK") and response['body'] then
|
||||
port.version.name = "hadoop-datanode"
|
||||
port.version.product = "Apache Hadoop"
|
||||
port.version.product = "Apache Hadoop"
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
local body = response['body']:gsub("%%","%%%%")
|
||||
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,body))
|
||||
if body:match("([^][\"]+)\">Log") then
|
||||
local logs = body:match("([^][\"]+)\">Log")
|
||||
stdnse.print_debug(1, ("%s: Logs %s"):format(SCRIPT_NAME,logs))
|
||||
table.insert(result, ("Logs: %s"):format(logs))
|
||||
end
|
||||
local logs = body:match("([^][\"]+)\">Log")
|
||||
stdnse.print_debug(1, ("%s: Logs %s"):format(SCRIPT_NAME,logs))
|
||||
table.insert(result, ("Logs: %s"):format(logs))
|
||||
end
|
||||
return stdnse.format_output(true, result)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,7 +55,7 @@ portrule = function(host, port)
|
||||
end
|
||||
|
||||
get_userhistory = function( host, port )
|
||||
local results = {}
|
||||
local results = {}
|
||||
local uri = "/jobhistory.jsp?pageno=-1&search="
|
||||
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 )
|
||||
@@ -76,7 +76,7 @@ get_userhistory = function( host, port )
|
||||
return results
|
||||
end
|
||||
get_tasktrackers = function( host, port )
|
||||
local results = {}
|
||||
local results = {}
|
||||
local uri = "/machines.jsp?type=active"
|
||||
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 )
|
||||
@@ -95,7 +95,7 @@ get_tasktrackers = function( host, port )
|
||||
stdnse.print_debug(1, ("%s: Added target: %s"):format(SCRIPT_NAME, newtarget))
|
||||
local status,err = target.add(newtarget)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -103,7 +103,7 @@ get_tasktrackers = function( host, port )
|
||||
end
|
||||
action = function( host, port )
|
||||
|
||||
local result = {}
|
||||
local result = {}
|
||||
local uri = "/jobtracker.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 )
|
||||
@@ -111,7 +111,7 @@ action = function( host, port )
|
||||
if response['status-line'] and response['status-line']:match("200%s+OK") and response['body'] then
|
||||
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,response['body']))
|
||||
port.version.name = "hadoop-jobtracker"
|
||||
port.version.product = "Apache Hadoop"
|
||||
port.version.product = "Apache Hadoop"
|
||||
if response['body']:match("State:</b>%s*([^][<]+)") then
|
||||
local state = response['body']:match("State:</b>%s*([^][<]+)")
|
||||
stdnse.print_debug(1, ("%s: State %s"):format(SCRIPT_NAME,state))
|
||||
@@ -146,14 +146,14 @@ action = function( host, port )
|
||||
table.insert(result, ("Log Files: %s"):format(logfiles))
|
||||
end
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
local tasktrackers = get_tasktrackers (host, port)
|
||||
local tasktrackers = get_tasktrackers (host, port)
|
||||
table.insert(result, "Tasktrackers: ")
|
||||
table.insert(result, tasktrackers)
|
||||
if stdnse.get_script_args('hadoop-jobtracker-info.userinfo') then
|
||||
local userhistory = get_userhistory (host, port)
|
||||
local userhistory = get_userhistory (host, port)
|
||||
table.insert(result, "Userhistory: ")
|
||||
table.insert(result, userhistory)
|
||||
end
|
||||
end
|
||||
return stdnse.format_output(true, result)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -81,7 +81,7 @@ end
|
||||
|
||||
action = function( host, port )
|
||||
|
||||
local result = {}
|
||||
local result = {}
|
||||
local uri = "/dfshealth.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 )
|
||||
@@ -91,7 +91,7 @@ action = function( host, port )
|
||||
local capacity = {}
|
||||
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,body))
|
||||
port.version.name = "hadoop-namenode"
|
||||
port.version.product = "Apache Hadoop"
|
||||
port.version.product = "Apache Hadoop"
|
||||
if body:match("Started:%s*<td>([^][<]+)") then
|
||||
local start = body:match("Started:%s*<td>([^][<]+)")
|
||||
stdnse.print_debug(1, ("%s: Started %s"):format(SCRIPT_NAME,start))
|
||||
@@ -133,7 +133,7 @@ action = function( host, port )
|
||||
table.insert(result,"Total\tUsed (DFS)\tUsed (Non DFS)\tRemaining")
|
||||
table.insert(result, ("%s\t%s\t%s\t%s"):format(capacity[3],capacity[4],capacity[5],capacity[6]))
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
local datanodes_live = get_datanodes(host,port, "LIVE")
|
||||
local datanodes_live = get_datanodes(host,port, "LIVE")
|
||||
table.insert(result, "Datanodes (Live): ")
|
||||
table.insert(result, datanodes_live)
|
||||
local datanodes_dead = get_datanodes(host,port, "DEAD")
|
||||
|
||||
@@ -52,7 +52,7 @@ end
|
||||
|
||||
action = function( host, port )
|
||||
|
||||
local result = {}
|
||||
local result = {}
|
||||
local uri = "/status.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 )
|
||||
@@ -62,9 +62,9 @@ action = function( host, port )
|
||||
local stats = {}
|
||||
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,body))
|
||||
port.version.name = "hadoop-secondary-namenode"
|
||||
port.version.product = "Apache Hadoop"
|
||||
port.version.product = "Apache Hadoop"
|
||||
-- Page isn't valid html :(
|
||||
for i in string.gmatch(body,"\n[%w%s]+:%s+[^][\n]+") do
|
||||
for i in string.gmatch(body,"\n[%w%s]+:%s+[^][\n]+") do
|
||||
table.insert(stats,i:match(":%s+([^][\n]+)"))
|
||||
end
|
||||
stdnse.print_debug(1, ("%s: namenode %s"):format(SCRIPT_NAME,stats[1]))
|
||||
@@ -84,11 +84,11 @@ action = function( host, port )
|
||||
stdnse.print_debug(1, ("%s: Compiled %s"):format(SCRIPT_NAME,compiled))
|
||||
table.insert(result, ("Compiled: %s"):format(compiled))
|
||||
end
|
||||
if body:match("([^][\"]+)\">Logs") then
|
||||
local logs = body:match("([^][\"]+)\">Logs")
|
||||
stdnse.print_debug(1, ("%s: Logs %s"):format(SCRIPT_NAME,logs))
|
||||
table.insert(result, ("Logs: %s"):format(logs))
|
||||
end
|
||||
if body:match("([^][\"]+)\">Logs") then
|
||||
local logs = body:match("([^][\"]+)\">Logs")
|
||||
stdnse.print_debug(1, ("%s: Logs %s"):format(SCRIPT_NAME,logs))
|
||||
table.insert(result, ("Logs: %s"):format(logs))
|
||||
end
|
||||
table.insert(result, ("Namenode: %s"):format(stats[1]))
|
||||
table.insert(result, ("Last Checkpoint: %s"):format(stats[3]))
|
||||
table.insert(result, ("Checkpoint Period: %s"):format(stats[4]))
|
||||
|
||||
@@ -42,7 +42,7 @@ end
|
||||
|
||||
action = function( host, port )
|
||||
|
||||
local result = {}
|
||||
local result = {}
|
||||
local uri = "/tasktracker.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 )
|
||||
@@ -51,25 +51,25 @@ action = function( host, port )
|
||||
local body = response['body']:gsub("%%","%%%%")
|
||||
stdnse.print_debug(2, ("%s: Body %s\n"):format(SCRIPT_NAME,body))
|
||||
port.version.name = "hadoop-tasktracker"
|
||||
port.version.product = "Apache Hadoop"
|
||||
port.version.product = "Apache Hadoop"
|
||||
if response['body']:match("Version:</b>%s*([^][<]+)") then
|
||||
local version = response['body']:match("Version:</b>%s*([^][<]+)")
|
||||
local versionNo = version:match("([^][,]+)")
|
||||
local versionHash = version:match("[^][,]+%s+(%w+)")
|
||||
stdnse.print_debug(1, ("%s: Version %s (%s)"):format(SCRIPT_NAME,versionNo,versionHash))
|
||||
table.insert(result, ("Version: %s (%s)"):format(versionNo,versionHash))
|
||||
local version = response['body']:match("Version:</b>%s*([^][<]+)")
|
||||
local versionNo = version:match("([^][,]+)")
|
||||
local versionHash = version:match("[^][,]+%s+(%w+)")
|
||||
stdnse.print_debug(1, ("%s: Version %s (%s)"):format(SCRIPT_NAME,versionNo,versionHash))
|
||||
table.insert(result, ("Version: %s (%s)"):format(versionNo,versionHash))
|
||||
port.version.version = version
|
||||
end
|
||||
if response['body']:match("Compiled:</b>%s*([^][<]+)") then
|
||||
local compiled = response['body']:match("Compiled:</b>%s*([^][<]+)"):gsub("%s+", " ")
|
||||
stdnse.print_debug(1, ("%s: Compiled %s"):format(SCRIPT_NAME,compiled))
|
||||
table.insert(result, ("Compiled: %s"):format(compiled))
|
||||
end
|
||||
end
|
||||
if response['body']:match("Compiled:</b>%s*([^][<]+)") then
|
||||
local compiled = response['body']:match("Compiled:</b>%s*([^][<]+)"):gsub("%s+", " ")
|
||||
stdnse.print_debug(1, ("%s: Compiled %s"):format(SCRIPT_NAME,compiled))
|
||||
table.insert(result, ("Compiled: %s"):format(compiled))
|
||||
end
|
||||
if body:match("([^][\"]+)\">Log") then
|
||||
local logs = body:match("([^][\"]+)\">Log")
|
||||
stdnse.print_debug(1, ("%s: Logs %s"):format(SCRIPT_NAME,logs))
|
||||
table.insert(result, ("Logs: %s"):format(logs))
|
||||
end
|
||||
local logs = body:match("([^][\"]+)\">Log")
|
||||
stdnse.print_debug(1, ("%s: Logs %s"):format(SCRIPT_NAME,logs))
|
||||
table.insert(result, ("Logs: %s"):format(logs))
|
||||
end
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
return stdnse.format_output(true, result)
|
||||
end
|
||||
|
||||
@@ -53,7 +53,7 @@ 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))
|
||||
@@ -63,54 +63,54 @@ action = function( host, port )
|
||||
local body = response['body']:gsub("%%","%%%%")
|
||||
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(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
|
||||
|
||||
@@ -47,7 +47,7 @@ end
|
||||
|
||||
action = function( host, port )
|
||||
|
||||
local result = {}
|
||||
local result = {}
|
||||
local region_servers = {}
|
||||
local uri = "/regionserver.jsp"
|
||||
stdnse.print_debug(1, ("%s:HTTP GET %s:%s%s"):format(SCRIPT_NAME, host.targetname or host.ip, port.number, uri))
|
||||
@@ -57,35 +57,35 @@ action = function( host, port )
|
||||
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))
|
||||
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("Metrics</td><td>([^][<]+)") then
|
||||
local metrics = body:match("Metrics</td><td>([^][<]+)"):gsub("%s+", " ")
|
||||
stdnse.print_debug(1, ("%s: Metrics %s"):format(SCRIPT_NAME,metrics))
|
||||
table.insert(result, ("Metrics %s"):format(metrics))
|
||||
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("Metrics</td><td>([^][<]+)") then
|
||||
local metrics = body:match("Metrics</td><td>([^][<]+)"):gsub("%s+", " ")
|
||||
stdnse.print_debug(1, ("%s: Metrics %s"):format(SCRIPT_NAME,metrics))
|
||||
table.insert(result, ("Metrics %s"):format(metrics))
|
||||
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
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
return stdnse.format_output(true, result)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user