1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Let mcafee-epo-agent match newer agent replies with looser pattern

This commit is contained in:
dmiller
2015-11-06 19:40:07 +00:00
parent f4619edece
commit 60baf397e1

View File

@@ -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 .. ">([^<]*)</" .. 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('<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="FrameworkLog.xsl"?><naLog>') then
if data.body:match('^<%?xml .*%?>%s*<naLog>') then
port.version.hostname = ExtractXMLElement(data.body, "ComputerName")
epoServerName = ExtractXMLElement(data.body, "ePOServerName") or ""
port.version.version = ExtractXMLElement(data.body, "version") or ""