Sha256: 013861733050b30e5101c71c5da06043f99e03ad4ad88346381f2182c13e35ca
Contents?: true
Size: 1.6 KB
Versions: 32
Compression:
Stored size: 1.6 KB
Contents
# Matches {#matchable} {Mdm::Service} or {Mdm::Vuln} to a {#module_detail Metasploit Module} that can exploit it. class MetasploitDataModels::AutomaticExploitation::Match < ActiveRecord::Base # # Associations # # A (polymorphic) "matchable" entity like a {Mdm::Vuln} or {Mdm::Service} # # @return [Mdm::Service, Mdm::Vuln] belongs_to :matchable, polymorphic: true # The {MatchSet} this match is part of has_many :match_results, class_name: 'MetasploitDataModels::AutomaticExploitation::MatchResult', inverse_of: :match # The {MatchSet} this match is part of belongs_to :match_set, class_name: 'MetasploitDataModels::AutomaticExploitation::MatchSet', inverse_of: :matches # The Metasploit Module that this match connects to belongs_to :module_detail, class_name: 'Mdm::Module::Detail', foreign_key: :module_fullname, primary_key: :fullname # Scope a match to a MetasploitDataModels::AutomaticExploitation::Run scope :by_run_and_vuln, ->(run,vuln){ joins( MetasploitDataModels::AutomaticExploitation::Match.join_association(:match_set), MetasploitDataModels::AutomaticExploitation::MatchSet.join_association(:runs) ).where( MetasploitDataModels::AutomaticExploitation::Run[:id].eq(run.id) ).where( MetasploitDataModels::AutomaticExploitation::Match[:matchable_id].eq(vuln.id), MetasploitDataModels::AutomaticExploitation::Match[:matchable_type].eq("Mdm::Vuln") ) } Metasploit::Concern.run(self) end
Version data entries
32 entries across 32 versions & 1 rubygems