mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Clean up response matching and avoid requiring string lib
This commit is contained in:
parent
8d7a2bc004
commit
ef132f2f24
1 changed files with 10 additions and 9 deletions
|
|
@ -107,13 +107,14 @@ function parseXML(dom)
|
|||
end
|
||||
|
||||
action = function(host,port)
|
||||
local response = http.get(host,port,"/xmldata?item=all")
|
||||
if response["status"] ~= 200
|
||||
or string.match(response["body"], '<RIMP>') == nil
|
||||
or string.match(response["body"], 'iLO') == nil
|
||||
then
|
||||
return
|
||||
end
|
||||
local domtable = slaxml.parseDOM(response["body"],{stripWhitespace=true})
|
||||
return parseXML(domtable)
|
||||
local response = http.get(host,port,"/xmldata?item=all")
|
||||
if response["status"] ~= 200
|
||||
or not response.body
|
||||
or not response.body:match('<RIMP>')
|
||||
or not response.body:match('iLO')
|
||||
then
|
||||
return
|
||||
end
|
||||
local domtable = slaxml.parseDOM(response["body"],{stripWhitespace=true})
|
||||
return parseXML(domtable)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue