mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Clean up response matching and avoid requiring string lib
This commit is contained in:
@@ -107,13 +107,14 @@ function parseXML(dom)
|
|||||||
end
|
end
|
||||||
|
|
||||||
action = function(host,port)
|
action = function(host,port)
|
||||||
local response = http.get(host,port,"/xmldata?item=all")
|
local response = http.get(host,port,"/xmldata?item=all")
|
||||||
if response["status"] ~= 200
|
if response["status"] ~= 200
|
||||||
or string.match(response["body"], '<RIMP>') == nil
|
or not response.body
|
||||||
or string.match(response["body"], 'iLO') == nil
|
or not response.body:match('<RIMP>')
|
||||||
then
|
or not response.body:match('iLO')
|
||||||
return
|
then
|
||||||
end
|
return
|
||||||
local domtable = slaxml.parseDOM(response["body"],{stripWhitespace=true})
|
end
|
||||||
return parseXML(domtable)
|
local domtable = slaxml.parseDOM(response["body"],{stripWhitespace=true})
|
||||||
|
return parseXML(domtable)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user