parent
621af7311c
commit
382e01d680
|
@ -179,19 +179,11 @@ module Msf::DBManager::ExploitAttempt
|
|||
|
||||
end
|
||||
|
||||
# Create a MetasploitDataModels::AutomaticExploitation::Match result for the given vuln
|
||||
# @option opts [Integer] :run_id
|
||||
# @return [void]
|
||||
def create_match_result_for_vuln(vuln, opts)
|
||||
run_id = opts[:run_id]
|
||||
|
||||
# match = MetasploitDataModels::AutomaticExploitation::Match.joins(
|
||||
# MetasploitDataModels::AutomaticExploitation::Match.join_association(:match_set),
|
||||
# MetasploitDataModels::AutomaticExploitation::MatchSet.join_association(:runs)
|
||||
# ).where(
|
||||
# MetasploitDataModels::AutomaticExploitation::Run[:id].eq(run_id)
|
||||
# ).last
|
||||
|
||||
require 'pry'
|
||||
binding.pry
|
||||
|
||||
match = MetasploitDataModels::AutomaticExploitation::Match.by_run_id(run_id).last
|
||||
|
||||
# If no match found for run, create a run if a vuln has a match
|
||||
|
@ -206,6 +198,10 @@ module Msf::DBManager::ExploitAttempt
|
|||
end
|
||||
end
|
||||
|
||||
# Create a MetasploitDataModels::AutomaticExploitation::Match result with a success or failure state
|
||||
# @option opts [MetasploitDataModels::AutomaticExploitation::Match] :match
|
||||
# @option opts [MetasploitDataModels::AutomaticExploitation::Run] :run
|
||||
# @return [void]
|
||||
def create_match_result(opts)
|
||||
if opts[:session_id]
|
||||
state = MetasploitDataModels::AutomaticExploitation::MatchResult::SUCCEEDED
|
||||
|
@ -220,6 +216,11 @@ module Msf::DBManager::ExploitAttempt
|
|||
)
|
||||
end
|
||||
|
||||
# Create a MetasploitDataModels::AutomaticExploitation::Run for the given vuln
|
||||
# @option vuln [Mdm::Vuln] :vuln
|
||||
# @option opts [Mdm::Workspace] :workspace
|
||||
# @option opts [String] :username
|
||||
# @return [ MetasploitDataModels::AutomaticExploitation::Match, MetasploitDataModels::AutomaticExploitation::Run]
|
||||
def create_run_for_vuln(vuln,opts)
|
||||
wspace = opts[:workspace] || workspace
|
||||
username = opts[:username]
|
||||
|
|
|
@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|||
# Metasploit::Credential database models
|
||||
spec.add_runtime_dependency 'metasploit-credential', '1.0.1'
|
||||
# Database models shared between framework and Pro.
|
||||
spec.add_runtime_dependency 'metasploit_data_models', '1.2.5'
|
||||
spec.add_runtime_dependency 'metasploit_data_models', '1.2.7'
|
||||
# depend on metasploit-framewrok as the optional gems are useless with the actual code
|
||||
spec.add_runtime_dependency 'metasploit-framework', "= #{spec.version}"
|
||||
# Needed for module caching in Mdm::ModuleDetails
|
||||
|
|
Loading…
Reference in New Issue