1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

Actually produce full XML output with vulns.short. Fixes #1472

This commit is contained in:
dmiller
2019-02-15 20:36:13 +00:00
parent 98ab8c298b
commit 143fe3fec3

View File

@@ -1819,15 +1819,14 @@ local format_vuln_base = function(vuln_table, showall)
or "", STATE_MSG[vuln_table.state])
return nil
end
if SHORT_OUTPUT then
return {("%s %s %s"):format(
vuln_table.host.targetname or vuln_table.host.ip,
STATE_MSG[vuln_table.state],
vuln_table.IDS.CVE or vuln_table.title
)}
end
local output_table = stdnse.output_table()
local out = {}
if SHORT_OUTPUT then
-- Don't waste time/space inserting anything
setmetatable(out, {
__newindex = function () return nil end
})
end
output_table.title = vuln_table.title
insert(out, vuln_table.title)
output_table.state = STATE_MSG[vuln_table.state]
@@ -1955,6 +1954,13 @@ local format_vuln_base = function(vuln_table, showall)
end
end
if SHORT_OUTPUT then
out = {("%s %s %s"):format(
vuln_table.host.targetname or vuln_table.host.ip,
STATE_MSG[vuln_table.state],
vuln_table.IDS.CVE or vuln_table.title
)}
end
return out, output_table
end