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
|
self.error = e
|
||||||
|
|
||||||
# Record the detailed reason
|
# Record the detailed reason
|
||||||
self.exploit.fail_detail ||= e.to_s
|
self.fail_detail ||= e.to_s
|
||||||
msg
|
msg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -175,9 +175,6 @@ module Exploit
|
||||||
def handle_exception e
|
def handle_exception e
|
||||||
msg = setup_fail_detail_from_exception e
|
msg = setup_fail_detail_from_exception e
|
||||||
|
|
||||||
require 'pry'
|
|
||||||
binding.pry
|
|
||||||
|
|
||||||
case e
|
case e
|
||||||
when Msf::Exploit::Complete
|
when Msf::Exploit::Complete
|
||||||
# Nothing to show in this case
|
# Nothing to show in this case
|
||||||
|
@ -235,8 +232,6 @@ module Exploit
|
||||||
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
|
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Record the error to various places
|
# Record the error to various places
|
||||||
self.framework.events.on_module_error(self, msg)
|
self.framework.events.on_module_error(self, msg)
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ module Msf::DBManager::ExploitAttempt
|
||||||
username = opts[:username]
|
username = opts[:username]
|
||||||
mname = opts[:module]
|
mname = opts[:module]
|
||||||
|
|
||||||
|
|
||||||
if vuln.nil?
|
if vuln.nil?
|
||||||
ref_names = mrefs.map { |ref|
|
ref_names = mrefs.map { |ref|
|
||||||
if ref.respond_to?(:ctx_id) and ref.respond_to?(:ctx_val)
|
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)
|
def find_vuln_by_refs(refs, host, service=nil)
|
||||||
ref_ids = refs.find_all { |ref| ref.name.starts_with? 'CVE-'}
|
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
|
end
|
||||||
|
|
||||||
def get_vuln(wspace, host, service, name, data='')
|
def get_vuln(wspace, host, service, name, data='')
|
||||||
|
|
|
@ -1260,7 +1260,6 @@ class Exploit < Msf::Module
|
||||||
end
|
end
|
||||||
|
|
||||||
def report_failure
|
def report_failure
|
||||||
|
|
||||||
return unless framework.db and framework.db.active
|
return unless framework.db and framework.db.active
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
|
@ -1293,6 +1292,7 @@ class Exploit < Msf::Module
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
framework.db.report_exploit_failure(info)
|
framework.db.report_exploit_failure(info)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue