diff --git a/scripts/mcafee-epo-agent.nse b/scripts/mcafee-epo-agent.nse index 0527dc977..7a4a836cb 100644 --- a/scripts/mcafee-epo-agent.nse +++ b/scripts/mcafee-epo-agent.nse @@ -40,10 +40,6 @@ portrule = function(host, port) end end -function string.StartsWith(stringToSearch, stringToFind) - return stringToFind == stringToSearch:sub(1, #stringToFind) -end - function ExtractXMLElement(xmlContent, elementName) return xmlContent:match("<" .. elementName .. ">([^<]*)") end @@ -59,7 +55,7 @@ action = function(host, port) if data.body then stdnse.debug2("data.body:sub = %s", data.body:sub(1, 80)) - if data.body:StartsWith('') then + if data.body:match('^<%?xml .*%?>%s*') then port.version.hostname = ExtractXMLElement(data.body, "ComputerName") epoServerName = ExtractXMLElement(data.body, "ePOServerName") or "" port.version.version = ExtractXMLElement(data.body, "version") or ""