metasploit_data_models 0.24.4 → 0.24.5
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
- data/.rspec +3 -3
- data/.travis.yml +3 -6
- data/CONTRIBUTING.md +52 -10
- data/Gemfile +8 -1
- data/Rakefile +0 -23
- data/app/models/mdm/api_key.rb +1 -41
- data/app/models/mdm/client.rb +1 -41
- data/app/models/mdm/cred.rb +19 -107
- data/app/models/mdm/event.rb +1 -48
- data/app/models/mdm/exploit_attempt.rb +16 -65
- data/app/models/mdm/exploited_host.rb +1 -28
- data/app/models/mdm/host_detail.rb +1 -45
- data/app/models/mdm/host_tag.rb +8 -6
- data/app/models/mdm/listener.rb +1 -53
- data/app/models/mdm/macro.rb +0 -42
- data/app/models/mdm/mod_ref.rb +0 -21
- data/app/models/mdm/module/action.rb +0 -15
- data/app/models/mdm/module/arch.rb +0 -10
- data/app/models/mdm/module/author.rb +0 -16
- data/app/models/mdm/module/mixin.rb +0 -13
- data/app/models/mdm/module/platform.rb +0 -11
- data/app/models/mdm/module/target.rb +0 -18
- data/app/models/mdm/nexpose_console.rb +4 -82
- data/app/models/mdm/profile.rb +0 -36
- data/app/models/mdm/route.rb +5 -17
- data/app/models/mdm/session_event.rb +1 -33
- data/app/models/mdm/tag.rb +10 -49
- data/app/models/mdm/task.rb +45 -94
- data/app/models/mdm/task_cred.rb +0 -29
- data/app/models/mdm/task_host.rb +0 -25
- data/app/models/mdm/task_service.rb +0 -25
- data/app/models/mdm/task_session.rb +0 -25
- data/app/models/mdm/user.rb +6 -188
- data/app/models/mdm/vuln_attempt.rb +12 -37
- data/app/models/mdm/vuln_detail.rb +5 -139
- data/app/models/mdm/vuln_ref.rb +1 -4
- data/app/models/mdm/web_form.rb +1 -35
- data/app/models/mdm/web_page.rb +1 -70
- data/app/models/mdm/web_site.rb +1 -51
- data/app/models/mdm/wmap_request.rb +0 -85
- data/app/models/mdm/wmap_target.rb +0 -40
- data/app/models/mdm/workspace.rb +14 -152
- data/app/models/metasploit_data_models/automatic_exploitation.rb +16 -0
- data/app/models/metasploit_data_models/automatic_exploitation/match.rb +24 -19
- data/app/models/metasploit_data_models/automatic_exploitation/match_result.rb +5 -33
- data/app/models/metasploit_data_models/automatic_exploitation/match_set.rb +4 -22
- data/app/models/metasploit_data_models/automatic_exploitation/run.rb +3 -13
- data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
- data/app/models/metasploit_data_models/module_run.rb +1 -1
- data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
- data/app/validators/ip_format_validator.rb +0 -4
- data/app/validators/parameters_validator.rb +0 -12
- data/app/validators/password_is_strong_validator.rb +1 -10
- data/lib/mdm/host/operating_system_normalization.rb +10 -7
- data/lib/metasploit_data_models.rb +0 -4
- data/lib/metasploit_data_models/engine.rb +0 -2
- data/lib/metasploit_data_models/serialized_prefs.rb +0 -6
- data/lib/metasploit_data_models/version.rb +10 -24
- data/lib/tasks/yard.rake +33 -0
- data/metasploit_data_models.gemspec +2 -9
- data/spec/app/models/mdm/api_key_spec.rb +3 -1
- data/spec/app/models/mdm/client_spec.rb +11 -9
- data/spec/app/models/mdm/cred_spec.rb +54 -42
- data/spec/app/models/mdm/event_spec.rb +23 -21
- data/spec/app/models/mdm/exploit_attempt_spec.rb +21 -19
- data/spec/app/models/mdm/exploited_host_spec.rb +13 -11
- data/spec/app/models/mdm/host_detail_spec.rb +17 -15
- data/spec/app/models/mdm/host_spec.rb +260 -261
- data/spec/app/models/mdm/host_tag_spec.rb +8 -6
- data/spec/app/models/mdm/listener_spec.rb +32 -30
- data/spec/app/models/mdm/loot_spec.rb +23 -21
- data/spec/app/models/mdm/macro_spec.rb +3 -1
- data/spec/app/models/mdm/mod_ref_spec.rb +3 -1
- data/spec/app/models/mdm/module/action_spec.rb +12 -10
- data/spec/app/models/mdm/module/arch_spec.rb +12 -10
- data/spec/app/models/mdm/module/author_spec.rb +17 -22
- data/spec/app/models/mdm/module/detail_spec.rb +75 -184
- data/spec/app/models/mdm/module/mixin_spec.rb +12 -10
- data/spec/app/models/mdm/module/platform_spec.rb +12 -10
- data/spec/app/models/mdm/module/ref_spec.rb +12 -10
- data/spec/app/models/mdm/module/target_spec.rb +15 -13
- data/spec/app/models/mdm/nexpose_console_spec.rb +37 -35
- data/spec/app/models/mdm/note_spec.rb +25 -23
- data/spec/app/models/mdm/profile_spec.rb +3 -1
- data/spec/app/models/mdm/ref_spec.rb +12 -10
- data/spec/app/models/mdm/route_spec.rb +8 -6
- data/spec/app/models/mdm/service_spec.rb +40 -38
- data/spec/app/models/mdm/session_event_spec.rb +12 -10
- data/spec/app/models/mdm/session_spec.rb +15 -13
- data/spec/app/models/mdm/tag_spec.rb +29 -29
- data/spec/app/models/mdm/task_cred_spec.rb +11 -9
- data/spec/app/models/mdm/task_host_spec.rb +11 -9
- data/spec/app/models/mdm/task_service_spec.rb +11 -9
- data/spec/app/models/mdm/task_session_spec.rb +9 -7
- data/spec/app/models/mdm/task_spec.rb +29 -27
- data/spec/app/models/mdm/user_spec.rb +19 -17
- data/spec/app/models/mdm/vuln_attempt_spec.rb +16 -14
- data/spec/app/models/mdm/vuln_detail_spec.rb +28 -26
- data/spec/app/models/mdm/vuln_ref_spec.rb +10 -8
- data/spec/app/models/mdm/vuln_spec.rb +26 -24
- data/spec/app/models/mdm/web_form_spec.rb +13 -11
- data/spec/app/models/mdm/web_page_spec.rb +21 -19
- data/spec/app/models/mdm/web_site_spec.rb +23 -21
- data/spec/app/models/mdm/web_vuln_spec.rb +65 -63
- data/spec/app/models/mdm/wmap_request_spec.rb +3 -1
- data/spec/app/models/mdm/wmap_target_spec.rb +3 -1
- data/spec/app/models/mdm/workspace_spec.rb +100 -97
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +5 -3
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +15 -13
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +12 -10
- data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +23 -21
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +11 -9
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +23 -21
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +15 -22
- data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/module_run_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +20 -18
- data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +8 -6
- data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +4 -2
- data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +8 -6
- data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +11 -9
- data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +7 -5
- data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +19 -17
- data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +7 -5
- data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +23 -61
- data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +10 -8
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +46 -54
- data/spec/dummy/db/structure.sql +3403 -0
- data/spec/factories/mdm/module/details.rb +1 -1
- data/spec/lib/base64_serializer_spec.rb +19 -19
- data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +12 -18
- data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +6 -4
- data/spec/lib/metasploit_data_models/match/child_spec.rb +4 -2
- data/spec/lib/metasploit_data_models/match/parent_spec.rb +6 -4
- data/spec/lib/metasploit_data_models/version_spec.rb +141 -3
- data/spec/spec_helper.rb +12 -86
- data/spec/support/shared/examples/mdm/module/detail/does_not_support_stance_with_mtype.rb +2 -2
- data/spec/support/shared/examples/mdm/module/detail/supports_stance_with_mtype.rb +4 -4
- data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb +2 -2
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_children.rb +5 -5
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_metasploit_model_search_operation_base.rb +5 -5
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb +3 -3
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_metasploit_model_search_group_base.rb +6 -7
- metadata +9 -67
- data/CHANGELOG.md +0 -6
- data/RELEASING.md +0 -88
- data/UPGRADING.md +0 -1
- data/lib/metasploit_data_models/automatic_exploitation.rb +0 -25
- data/spec/lib/metasploit_data_models_spec.rb +0 -4
data/spec/spec_helper.rb
CHANGED
|
@@ -22,6 +22,7 @@ end
|
|
|
22
22
|
|
|
23
23
|
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
|
24
24
|
require 'rspec/rails'
|
|
25
|
+
require 'rspec/autorun'
|
|
25
26
|
|
|
26
27
|
# full backtrace in logs so its easier to trace errors
|
|
27
28
|
Rails.backtrace_cleaner.remove_silencers!
|
|
@@ -29,102 +30,27 @@ Rails.backtrace_cleaner.remove_silencers!
|
|
|
29
30
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
30
31
|
# in spec/support/ and its subdirectories.
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
require f
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
roots = [
|
|
40
|
-
gem_specification.gem_dir,
|
|
41
|
-
Metasploit::Concern::Engine.root,
|
|
42
|
-
Metasploit::Model::Engine.root,
|
|
43
|
-
MetasploitDataModels::Engine.root
|
|
33
|
+
engines = [
|
|
34
|
+
Metasploit::Concern::Engine,
|
|
35
|
+
Metasploit::Model::Engine,
|
|
36
|
+
MetasploitDataModels::Engine
|
|
44
37
|
]
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
support_glob =
|
|
39
|
+
engines.each do |engine|
|
|
40
|
+
support_glob = engine.root.join('spec', 'support', '**', '*.rb')
|
|
48
41
|
|
|
49
42
|
Dir.glob(support_glob) do |path|
|
|
50
43
|
require path
|
|
51
44
|
end
|
|
52
45
|
end
|
|
53
46
|
|
|
54
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
55
47
|
RSpec.configure do |config|
|
|
56
|
-
# rspec-expectations config goes here. You can use an alternate
|
|
57
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
58
|
-
# assertions if you prefer.
|
|
59
|
-
config.expect_with :rspec do |expectations|
|
|
60
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
61
|
-
# and `failure_message` of custom matchers include text for helper methods
|
|
62
|
-
# defined using `chain`, e.g.:
|
|
63
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
|
64
|
-
# # => "be bigger than 2 and smaller than 4"
|
|
65
|
-
# ...rather than:
|
|
66
|
-
# # => "be bigger than 2"
|
|
67
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
|
71
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
72
|
-
config.mock_with :rspec do |mocks|
|
|
73
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
|
74
|
-
# a real object. This is generally recommended, and will default to
|
|
75
|
-
# `true` in RSpec 4.
|
|
76
|
-
mocks.verify_partial_doubles = true
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# These two settings work together to allow you to limit a spec run
|
|
80
|
-
# to individual examples or groups you care about by tagging them with
|
|
81
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
82
|
-
# get run.
|
|
83
|
-
config.filter_run :focus
|
|
84
|
-
config.run_all_when_everything_filtered = true
|
|
85
|
-
|
|
86
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
|
87
|
-
# recommended. For more details, see:
|
|
88
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
|
89
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
90
|
-
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
|
91
|
-
config.disable_monkey_patching!
|
|
92
|
-
|
|
93
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
|
94
|
-
# be too noisy due to issues in dependencies.
|
|
95
|
-
config.warnings = true
|
|
96
|
-
|
|
97
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
|
98
|
-
# file, and it's useful to allow more verbose output when running an
|
|
99
|
-
# individual spec file.
|
|
100
|
-
if config.files_to_run.one?
|
|
101
|
-
# Use the documentation formatter for detailed output,
|
|
102
|
-
# unless a formatter has already been configured
|
|
103
|
-
# (e.g. via a command-line flag).
|
|
104
|
-
config.default_formatter = 'doc'
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Print the 10 slowest examples and example groups at the
|
|
108
|
-
# end of the spec run, to help surface which specs are running
|
|
109
|
-
# particularly slow.
|
|
110
|
-
config.profile_examples = 10
|
|
111
|
-
|
|
112
|
-
# Run specs in random order to surface order dependencies. If you find an
|
|
113
|
-
# order dependency and want to debug it, you can fix the order by providing
|
|
114
|
-
# the seed, which is printed after each run.
|
|
115
|
-
# --seed 1234
|
|
116
|
-
config.order = :random
|
|
117
|
-
|
|
118
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
|
119
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
120
|
-
# test failures related to randomization by passing the same `--seed` value
|
|
121
|
-
# as the one that triggered the failure.
|
|
122
|
-
Kernel.srand config.seed
|
|
123
|
-
|
|
124
|
-
config.use_transactional_fixtures = true
|
|
125
|
-
|
|
126
48
|
config.before(:each) do
|
|
127
49
|
# Rex is only available when testing with metasploit-framework or pro, so stub out the methods that require it
|
|
128
|
-
|
|
50
|
+
Mdm::Workspace.any_instance.stub(:valid_ip_or_range? => true)
|
|
129
51
|
end
|
|
52
|
+
|
|
53
|
+
config.mock_with :rspec
|
|
54
|
+
config.use_transactional_fixtures = true
|
|
55
|
+
config.order = :random
|
|
130
56
|
end
|
|
@@ -6,7 +6,7 @@ shared_examples_for 'Mdm::Module::Detail does not support stance with mtype' do
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it 'should return false for supports_stance?' do
|
|
9
|
-
|
|
9
|
+
detail.supports_stance?.should be_false
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
context 'with nil stance' do
|
|
@@ -14,7 +14,7 @@ shared_examples_for 'Mdm::Module::Detail does not support stance with mtype' do
|
|
|
14
14
|
nil
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
it {
|
|
17
|
+
it { should be_valid }
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -6,7 +6,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it 'should return true for supports_stance?' do
|
|
9
|
-
|
|
9
|
+
detail.supports_stance?.should be_true
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
context 'with nil stance' do
|
|
@@ -14,7 +14,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
|
|
|
14
14
|
nil
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
it {
|
|
17
|
+
it { should be_invalid }
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
context "with 'aggresive' stance" do
|
|
@@ -22,7 +22,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
|
|
|
22
22
|
'aggressive'
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
it {
|
|
25
|
+
it { should be_valid }
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
context "with 'passive' stance" do
|
|
@@ -30,7 +30,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
|
|
|
30
30
|
'passive'
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
it {
|
|
33
|
+
it { should be_valid }
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
end
|
data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb
CHANGED
|
@@ -11,7 +11,7 @@ shared_examples_for 'MetasploitDataModels::Search::Operation::IPAddress::*.match
|
|
|
11
11
|
|
|
12
12
|
shared_examples_for 'match' do |boolean|
|
|
13
13
|
if boolean
|
|
14
|
-
it {
|
|
14
|
+
it { should be_a described_class }
|
|
15
15
|
|
|
16
16
|
it 'does not set #operator' do
|
|
17
17
|
expect(match.operator).to be_nil
|
|
@@ -21,7 +21,7 @@ shared_examples_for 'MetasploitDataModels::Search::Operation::IPAddress::*.match
|
|
|
21
21
|
expect(match.value).not_to be_nil
|
|
22
22
|
end
|
|
23
23
|
else
|
|
24
|
-
it {
|
|
24
|
+
it { should be_nil }
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -13,10 +13,10 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Includes#visit with
|
|
|
13
13
|
|
|
14
14
|
it 'should visit each child' do
|
|
15
15
|
# needed for call to visit subject
|
|
16
|
-
|
|
16
|
+
visitor.should_receive(:visit).with(node).and_call_original
|
|
17
17
|
|
|
18
18
|
children.each do |child|
|
|
19
|
-
|
|
19
|
+
visitor.should_receive(:visit).with(child).and_return([])
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
visit
|
|
@@ -25,14 +25,14 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Includes#visit with
|
|
|
25
25
|
it 'should return Array of all child visits' do
|
|
26
26
|
child_visits = []
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
visitor.should_receive(:visit).with(node).and_call_original
|
|
29
29
|
|
|
30
30
|
children.each_with_index do |child, i|
|
|
31
31
|
child_visit = ["Visited Child #{i}"]
|
|
32
|
-
|
|
32
|
+
visitor.stub(:visit).with(child).and_return(child_visit)
|
|
33
33
|
child_visits.concat(child_visit)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
visit.should == child_visits
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -10,17 +10,17 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Includes#visit with
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it 'should visit operator' do
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
visitor.should_receive(:visit).with(node).and_call_original
|
|
14
|
+
visitor.should_receive(:visit).with(operator).and_return([])
|
|
15
15
|
|
|
16
16
|
visit
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'should return operator visit' do
|
|
20
20
|
operator_visit = ["Visited Operator"]
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
visitor.should_receive(:visit).with(node).and_call_original
|
|
22
|
+
visitor.stub(:visit).with(operator).and_return(operator_visit)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
visit.should == operator_visit
|
|
25
25
|
end
|
|
26
26
|
end
|
data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb
CHANGED
|
@@ -18,16 +18,16 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with equ
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
it 'should visit operation.operator with attribute_visitor' do
|
|
21
|
-
|
|
21
|
+
visitor.attribute_visitor.should_receive(:visit).with(operator).and_call_original
|
|
22
22
|
|
|
23
23
|
visit
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
it 'should call eq on Arel::Attributes::Attribute from attribute_visitor' do
|
|
27
27
|
attribute = double('Visited Operator')
|
|
28
|
-
|
|
28
|
+
visitor.attribute_visitor.stub(:visit).with(operator).and_return(attribute)
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
attribute.should_receive(:eq).with(value)
|
|
31
31
|
|
|
32
32
|
visit
|
|
33
33
|
end
|
|
@@ -16,22 +16,22 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with Met
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
it 'should visit each child' do
|
|
19
|
-
|
|
19
|
+
visitor.should_receive(:visit).with(node).and_call_original
|
|
20
20
|
|
|
21
21
|
children.each do |child|
|
|
22
|
-
|
|
22
|
+
visitor.should_receive(:visit).with(child).and_return(Arel::Nodes::Equality.new(1, 1))
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
visit
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
it "should combine children AREL with #{arel_class}" do
|
|
29
|
-
|
|
29
|
+
visitor.stub(:visit).with(node).and_call_original
|
|
30
30
|
child_visits = []
|
|
31
31
|
|
|
32
32
|
children.each_with_index do |child, i|
|
|
33
33
|
child_visit = Arel::Nodes::Equality.new(i, i)
|
|
34
|
-
|
|
34
|
+
visitor.stub(:visit).with(child).and_return(child_visit)
|
|
35
35
|
child_visits << child_visit
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -43,9 +43,8 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with Met
|
|
|
43
43
|
arel_pair = root
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
arel_pair.should be_a arel_class
|
|
47
47
|
|
|
48
|
-
expect(arel_pair.left).to
|
|
49
|
-
expect(arel_pair.right).to eq(child_visits[1])
|
|
48
|
+
expect([arel_pair.left, arel_pair.right]).to match_array(child_visits)
|
|
50
49
|
end
|
|
51
50
|
end
|
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: 0.24.
|
|
4
|
+
version: 0.24.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Huckins
|
|
@@ -13,62 +13,6 @@ bindir: bin
|
|
|
13
13
|
cert_chain: []
|
|
14
14
|
date: 2015-05-29 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
|
-
- !ruby/object:Gem::Dependency
|
|
17
|
-
name: metasploit-version
|
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
|
19
|
-
requirements:
|
|
20
|
-
- - "~>"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.1.3
|
|
23
|
-
type: :development
|
|
24
|
-
prerelease: false
|
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
-
requirements:
|
|
27
|
-
- - "~>"
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.1.3
|
|
30
|
-
- !ruby/object:Gem::Dependency
|
|
31
|
-
name: metasploit-yard
|
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
requirements:
|
|
34
|
-
- - "~>"
|
|
35
|
-
- !ruby/object:Gem::Version
|
|
36
|
-
version: '1.0'
|
|
37
|
-
type: :development
|
|
38
|
-
prerelease: false
|
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
-
requirements:
|
|
41
|
-
- - "~>"
|
|
42
|
-
- !ruby/object:Gem::Version
|
|
43
|
-
version: '1.0'
|
|
44
|
-
- !ruby/object:Gem::Dependency
|
|
45
|
-
name: yard-activerecord
|
|
46
|
-
requirement: !ruby/object:Gem::Requirement
|
|
47
|
-
requirements:
|
|
48
|
-
- - "~>"
|
|
49
|
-
- !ruby/object:Gem::Version
|
|
50
|
-
version: 0.0.14
|
|
51
|
-
type: :development
|
|
52
|
-
prerelease: false
|
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
54
|
-
requirements:
|
|
55
|
-
- - "~>"
|
|
56
|
-
- !ruby/object:Gem::Version
|
|
57
|
-
version: 0.0.14
|
|
58
|
-
- !ruby/object:Gem::Dependency
|
|
59
|
-
name: yard-metasploit-erd
|
|
60
|
-
requirement: !ruby/object:Gem::Requirement
|
|
61
|
-
requirements:
|
|
62
|
-
- - "~>"
|
|
63
|
-
- !ruby/object:Gem::Version
|
|
64
|
-
version: 0.1.0
|
|
65
|
-
type: :development
|
|
66
|
-
prerelease: false
|
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
68
|
-
requirements:
|
|
69
|
-
- - "~>"
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
version: 0.1.0
|
|
72
16
|
- !ruby/object:Gem::Dependency
|
|
73
17
|
name: rake
|
|
74
18
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -165,28 +109,28 @@ dependencies:
|
|
|
165
109
|
requirements:
|
|
166
110
|
- - '='
|
|
167
111
|
- !ruby/object:Gem::Version
|
|
168
|
-
version: 0.
|
|
112
|
+
version: 0.4.0
|
|
169
113
|
type: :runtime
|
|
170
114
|
prerelease: false
|
|
171
115
|
version_requirements: !ruby/object:Gem::Requirement
|
|
172
116
|
requirements:
|
|
173
117
|
- - '='
|
|
174
118
|
- !ruby/object:Gem::Version
|
|
175
|
-
version: 0.
|
|
119
|
+
version: 0.4.0
|
|
176
120
|
- !ruby/object:Gem::Dependency
|
|
177
121
|
name: metasploit-model
|
|
178
122
|
requirement: !ruby/object:Gem::Requirement
|
|
179
123
|
requirements:
|
|
180
124
|
- - "~>"
|
|
181
125
|
- !ruby/object:Gem::Version
|
|
182
|
-
version: 0.
|
|
126
|
+
version: 0.29.0
|
|
183
127
|
type: :runtime
|
|
184
128
|
prerelease: false
|
|
185
129
|
version_requirements: !ruby/object:Gem::Requirement
|
|
186
130
|
requirements:
|
|
187
131
|
- - "~>"
|
|
188
132
|
- !ruby/object:Gem::Version
|
|
189
|
-
version: 0.
|
|
133
|
+
version: 0.29.0
|
|
190
134
|
- !ruby/object:Gem::Dependency
|
|
191
135
|
name: railties
|
|
192
136
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -261,14 +205,11 @@ files:
|
|
|
261
205
|
- ".simplecov"
|
|
262
206
|
- ".travis.yml"
|
|
263
207
|
- ".yardopts"
|
|
264
|
-
- CHANGELOG.md
|
|
265
208
|
- CONTRIBUTING.md
|
|
266
209
|
- Gemfile
|
|
267
210
|
- LICENSE
|
|
268
211
|
- README.md
|
|
269
|
-
- RELEASING.md
|
|
270
212
|
- Rakefile
|
|
271
|
-
- UPGRADING.md
|
|
272
213
|
- app/models/mdm/api_key.rb
|
|
273
214
|
- app/models/mdm/client.rb
|
|
274
215
|
- app/models/mdm/cred.rb
|
|
@@ -316,6 +257,7 @@ files:
|
|
|
316
257
|
- app/models/mdm/wmap_request.rb
|
|
317
258
|
- app/models/mdm/wmap_target.rb
|
|
318
259
|
- app/models/mdm/workspace.rb
|
|
260
|
+
- app/models/metasploit_data_models/automatic_exploitation.rb
|
|
319
261
|
- app/models/metasploit_data_models/automatic_exploitation/match.rb
|
|
320
262
|
- app/models/metasploit_data_models/automatic_exploitation/match_result.rb
|
|
321
263
|
- app/models/metasploit_data_models/automatic_exploitation/match_set.rb
|
|
@@ -476,7 +418,6 @@ files:
|
|
|
476
418
|
- lib/mdm/host/operating_system_normalization.rb
|
|
477
419
|
- lib/mdm/module.rb
|
|
478
420
|
- lib/metasploit_data_models.rb
|
|
479
|
-
- lib/metasploit_data_models/automatic_exploitation.rb
|
|
480
421
|
- lib/metasploit_data_models/base64_serializer.rb
|
|
481
422
|
- lib/metasploit_data_models/change_required_columns_to_null_false.rb
|
|
482
423
|
- lib/metasploit_data_models/engine.rb
|
|
@@ -497,6 +438,7 @@ files:
|
|
|
497
438
|
- lib/metasploit_data_models/search/visitor.rb
|
|
498
439
|
- lib/metasploit_data_models/serialized_prefs.rb
|
|
499
440
|
- lib/metasploit_data_models/version.rb
|
|
441
|
+
- lib/tasks/yard.rake
|
|
500
442
|
- metasploit_data_models.gemspec
|
|
501
443
|
- script/rails
|
|
502
444
|
- spec/app/models/mdm/api_key_spec.rb
|
|
@@ -599,6 +541,7 @@ files:
|
|
|
599
541
|
- spec/dummy/config/initializers/session_store.rb
|
|
600
542
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
601
543
|
- spec/dummy/config/routes.rb
|
|
544
|
+
- spec/dummy/db/structure.sql
|
|
602
545
|
- spec/dummy/lib/assets/.gitkeep
|
|
603
546
|
- spec/dummy/log/.gitkeep
|
|
604
547
|
- spec/dummy/public/404.html
|
|
@@ -664,7 +607,6 @@ files:
|
|
|
664
607
|
- spec/lib/metasploit_data_models/match/child_spec.rb
|
|
665
608
|
- spec/lib/metasploit_data_models/match/parent_spec.rb
|
|
666
609
|
- spec/lib/metasploit_data_models/version_spec.rb
|
|
667
|
-
- spec/lib/metasploit_data_models_spec.rb
|
|
668
610
|
- spec/spec_helper.rb
|
|
669
611
|
- spec/support/matchers/match_regex_exactly.rb
|
|
670
612
|
- spec/support/shared/contexts/rex/text.rb
|
|
@@ -804,6 +746,7 @@ test_files:
|
|
|
804
746
|
- spec/dummy/config/initializers/session_store.rb
|
|
805
747
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
806
748
|
- spec/dummy/config/routes.rb
|
|
749
|
+
- spec/dummy/db/structure.sql
|
|
807
750
|
- spec/dummy/lib/assets/.gitkeep
|
|
808
751
|
- spec/dummy/log/.gitkeep
|
|
809
752
|
- spec/dummy/public/404.html
|
|
@@ -869,7 +812,6 @@ test_files:
|
|
|
869
812
|
- spec/lib/metasploit_data_models/match/child_spec.rb
|
|
870
813
|
- spec/lib/metasploit_data_models/match/parent_spec.rb
|
|
871
814
|
- spec/lib/metasploit_data_models/version_spec.rb
|
|
872
|
-
- spec/lib/metasploit_data_models_spec.rb
|
|
873
815
|
- spec/spec_helper.rb
|
|
874
816
|
- spec/support/matchers/match_regex_exactly.rb
|
|
875
817
|
- spec/support/shared/contexts/rex/text.rb
|