metasploit_data_models 0.24.0 → 0.24.1.pre.rspec.pre.3.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +3 -3
- data/Gemfile +1 -3
- data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
- data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
- data/app/validators/password_is_strong_validator.rb +1 -1
- data/lib/mdm/host/operating_system_normalization.rb +0 -10
- data/lib/metasploit_data_models/version.rb +2 -2
- data/metasploit_data_models.gemspec +1 -1
- data/spec/app/models/mdm/api_key_spec.rb +1 -3
- data/spec/app/models/mdm/client_spec.rb +9 -11
- data/spec/app/models/mdm/cred_spec.rb +42 -54
- data/spec/app/models/mdm/event_spec.rb +21 -23
- data/spec/app/models/mdm/exploit_attempt_spec.rb +19 -21
- data/spec/app/models/mdm/exploited_host_spec.rb +11 -13
- data/spec/app/models/mdm/host_detail_spec.rb +15 -17
- data/spec/app/models/mdm/host_spec.rb +261 -260
- data/spec/app/models/mdm/host_tag_spec.rb +6 -8
- data/spec/app/models/mdm/listener_spec.rb +30 -32
- data/spec/app/models/mdm/loot_spec.rb +21 -23
- data/spec/app/models/mdm/macro_spec.rb +1 -3
- data/spec/app/models/mdm/mod_ref_spec.rb +1 -3
- data/spec/app/models/mdm/module/action_spec.rb +10 -12
- data/spec/app/models/mdm/module/arch_spec.rb +10 -12
- data/spec/app/models/mdm/module/author_spec.rb +22 -17
- data/spec/app/models/mdm/module/detail_spec.rb +184 -75
- data/spec/app/models/mdm/module/mixin_spec.rb +10 -12
- data/spec/app/models/mdm/module/platform_spec.rb +10 -12
- data/spec/app/models/mdm/module/ref_spec.rb +10 -12
- data/spec/app/models/mdm/module/target_spec.rb +13 -15
- data/spec/app/models/mdm/nexpose_console_spec.rb +35 -37
- data/spec/app/models/mdm/note_spec.rb +23 -25
- data/spec/app/models/mdm/profile_spec.rb +1 -3
- data/spec/app/models/mdm/ref_spec.rb +10 -12
- data/spec/app/models/mdm/route_spec.rb +6 -8
- data/spec/app/models/mdm/service_spec.rb +38 -40
- data/spec/app/models/mdm/session_event_spec.rb +10 -12
- data/spec/app/models/mdm/session_spec.rb +13 -15
- data/spec/app/models/mdm/tag_spec.rb +29 -29
- data/spec/app/models/mdm/task_cred_spec.rb +9 -11
- data/spec/app/models/mdm/task_host_spec.rb +9 -11
- data/spec/app/models/mdm/task_service_spec.rb +9 -11
- data/spec/app/models/mdm/task_session_spec.rb +7 -9
- data/spec/app/models/mdm/task_spec.rb +27 -29
- data/spec/app/models/mdm/user_spec.rb +17 -19
- data/spec/app/models/mdm/vuln_attempt_spec.rb +14 -16
- data/spec/app/models/mdm/vuln_detail_spec.rb +26 -28
- data/spec/app/models/mdm/vuln_ref_spec.rb +8 -10
- data/spec/app/models/mdm/vuln_spec.rb +24 -26
- data/spec/app/models/mdm/web_form_spec.rb +11 -13
- data/spec/app/models/mdm/web_page_spec.rb +19 -21
- data/spec/app/models/mdm/web_site_spec.rb +21 -23
- data/spec/app/models/mdm/web_vuln_spec.rb +63 -65
- data/spec/app/models/mdm/wmap_request_spec.rb +1 -3
- data/spec/app/models/mdm/wmap_target_spec.rb +1 -3
- data/spec/app/models/mdm/workspace_spec.rb +97 -100
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +3 -5
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +13 -15
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +1 -3
- data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +1 -3
- data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +10 -12
- data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +4 -6
- data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +21 -23
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +9 -11
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +21 -23
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +4 -6
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +22 -15
- data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +4 -6
- data/spec/app/models/metasploit_data_models/module_run_spec.rb +1 -3
- data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +18 -20
- data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +6 -8
- data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +8 -10
- data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +8 -10
- data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +2 -4
- data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +8 -10
- data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +6 -8
- data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +9 -11
- data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +5 -7
- data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +17 -19
- data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +5 -7
- data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +61 -23
- data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +8 -10
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +54 -46
- data/spec/dummy/db/structure.sql +1 -0
- data/spec/lib/base64_serializer_spec.rb +19 -19
- data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +18 -12
- data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +4 -6
- data/spec/lib/metasploit_data_models/match/child_spec.rb +2 -4
- data/spec/lib/metasploit_data_models/match/parent_spec.rb +4 -6
- data/spec/lib/metasploit_data_models/version_spec.rb +3 -5
- data/spec/spec_helper.rb +72 -6
- 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 +7 -6
- metadata +6 -6
@@ -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
|
-
detail.supports_stance
|
9
|
+
expect(detail.supports_stance?).to eq(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 { is_expected.to 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 { is_expected.to 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 { is_expected.to 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 { is_expected.to 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 { is_expected.to 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
|
-
visitor.
|
16
|
+
expect(visitor).to receive(:visit).with(node).and_call_original
|
17
17
|
|
18
18
|
children.each do |child|
|
19
|
-
visitor.
|
19
|
+
expect(visitor).to 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
|
-
visitor.
|
28
|
+
expect(visitor).to 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
|
-
visitor.
|
32
|
+
allow(visitor).to receive(:visit).with(child).and_return(child_visit)
|
33
33
|
child_visits.concat(child_visit)
|
34
34
|
end
|
35
35
|
|
36
|
-
visit.
|
36
|
+
expect(visit).to eq(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
|
-
visitor.
|
14
|
-
visitor.
|
13
|
+
expect(visitor).to receive(:visit).with(node).and_call_original
|
14
|
+
expect(visitor).to 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
|
-
visitor.
|
22
|
-
visitor.
|
21
|
+
expect(visitor).to receive(:visit).with(node).and_call_original
|
22
|
+
allow(visitor).to receive(:visit).with(operator).and_return(operator_visit)
|
23
23
|
|
24
|
-
visit.
|
24
|
+
expect(visit).to eq(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
|
-
visitor.attribute_visitor.
|
21
|
+
expect(visitor.attribute_visitor).to 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
|
-
visitor.attribute_visitor.
|
28
|
+
allow(visitor.attribute_visitor).to receive(:visit).with(operator).and_return(attribute)
|
29
29
|
|
30
|
-
attribute.
|
30
|
+
expect(attribute).to 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
|
-
visitor.
|
19
|
+
expect(visitor).to receive(:visit).with(node).and_call_original
|
20
20
|
|
21
21
|
children.each do |child|
|
22
|
-
visitor.
|
22
|
+
expect(visitor).to 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
|
-
visitor.
|
29
|
+
allow(visitor).to receive(: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
|
-
visitor.
|
34
|
+
allow(visitor).to receive(:visit).with(child).and_return(child_visit)
|
35
35
|
child_visits << child_visit
|
36
36
|
end
|
37
37
|
|
@@ -43,8 +43,9 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with Met
|
|
43
43
|
arel_pair = root
|
44
44
|
end
|
45
45
|
|
46
|
-
arel_pair.
|
46
|
+
expect(arel_pair).to be_a arel_class
|
47
47
|
|
48
|
-
expect(
|
48
|
+
expect(arel_pair.left).to eq(child_visits[0])
|
49
|
+
expect(arel_pair.right).to eq(child_visits[1])
|
49
50
|
end
|
50
51
|
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.1.pre.rspec.pre.3.pre.1
|
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-05-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|
@@ -123,14 +123,14 @@ dependencies:
|
|
123
123
|
requirements:
|
124
124
|
- - "~>"
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.
|
126
|
+
version: 0.30.1
|
127
127
|
type: :runtime
|
128
128
|
prerelease: false
|
129
129
|
version_requirements: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - "~>"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
133
|
+
version: 0.30.1
|
134
134
|
- !ruby/object:Gem::Dependency
|
135
135
|
name: railties
|
136
136
|
requirement: !ruby/object:Gem::Requirement
|
@@ -636,9 +636,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
636
636
|
version: '2.1'
|
637
637
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
638
638
|
requirements:
|
639
|
-
- - "
|
639
|
+
- - ">"
|
640
640
|
- !ruby/object:Gem::Version
|
641
|
-
version:
|
641
|
+
version: 1.3.1
|
642
642
|
requirements: []
|
643
643
|
rubyforge_project:
|
644
644
|
rubygems_version: 2.4.3
|