diff --git a/scripts/http-hp-ilo-info.nse b/scripts/http-hp-ilo-info.nse index e39ef02b3..1113bc15a 100644 --- a/scripts/http-hp-ilo-info.nse +++ b/scripts/http-hp-ilo-info.nse @@ -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"], '') == 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('') + or not response.body:match('iLO') + then + return + end + local domtable = slaxml.parseDOM(response["body"],{stripWhitespace=true}) + return parseXML(domtable) end