metasploit_data_models 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a832e9ced35288ddac2edbb5e3cd4d4eb19cbb5c
|
4
|
+
data.tar.gz: a9f00670c0d01fe19f0991471f7344c6c3370915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 255b6a0e805116a6c992657c38d1f25ba81a863cec6dde9f79c5263016c693043c80c99c812329bc4186aab2bc7bccafebde2e9967102afffb2fb50520c58aa1
|
7
|
+
data.tar.gz: a0c035e7112895aee64de5fb2af85824dade5095b9d0da642d612c6d59d75d08a1a8216ac83cd95578fe68228561c0ba78ab8504c10d0971621b76eb62b54aef
|
data/app/models/mdm/vuln.rb
CHANGED
@@ -22,6 +22,14 @@ class Mdm::Vuln < ActiveRecord::Base
|
|
22
22
|
counter_cache: :vuln_count,
|
23
23
|
inverse_of: :vulns
|
24
24
|
|
25
|
+
# @!attribute [rw] matches
|
26
|
+
# The matches for this vuln
|
27
|
+
#
|
28
|
+
# @return [ActiveRecord::Relation<MetasploitDataModels::AutomaticExploitation::Match>]
|
29
|
+
has_many :matches, class_name: "MetasploitDataModels::AutomaticExploitation::Match",
|
30
|
+
as: :matchable,
|
31
|
+
dependent: :destroy
|
32
|
+
|
25
33
|
# @!attribute [rw] service
|
26
34
|
# The service with the vulnerability.
|
27
35
|
#
|
@@ -118,6 +126,8 @@ class Mdm::Vuln < ActiveRecord::Base
|
|
118
126
|
:class_name => 'Mdm::Module::Detail',
|
119
127
|
:source => :detail,
|
120
128
|
:through => :module_refs
|
129
|
+
|
130
|
+
|
121
131
|
#
|
122
132
|
# Attributes
|
123
133
|
#
|
@@ -25,5 +25,19 @@ class MetasploitDataModels::AutomaticExploitation::Match < ActiveRecord::Base
|
|
25
25
|
foreign_key: :module_fullname,
|
26
26
|
primary_key: :fullname
|
27
27
|
|
28
|
+
# Scope a match to a MetasploitDataModels::AutomaticExploitation::Run
|
29
|
+
scope :by_run_and_vuln,
|
30
|
+
->(run,vuln){
|
31
|
+
joins(
|
32
|
+
MetasploitDataModels::AutomaticExploitation::Match.join_association(:match_set),
|
33
|
+
MetasploitDataModels::AutomaticExploitation::MatchSet.join_association(:runs)
|
34
|
+
).where(
|
35
|
+
MetasploitDataModels::AutomaticExploitation::Run[:id].eq(run.id)
|
36
|
+
).where(
|
37
|
+
MetasploitDataModels::AutomaticExploitation::Match[:matchable_id].eq(vuln.id),
|
38
|
+
MetasploitDataModels::AutomaticExploitation::Match[:matchable_type].eq("Mdm::Vuln")
|
39
|
+
)
|
40
|
+
}
|
41
|
+
|
28
42
|
Metasploit::Concern.run(self)
|
29
43
|
end
|
@@ -41,6 +41,7 @@ RSpec.describe Mdm::Vuln, type: :model do
|
|
41
41
|
it { is_expected.to have_many(:vuln_details).class_name('Mdm::VulnDetail').dependent(:destroy) }
|
42
42
|
it { is_expected.to have_many(:vulns_refs).class_name('Mdm::VulnRef').dependent(:destroy) }
|
43
43
|
it { is_expected.to have_many(:notes).class_name('Mdm::Note').dependent(:delete_all).order('notes.created_at') }
|
44
|
+
it { is_expected.to have_many(:matches).class_name("MetasploitDataModels::AutomaticExploitation::Match").dependent(:destroy) }
|
44
45
|
|
45
46
|
context 'module_details' do
|
46
47
|
it { is_expected.to have_many(:module_details).class_name('Mdm::Module::Detail').through(:module_refs) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit_data_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Huckins
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: metasploit-version
|