metasploit_data_models 4.1.4 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -1
- data/Gemfile +0 -2
- data/README.md +8 -0
- data/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list.rb +1 -1
- data/app/models/metasploit_data_models/search/visitor/relation.rb +1 -1
- data/lib/metasploit_data_models/version.rb +1 -1
- data/metasploit_data_models.gemspec +3 -3
- data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +6 -2
- data/spec/dummy/app/models/application_record.rb +2 -0
- data/spec/dummy/config/application.rb +2 -0
- data/spec/dummy/config/storage.yml +7 -0
- data/spec/dummy/db/structure.sql +3 -18
- metadata +8 -8
- metadata.gz.sig +0 -0
- data/config/initializers/arel_helper.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a15267e2f6c71ba5b58fdfea90153b170f940e65b01b85d3612bcdf1694c298f
|
4
|
+
data.tar.gz: fb5e035e7e80f3dea304ed1ca8cacc463117300357c9386d341196e968003d8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2670839b6eace925d4da176c76da44cfbb54e774a50755a7095ef3de8220a81c146a442d258eee7e6e91abad2fae76ab82e49e7998fef749ea95173a2871a98c
|
7
|
+
data.tar.gz: e6a013485f5b639a31d1232743c847787853bb61fab191a2e619dbfe1d5853b8c4fe7bc905847a3a38910da59accd4b1488fe47eb81f10e96f98da3e38a14ba9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
Q#�4�����6��eR[�e�`�n����:�ٽ)5��fh�p��Y��訋踦�a�
|
2
|
+
��ԩ���1��y�ꮬ�X��氓��D=Io����:
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -41,6 +41,14 @@ different `on_load` name, which is just the class name converted to an underscor
|
|
41
41
|
|
42
42
|
require 'metasploit_data_models/engine'
|
43
43
|
|
44
|
+
`ArelHelper` classes must also be included in your applications `app/models/application_record.rb` class:
|
45
|
+
|
46
|
+
class ApplicationRecord < ActiveRecord::Base
|
47
|
+
self.abstract_class = true
|
48
|
+
include ArelHelpers::ArelTable
|
49
|
+
include ArelHelpers::JoinAssociation
|
50
|
+
end
|
51
|
+
|
44
52
|
### Metasploit Framework
|
45
53
|
|
46
54
|
In Metasploit Framework, `MetasploitDataModels::Engine` is loaded, but the data models are only if the user wants to use
|
@@ -12,7 +12,7 @@ class MetasploitDataModels::IPAddress::V4::Segment::Nmap::List < Metasploit::Mod
|
|
12
12
|
# Either an individual {MetasploitDataModels::IPAddress::V4::Segment::Single segment number} or a
|
13
13
|
# {MetasploitDataModels::IPAddress::V4::Segment::Nmap::Range segment range}.
|
14
14
|
RANGE_OR_NUMBER_REGEXP = %r{
|
15
|
-
(?<range>#{
|
15
|
+
(?<range>#{module_parent::Range.regexp})
|
16
16
|
|
|
17
17
|
# range first because it contains a segment and if the range isn't first only the first part of the range will
|
18
18
|
# match.
|
@@ -67,7 +67,7 @@ class MetasploitDataModels::Search::Visitor::Relation < Metasploit::Model::Base
|
|
67
67
|
# @return [Hash{Symbol => Class}]
|
68
68
|
def self.visitor_class_by_relation_method
|
69
69
|
@relation_method_by_visitor_class ||= RELATION_METHODS.each_with_object({}) { |relation_method, relation_method_by_visitor_class|
|
70
|
-
visitor_class_name = "#{
|
70
|
+
visitor_class_name = "#{module_parent.name}::#{relation_method.to_s.camelize}"
|
71
71
|
visitor_class = visitor_class_name.constantize
|
72
72
|
|
73
73
|
relation_method_by_visitor_class[relation_method] = visitor_class
|
@@ -33,11 +33,11 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency 'pry'
|
34
34
|
|
35
35
|
|
36
|
-
s.add_runtime_dependency 'activerecord', '~>
|
37
|
-
s.add_runtime_dependency 'activesupport', '~>
|
36
|
+
s.add_runtime_dependency 'activerecord', '~>6.0'
|
37
|
+
s.add_runtime_dependency 'activesupport', '~>6.0'
|
38
38
|
s.add_runtime_dependency 'metasploit-concern'
|
39
39
|
s.add_runtime_dependency 'metasploit-model', '>=3.1'
|
40
|
-
s.add_runtime_dependency 'railties', '~>
|
40
|
+
s.add_runtime_dependency 'railties', '~>6.0'
|
41
41
|
s.add_runtime_dependency 'webrick'
|
42
42
|
|
43
43
|
# os fingerprinting
|
@@ -28,7 +28,11 @@ RSpec.describe MetasploitDataModels::Search::Visitor::Attribute, type: :model do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should be #{node_class}#attribute" do
|
31
|
-
|
31
|
+
if node.attribute.instance_of? Symbol
|
32
|
+
expect(name.to_s).to eq(node.attribute.to_s)
|
33
|
+
else
|
34
|
+
expect(name).to eq(node.attribute)
|
35
|
+
end
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
@@ -93,4 +97,4 @@ RSpec.describe MetasploitDataModels::Search::Visitor::Attribute, type: :model do
|
|
93
97
|
}
|
94
98
|
end
|
95
99
|
end
|
96
|
-
end
|
100
|
+
end
|
data/spec/dummy/db/structure.sql
CHANGED
@@ -5,27 +5,12 @@ SET client_encoding = 'UTF8';
|
|
5
5
|
SET standard_conforming_strings = on;
|
6
6
|
SELECT pg_catalog.set_config('search_path', '', false);
|
7
7
|
SET check_function_bodies = false;
|
8
|
+
SET xmloption = content;
|
8
9
|
SET client_min_messages = warning;
|
9
10
|
SET row_security = off;
|
10
11
|
|
11
|
-
--
|
12
|
-
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
13
|
-
--
|
14
|
-
|
15
|
-
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
16
|
-
|
17
|
-
|
18
|
-
--
|
19
|
-
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
|
20
|
-
--
|
21
|
-
|
22
|
-
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
23
|
-
|
24
|
-
|
25
12
|
SET default_tablespace = '';
|
26
13
|
|
27
|
-
SET default_with_oids = false;
|
28
|
-
|
29
14
|
--
|
30
15
|
-- Name: api_keys; Type: TABLE; Schema: public; Owner: -
|
31
16
|
--
|
@@ -64,8 +49,8 @@ ALTER SEQUENCE public.api_keys_id_seq OWNED BY public.api_keys.id;
|
|
64
49
|
CREATE TABLE public.ar_internal_metadata (
|
65
50
|
key character varying NOT NULL,
|
66
51
|
value character varying,
|
67
|
-
created_at timestamp without time zone NOT NULL,
|
68
|
-
updated_at timestamp without time zone NOT NULL
|
52
|
+
created_at timestamp(6) without time zone NOT NULL,
|
53
|
+
updated_at timestamp(6) without time zone NOT NULL
|
69
54
|
);
|
70
55
|
|
71
56
|
|
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:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Metasploit Hackers
|
@@ -185,28 +185,28 @@ dependencies:
|
|
185
185
|
requirements:
|
186
186
|
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version:
|
188
|
+
version: '6.0'
|
189
189
|
type: :runtime
|
190
190
|
prerelease: false
|
191
191
|
version_requirements: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
193
|
- - "~>"
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
version:
|
195
|
+
version: '6.0'
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
197
|
name: activesupport
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
200
|
- - "~>"
|
201
201
|
- !ruby/object:Gem::Version
|
202
|
-
version:
|
202
|
+
version: '6.0'
|
203
203
|
type: :runtime
|
204
204
|
prerelease: false
|
205
205
|
version_requirements: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
207
|
- - "~>"
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
209
|
+
version: '6.0'
|
210
210
|
- !ruby/object:Gem::Dependency
|
211
211
|
name: metasploit-concern
|
212
212
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,14 +241,14 @@ dependencies:
|
|
241
241
|
requirements:
|
242
242
|
- - "~>"
|
243
243
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
244
|
+
version: '6.0'
|
245
245
|
type: :runtime
|
246
246
|
prerelease: false
|
247
247
|
version_requirements: !ruby/object:Gem::Requirement
|
248
248
|
requirements:
|
249
249
|
- - "~>"
|
250
250
|
- !ruby/object:Gem::Version
|
251
|
-
version:
|
251
|
+
version: '6.0'
|
252
252
|
- !ruby/object:Gem::Dependency
|
253
253
|
name: webrick
|
254
254
|
requirement: !ruby/object:Gem::Requirement
|
@@ -416,7 +416,6 @@ files:
|
|
416
416
|
- app/models/metasploit_data_models/search/visitor/method.rb
|
417
417
|
- app/models/metasploit_data_models/search/visitor/relation.rb
|
418
418
|
- app/models/metasploit_data_models/search/visitor/where.rb
|
419
|
-
- config/initializers/arel_helper.rb
|
420
419
|
- config/initializers/ipaddr.rb
|
421
420
|
- config/locales/en.yml
|
422
421
|
- console_db.yml
|
@@ -685,6 +684,7 @@ files:
|
|
685
684
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
686
685
|
- spec/dummy/config/locales/en.yml
|
687
686
|
- spec/dummy/config/routes.rb
|
687
|
+
- spec/dummy/config/storage.yml
|
688
688
|
- spec/dummy/db/structure.sql
|
689
689
|
- spec/dummy/db/structure.sql.from_rails_3
|
690
690
|
- spec/dummy/lib/assets/.gitkeep
|
metadata.gz.sig
CHANGED
Binary file
|