Land #13903, Allow OpenVAS handler to import vulns without references

This commit is contained in:
gwillcox-r7 2020-08-03 11:59:58 -05:00
commit 2fe92f9325
No known key found for this signature in database
GPG Key ID: D35E05C0F2B81E83
1 changed files with 13 additions and 20 deletions

View File

@ -138,34 +138,27 @@ module Parser
return
end
references = []
if @state[:cves] and @state[:cves] != "NOCVE" and !@state[:cves].empty?
@state[:cves].split(',').each do |cve|
vuln_info = {}
vuln_info[:host] = @state[:host]
vuln_info[:refs] = normalize_references([{ :source => "CVE", :value => cve}])
vuln_info[:name] = @state[:vuln_name]
vuln_info[:info] = @state[:vuln_desc]
vuln_info[:port] = @state[:port]
vuln_info[:proto] = @state[:proto]
vuln_info[:workspace] = @args[:workspace]
db_report(:vuln, vuln_info)
references.append({ :source => "CVE", :value => cve})
end
end
if @state[:bid] and @state[:bid] != "NOBID" and !@state[:bid].empty?
@state[:bid].split(',').each do |bid|
vuln_info = {}
vuln_info[:host] = @state[:host]
vuln_info[:refs] = normalize_references([{ :source => "BID", :value => bid}])
vuln_info[:name] = @state[:vuln_name]
vuln_info[:info] = @state[:vuln_desc]
vuln_info[:port] = @state[:port]
vuln_info[:proto] = @state[:proto]
vuln_info[:workspace] = @args[:workspace]
db_report(:vuln, vuln_info)
references.append({ :source => "BID", :value => bid})
end
end
vuln_info = {}
vuln_info[:host] = @state[:host]
vuln_info[:refs] = normalize_references(references)
vuln_info[:name] = @state[:vuln_name]
vuln_info[:info] = @state[:vuln_desc]
vuln_info[:port] = @state[:port]
vuln_info[:proto] = @state[:proto]
vuln_info[:workspace] = @args[:workspace]
db_report(:vuln, vuln_info)
end
def record_service