From adcf88761d228dd8c4e05bb1b1ac8bf87578d39b Mon Sep 17 00:00:00 2001 From: James Lee Date: Tue, 31 Mar 2015 13:07:09 -0500 Subject: [PATCH] Save ref names for easier debugging --- lib/msf/core/db_manager/exploit_attempt.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/db_manager/exploit_attempt.rb b/lib/msf/core/db_manager/exploit_attempt.rb index 5e0e2091d4..e1782ea668 100644 --- a/lib/msf/core/db_manager/exploit_attempt.rb +++ b/lib/msf/core/db_manager/exploit_attempt.rb @@ -118,15 +118,17 @@ module Msf::DBManager::ExploitAttempt username = opts.delete(:username) mname = opts.delete(:module) - if not vuln - # Create a references map from the module list - ref_objs = ::Mdm::Ref.where(:name => mrefs.map { |ref| + if ! vuln.nil? + ref_names = mrefs.map { |ref| if ref.respond_to?(:ctx_id) and ref.respond_to?(:ctx_val) "#{ref.ctx_id}-#{ref.ctx_val}" else ref.to_s end - }) + } + + # Create a references map from the module list + ref_objs = ::Mdm::Ref.where(name: ref_names) # Try find a matching vulnerability vuln = find_vuln_by_refs(ref_objs, host, svc)