metasploit_data_models 1.0.1 → 1.1.0
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: b4abe639facb4bde408a5a4df77e10b684868bee
|
4
|
+
data.tar.gz: 9cee9a8a732c5a49a5725c117c074f51df88138a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7456df1528a09430fcc9ed93e240ba97ab33b653d7422942a24b1b86315a2439a93854c0815aa1fcad18690bd574b513997ee37c8bbe553267073ec4e89ae778
|
7
|
+
data.tar.gz: c669eea4b2105a2367b6c121fb4727d0d8eea0eb4ae50ac34aa45eca37e94b3d27e3a1529cfad54c8324523c571a7c29ecdc83edae2a9779320f209554301e6c
|
data/app/models/mdm/vuln.rb
CHANGED
@@ -30,6 +30,14 @@ class Mdm::Vuln < ActiveRecord::Base
|
|
30
30
|
class_name: 'Mdm::Service',
|
31
31
|
inverse_of: :vulns
|
32
32
|
|
33
|
+
# @!attribute [rw] origin
|
34
|
+
# A polymorphic association to the origin that found
|
35
|
+
# the vulnerability.
|
36
|
+
#
|
37
|
+
# @return [ActiveRecord::Relation<origin>]
|
38
|
+
belongs_to :origin,
|
39
|
+
polymorphic: true
|
40
|
+
|
33
41
|
# @!attribute [rw] vuln_attempts
|
34
42
|
# Attempts to exploit this vulnerability.
|
35
43
|
#
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddOriginToMdmVuln < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :vulns, :origin_id, :integer
|
4
|
+
add_column :vulns, :origin_type, :string
|
5
|
+
|
6
|
+
add_index :vulns, :origin_id
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_column :vulns, :origin_id
|
11
|
+
remove_column :vulns, :origin_type
|
12
|
+
end
|
13
|
+
end
|
@@ -8,9 +8,11 @@ module MetasploitDataModels
|
|
8
8
|
# The major version number.
|
9
9
|
MAJOR = 1
|
10
10
|
# The minor version number, scoped to the {MAJOR} version number.
|
11
|
-
MINOR =
|
11
|
+
MINOR = 1
|
12
12
|
# The patch version number, scoped to the {MAJOR} and {MINOR} version numbers.
|
13
|
-
PATCH =
|
13
|
+
PATCH = 0
|
14
|
+
|
15
|
+
# The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version numbers.
|
14
16
|
|
15
17
|
#
|
16
18
|
# Module Methods
|
@@ -32,6 +32,7 @@ RSpec.describe Mdm::Vuln, type: :model do
|
|
32
32
|
|
33
33
|
context 'associations' do
|
34
34
|
it { is_expected.to belong_to(:host).class_name('Mdm::Host') }
|
35
|
+
it { is_expected.to belong_to(:origin) }
|
35
36
|
it { is_expected.to belong_to(:service).class_name('Mdm::Service') }
|
36
37
|
it { is_expected.to have_many(:module_refs).class_name('Mdm::Module::Ref').through(:refs) }
|
37
38
|
it { is_expected.to have_many(:module_runs).class_name('MetasploitDataModels::ModuleRun') }
|
@@ -128,6 +129,8 @@ RSpec.describe Mdm::Vuln, type: :model do
|
|
128
129
|
it { is_expected.to have_db_column(:host_id).of_type(:integer) }
|
129
130
|
it { is_expected.to have_db_column(:info).of_type(:string) }
|
130
131
|
it { is_expected.to have_db_column(:name).of_type(:string) }
|
132
|
+
it { is_expected.to have_db_column(:origin_id).of_type(:integer) }
|
133
|
+
it { is_expected.to have_db_column(:origin_type).of_type(:string) }
|
131
134
|
it { is_expected.to have_db_column(:service_id).of_type(:integer) }
|
132
135
|
|
133
136
|
context 'counter caches' do
|
data/spec/dummy/db/structure.sql
CHANGED
@@ -1659,7 +1659,9 @@ CREATE TABLE vulns (
|
|
1659
1659
|
info character varying(65536),
|
1660
1660
|
exploited_at timestamp without time zone,
|
1661
1661
|
vuln_detail_count integer DEFAULT 0,
|
1662
|
-
vuln_attempt_count integer DEFAULT 0
|
1662
|
+
vuln_attempt_count integer DEFAULT 0,
|
1663
|
+
origin_id integer,
|
1664
|
+
origin_type character varying(255)
|
1663
1665
|
);
|
1664
1666
|
|
1665
1667
|
|
@@ -3081,6 +3083,13 @@ CREATE INDEX index_sessions_on_module_run_id ON sessions USING btree (module_run
|
|
3081
3083
|
CREATE INDEX index_vulns_on_name ON vulns USING btree (name);
|
3082
3084
|
|
3083
3085
|
|
3086
|
+
--
|
3087
|
+
-- Name: index_vulns_on_origin_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
3088
|
+
--
|
3089
|
+
|
3090
|
+
CREATE INDEX index_vulns_on_origin_id ON vulns USING btree (origin_id);
|
3091
|
+
|
3092
|
+
|
3084
3093
|
--
|
3085
3094
|
-- Name: index_web_forms_on_path; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
3086
3095
|
--
|
@@ -3381,6 +3390,8 @@ INSERT INTO schema_migrations (version) VALUES ('20150326183742');
|
|
3381
3390
|
|
3382
3391
|
INSERT INTO schema_migrations (version) VALUES ('20150421211719');
|
3383
3392
|
|
3393
|
+
INSERT INTO schema_migrations (version) VALUES ('20150514182921');
|
3394
|
+
|
3384
3395
|
INSERT INTO schema_migrations (version) VALUES ('21');
|
3385
3396
|
|
3386
3397
|
INSERT INTO schema_migrations (version) VALUES ('22');
|
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.0
|
4
|
+
version: 1.1.0
|
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-05-
|
14
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: metasploit-version
|
@@ -501,6 +501,7 @@ files:
|
|
501
501
|
- db/migrate/20150317145455_rename_module_indices.rb
|
502
502
|
- db/migrate/20150326183742_add_missing_ae_indices.rb
|
503
503
|
- db/migrate/20150421211719_rename_automatic_exploitation_index.rb
|
504
|
+
- db/migrate/20150514182921_add_origin_to_mdm_vuln.rb
|
504
505
|
- lib/mdm.rb
|
505
506
|
- lib/mdm/host/operating_system_normalization.rb
|
506
507
|
- lib/mdm/module.rb
|