mirror of
https://github.com/nmap/nmap.git
synced 2025-12-11 02:09:03 +00:00
Actually produce full XML output with vulns.short. Fixes #1472
This commit is contained in:
@@ -1819,15 +1819,14 @@ local format_vuln_base = function(vuln_table, showall)
|
|||||||
or "", STATE_MSG[vuln_table.state])
|
or "", STATE_MSG[vuln_table.state])
|
||||||
return nil
|
return nil
|
||||||
end
|
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 output_table = stdnse.output_table()
|
||||||
local out = {}
|
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
|
output_table.title = vuln_table.title
|
||||||
insert(out, vuln_table.title)
|
insert(out, vuln_table.title)
|
||||||
output_table.state = STATE_MSG[vuln_table.state]
|
output_table.state = STATE_MSG[vuln_table.state]
|
||||||
@@ -1955,6 +1954,13 @@ local format_vuln_base = function(vuln_table, showall)
|
|||||||
end
|
end
|
||||||
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
|
return out, output_table
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user