1
0
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:
dmiller
2019-04-13 21:42:56 +00:00
parent 8d7a2bc004
commit ef132f2f24

View File

@@ -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