1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-22 22:29:03 +00:00

Removed WhiteSpace

This commit is contained in:
gyani
2015-06-14 05:55:58 +00:00
parent 92af09d39c
commit be7e57f80d
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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