Rework vuln lookup logic to account for vuln with no service (nexpose import vuln with -1 port)
MSP-13234bug/bundler_fix
parent
e88a14aee6
commit
0bb03db786
|
@ -165,7 +165,7 @@ module Exploit
|
|||
self.error = e
|
||||
|
||||
# Record the detailed reason
|
||||
self.exploit.fail_detail ||= e.to_s
|
||||
self.fail_detail ||= e.to_s
|
||||
msg
|
||||
end
|
||||
|
||||
|
@ -175,9 +175,6 @@ module Exploit
|
|||
def handle_exception e
|
||||
msg = setup_fail_detail_from_exception e
|
||||
|
||||
require 'pry'
|
||||
binding.pry
|
||||
|
||||
case e
|
||||
when Msf::Exploit::Complete
|
||||
# Nothing to show in this case
|
||||
|
@ -235,8 +232,6 @@ module Exploit
|
|||
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
|
||||
end
|
||||
|
||||
|
||||
|
||||
# Record the error to various places
|
||||
self.framework.events.on_module_error(self, msg)
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ module Msf::DBManager::ExploitAttempt
|
|||
username = opts[:username]
|
||||
mname = opts[:module]
|
||||
|
||||
|
||||
if vuln.nil?
|
||||
ref_names = mrefs.map { |ref|
|
||||
if ref.respond_to?(:ctx_id) and ref.respond_to?(:ctx_val)
|
||||
|
|
|
@ -46,7 +46,8 @@ module Msf::DBManager::Vuln
|
|||
|
||||
def find_vuln_by_refs(refs, host, service=nil)
|
||||
ref_ids = refs.find_all { |ref| ref.name.starts_with? 'CVE-'}
|
||||
host.vulns.includes(:refs).where(service_id: service.try(:id), refs: { id: ref_ids}).first
|
||||
relation = host.vulns.includes(:refs)
|
||||
relation.where(service_id: service.try(:id), refs: { id: ref_ids}).first || relation.where(refs: { id: ref_ids}).first
|
||||
end
|
||||
|
||||
def get_vuln(wspace, host, service, name, data='')
|
||||
|
|
|
@ -1260,7 +1260,6 @@ class Exploit < Msf::Module
|
|||
end
|
||||
|
||||
def report_failure
|
||||
|
||||
return unless framework.db and framework.db.active
|
||||
|
||||
info = {
|
||||
|
@ -1293,6 +1292,7 @@ class Exploit < Msf::Module
|
|||
)
|
||||
end
|
||||
|
||||
|
||||
framework.db.report_exploit_failure(info)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue