mirror of
https://github.com/nmap/nmap.git
synced 2026-01-22 22:29:03 +00:00
Removed WhiteSpace
This commit is contained in:
@@ -146,7 +146,7 @@ parser = {
|
||||
|
||||
|
||||
local entityMap = { ["lt"]="<", ["gt"]=">", ["amp"]="&", ["quot"]='"', ["apos"]="'" }
|
||||
local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and utf8_enc(tonumber('0'..s)) or orig end
|
||||
local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and utf8_enc(tonumber('0'..s)) or orig end
|
||||
local function unescape(str) return gsub( str, '(&(#?)([%d%a]+);)', entitySwap ) end
|
||||
|
||||
local function finishText()
|
||||
@@ -309,7 +309,7 @@ parser = {
|
||||
|
||||
while pos<#xml do
|
||||
if state=="text" then
|
||||
if not (findPI() or findComment() or findCDATA() or findElementClose()) then
|
||||
if not (findPI() or findComment() or findCDATA() or findElementClose()) then
|
||||
if startElement() then
|
||||
state = "attributes"
|
||||
else
|
||||
|
||||
@@ -96,7 +96,7 @@ function action (host, port)
|
||||
closeElement = function(name) parser._call.text = function() return nil end end
|
||||
}
|
||||
parser:parseSAX(response.body, {stripWhitespace=true})
|
||||
|
||||
|
||||
-- set the port verson
|
||||
port.version.name = "hnap"
|
||||
port.version.name_confidence = 10
|
||||
@@ -104,12 +104,12 @@ function action (host, port)
|
||||
port.version.version = output["Model"] or nil
|
||||
port.version.devicetype = output["Type"] and output["Type"][1] or nil
|
||||
port.version.cpe = port.version.cpe or {}
|
||||
|
||||
|
||||
if output["Vendor"] and output["Model"] then
|
||||
table.insert(port.version.cpe, "cpe:/h:".. output["Vendor"]:lower() .. ":" .. output["Model"]:lower())
|
||||
end
|
||||
nmap.set_port_version(host, port, "hardmatched")
|
||||
|
||||
|
||||
if #output >0 then return output end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user