Fix report_vuln duplicate VulnRef record creation

Multiple calls to report_vuln for the same vuln results in the creation
of duplicate VulnRef records, except for the CVE refs
GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-03-16 17:53:07 -04:00
parent f365e6fc28
commit fc83220aa7
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ module Msf::DBManager::Vuln
def find_vuln_by_refs(refs, host, service=nil)
ref_ids = refs.find_all { |ref| ref.name.starts_with? 'CVE-'}
relation = host.vulns.includes(:refs)
relation = host.vulns.joins(:refs)
if !service.try(:id).nil?
return relation.where(service_id: service.try(:id), refs: { id: ref_ids}).first
end