metasploit-model 0.28.0-java → 0.29.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/config/locales/en.yml +0 -171
- data/lib/metasploit/model.rb +0 -2
- data/lib/metasploit/model/spec.rb +0 -130
- data/lib/metasploit/model/version.rb +1 -1
- data/spec/support/shared/examples/metasploit/model/search/operator/help.rb +4 -6
- data/spec/support/shared/examples/metasploit/model/translation.rb +1 -1
- data/spec/support/shared/examples/search_association.rb +1 -1
- data/spec/support/shared/examples/search_with.rb +4 -2
- metadata +2 -348
- data/app/models/metasploit/model/module/ancestor/spec/template.rb +0 -125
- data/app/models/metasploit/model/module/class/spec/template.rb +0 -92
- data/app/models/metasploit/model/module/instance/spec/template.rb +0 -97
- data/app/models/metasploit/model/spec/template.rb +0 -277
- data/app/validators/derivation_validator.rb +0 -17
- data/app/validators/dynamic_length_validator.rb +0 -45
- data/lib/metasploit/model/architecture.rb +0 -342
- data/lib/metasploit/model/author.rb +0 -54
- data/lib/metasploit/model/authority.rb +0 -141
- data/lib/metasploit/model/authority/bid.rb +0 -10
- data/lib/metasploit/model/authority/cve.rb +0 -10
- data/lib/metasploit/model/authority/msb.rb +0 -10
- data/lib/metasploit/model/authority/osvdb.rb +0 -10
- data/lib/metasploit/model/authority/pmasa.rb +0 -10
- data/lib/metasploit/model/authority/secunia.rb +0 -10
- data/lib/metasploit/model/authority/us_cert_vu.rb +0 -10
- data/lib/metasploit/model/authority/waraxe.rb +0 -31
- data/lib/metasploit/model/authority/zdi.rb +0 -10
- data/lib/metasploit/model/derivation.rb +0 -109
- data/lib/metasploit/model/derivation/full_name.rb +0 -19
- data/lib/metasploit/model/email_address.rb +0 -124
- data/lib/metasploit/model/module.rb +0 -20
- data/lib/metasploit/model/module/action.rb +0 -52
- data/lib/metasploit/model/module/ancestor.rb +0 -491
- data/lib/metasploit/model/module/ancestor/spec.rb +0 -6
- data/lib/metasploit/model/module/architecture.rb +0 -34
- data/lib/metasploit/model/module/author.rb +0 -40
- data/lib/metasploit/model/module/class.rb +0 -403
- data/lib/metasploit/model/module/class/spec.rb +0 -6
- data/lib/metasploit/model/module/handler.rb +0 -29
- data/lib/metasploit/model/module/instance.rb +0 -622
- data/lib/metasploit/model/module/instance/spec.rb +0 -6
- data/lib/metasploit/model/module/path.rb +0 -159
- data/lib/metasploit/model/module/platform.rb +0 -32
- data/lib/metasploit/model/module/rank.rb +0 -85
- data/lib/metasploit/model/module/reference.rb +0 -32
- data/lib/metasploit/model/module/stance.rb +0 -16
- data/lib/metasploit/model/module/target.rb +0 -78
- data/lib/metasploit/model/module/target/architecture.rb +0 -34
- data/lib/metasploit/model/module/target/platform.rb +0 -34
- data/lib/metasploit/model/module/type.rb +0 -38
- data/lib/metasploit/model/platform.rb +0 -246
- data/lib/metasploit/model/real_pathname.rb +0 -16
- data/lib/metasploit/model/reference.rb +0 -104
- data/spec/app/models/metasploit/model/module/ancestor/spec/template_spec.rb +0 -174
- data/spec/app/models/metasploit/model/module/class/spec/template_spec.rb +0 -222
- data/spec/app/models/metasploit/model/module/instance/spec/template_spec.rb +0 -201
- data/spec/app/models/metasploit/model/search/operator/deprecated/app_spec.rb +0 -62
- data/spec/app/models/metasploit/model/search/operator/deprecated/author_spec.rb +0 -197
- data/spec/app/models/metasploit/model/search/operator/deprecated/authority_spec.rb +0 -135
- data/spec/app/models/metasploit/model/search/operator/deprecated/platform_spec.rb +0 -124
- data/spec/app/models/metasploit/model/search/operator/deprecated/ref_spec.rb +0 -387
- data/spec/app/models/metasploit/model/search/operator/deprecated/text_spec.rb +0 -399
- data/spec/app/models/metasploit/model/spec/template_spec.rb +0 -23
- data/spec/app/validators/derivation_validator_spec.rb +0 -92
- data/spec/app/validators/dynamic_length_validator_spec.rb +0 -293
- data/spec/dummy/app/models/dummy/architecture.rb +0 -92
- data/spec/dummy/app/models/dummy/author.rb +0 -15
- data/spec/dummy/app/models/dummy/authority.rb +0 -130
- data/spec/dummy/app/models/dummy/email_address.rb +0 -27
- data/spec/dummy/app/models/dummy/module/action.rb +0 -25
- data/spec/dummy/app/models/dummy/module/ancestor.rb +0 -67
- data/spec/dummy/app/models/dummy/module/architecture.rb +0 -19
- data/spec/dummy/app/models/dummy/module/author.rb +0 -28
- data/spec/dummy/app/models/dummy/module/class.rb +0 -69
- data/spec/dummy/app/models/dummy/module/instance.rb +0 -209
- data/spec/dummy/app/models/dummy/module/path.rb +0 -64
- data/spec/dummy/app/models/dummy/module/platform.rb +0 -19
- data/spec/dummy/app/models/dummy/module/rank.rb +0 -44
- data/spec/dummy/app/models/dummy/module/reference.rb +0 -19
- data/spec/dummy/app/models/dummy/module/target.rb +0 -62
- data/spec/dummy/app/models/dummy/module/target/architecture.rb +0 -19
- data/spec/dummy/app/models/dummy/module/target/platform.rb +0 -19
- data/spec/dummy/app/models/dummy/platform.rb +0 -58
- data/spec/dummy/app/models/dummy/reference.rb +0 -31
- data/spec/dummy/spec/factories/dummy/architectures.rb +0 -13
- data/spec/dummy/spec/factories/dummy/authorities.rb +0 -32
- data/spec/dummy/spec/factories/dummy/authors.rb +0 -8
- data/spec/dummy/spec/factories/dummy/email_addresses.rb +0 -8
- data/spec/dummy/spec/factories/dummy/module/actions.rb +0 -13
- data/spec/dummy/spec/factories/dummy/module/ancestors.rb +0 -45
- data/spec/dummy/spec/factories/dummy/module/architectures.rb +0 -35
- data/spec/dummy/spec/factories/dummy/module/authors.rb +0 -10
- data/spec/dummy/spec/factories/dummy/module/classes.rb +0 -40
- data/spec/dummy/spec/factories/dummy/module/instances.rb +0 -86
- data/spec/dummy/spec/factories/dummy/module/paths.rb +0 -16
- data/spec/dummy/spec/factories/dummy/module/platforms.rb +0 -35
- data/spec/dummy/spec/factories/dummy/module/ranks.rb +0 -14
- data/spec/dummy/spec/factories/dummy/module/references.rb +0 -17
- data/spec/dummy/spec/factories/dummy/module/target/architectures.rb +0 -40
- data/spec/dummy/spec/factories/dummy/module/target/platforms.rb +0 -41
- data/spec/dummy/spec/factories/dummy/module/targets.rb +0 -46
- data/spec/dummy/spec/factories/dummy/platforms.rb +0 -3
- data/spec/dummy/spec/factories/dummy/references.rb +0 -26
- data/spec/factories/metasploit/model/architectures.rb +0 -6
- data/spec/factories/metasploit/model/authorities.rb +0 -28
- data/spec/factories/metasploit/model/authors.rb +0 -9
- data/spec/factories/metasploit/model/email_addresses.rb +0 -14
- data/spec/factories/metasploit/model/module/actions.rb +0 -9
- data/spec/factories/metasploit/model/module/ancestors.rb +0 -180
- data/spec/factories/metasploit/model/module/architectures.rb +0 -15
- data/spec/factories/metasploit/model/module/classes.rb +0 -47
- data/spec/factories/metasploit/model/module/handlers.rb +0 -3
- data/spec/factories/metasploit/model/module/instances.rb +0 -83
- data/spec/factories/metasploit/model/module/paths.rb +0 -51
- data/spec/factories/metasploit/model/module/platforms.rb +0 -15
- data/spec/factories/metasploit/model/module/ranks.rb +0 -9
- data/spec/factories/metasploit/model/module/references.rb +0 -11
- data/spec/factories/metasploit/model/module/stances.rb +0 -3
- data/spec/factories/metasploit/model/module/targets.rb +0 -22
- data/spec/factories/metasploit/model/module/types.rb +0 -5
- data/spec/factories/metasploit/model/references.rb +0 -88
- data/spec/lib/metasploit/model/architecture_spec.rb +0 -52
- data/spec/lib/metasploit/model/author_spec.rb +0 -6
- data/spec/lib/metasploit/model/authority/bid_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/cve_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/msb_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/osvdb_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/pmasa_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/secunia_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/us_cert_vu_spec.rb +0 -17
- data/spec/lib/metasploit/model/authority/waraxe_spec.rb +0 -51
- data/spec/lib/metasploit/model/authority/zdi_spec.rb +0 -21
- data/spec/lib/metasploit/model/authority_spec.rb +0 -10
- data/spec/lib/metasploit/model/derivation/full_name_spec.rb +0 -75
- data/spec/lib/metasploit/model/derivation_spec.rb +0 -217
- data/spec/lib/metasploit/model/email_address_spec.rb +0 -19
- data/spec/lib/metasploit/model/module/action_spec.rb +0 -6
- data/spec/lib/metasploit/model/module/ancestor_spec.rb +0 -6
- data/spec/lib/metasploit/model/module/architecture_spec.rb +0 -9
- data/spec/lib/metasploit/model/module/author_spec.rb +0 -6
- data/spec/lib/metasploit/model/module/class_spec.rb +0 -19
- data/spec/lib/metasploit/model/module/handler_spec.rb +0 -61
- data/spec/lib/metasploit/model/module/instance_spec.rb +0 -183
- data/spec/lib/metasploit/model/module/path_spec.rb +0 -6
- data/spec/lib/metasploit/model/module/platform_spec.rb +0 -9
- data/spec/lib/metasploit/model/module/rank_spec.rb +0 -29
- data/spec/lib/metasploit/model/module/reference_spec.rb +0 -9
- data/spec/lib/metasploit/model/module/stance_spec.rb +0 -30
- data/spec/lib/metasploit/model/module/target/architecture_spec.rb +0 -9
- data/spec/lib/metasploit/model/module/target/platform_spec.rb +0 -9
- data/spec/lib/metasploit/model/module/target_spec.rb +0 -9
- data/spec/lib/metasploit/model/module/type_spec.rb +0 -125
- data/spec/lib/metasploit/model/platform_spec.rb +0 -100
- data/spec/lib/metasploit/model/reference_spec.rb +0 -21
- data/spec/support/shared/contexts/metasploit/model/module/ancestor/contents/metasploit_module.rb +0 -12
- data/spec/support/shared/contexts/metasploit/model/module/ancestor/factory/contents.rb +0 -10
- data/spec/support/shared/contexts/metasploit/model/module/ancestor/factory/contents/metasploit_module.rb +0 -15
- data/spec/support/shared/examples/derives.rb +0 -115
- data/spec/support/shared/examples/metasploit/model/architecture.rb +0 -425
- data/spec/support/shared/examples/metasploit/model/architecture/seed.rb +0 -25
- data/spec/support/shared/examples/metasploit/model/author.rb +0 -27
- data/spec/support/shared/examples/metasploit/model/authority.rb +0 -124
- data/spec/support/shared/examples/metasploit/model/authority/seed.rb +0 -49
- data/spec/support/shared/examples/metasploit/model/email_address.rb +0 -220
- data/spec/support/shared/examples/metasploit/model/module/action.rb +0 -26
- data/spec/support/shared/examples/metasploit/model/module/ancestor.rb +0 -2004
- data/spec/support/shared/examples/metasploit/model/module/ancestor/payload_factory.rb +0 -63
- data/spec/support/shared/examples/metasploit/model/module/architecture.rb +0 -36
- data/spec/support/shared/examples/metasploit/model/module/author.rb +0 -29
- data/spec/support/shared/examples/metasploit/model/module/class.rb +0 -1514
- data/spec/support/shared/examples/metasploit/model/module/handler.rb +0 -21
- data/spec/support/shared/examples/metasploit/model/module/instance.rb +0 -1384
- data/spec/support/shared/examples/metasploit/model/module/instance/class_methods.rb +0 -537
- data/spec/support/shared/examples/metasploit/model/module/instance/is_not_stanced_with_module_type.rb +0 -22
- data/spec/support/shared/examples/metasploit/model/module/instance/is_stanced_with_module_type.rb +0 -38
- data/spec/support/shared/examples/metasploit/model/module/instance/validates/dynamic_length_of.rb +0 -131
- data/spec/support/shared/examples/metasploit/model/module/path.rb +0 -493
- data/spec/support/shared/examples/metasploit/model/module/platform.rb +0 -36
- data/spec/support/shared/examples/metasploit/model/module/rank.rb +0 -92
- data/spec/support/shared/examples/metasploit/model/module/reference.rb +0 -16
- data/spec/support/shared/examples/metasploit/model/module/target.rb +0 -29
- data/spec/support/shared/examples/metasploit/model/module/target/architecture.rb +0 -56
- data/spec/support/shared/examples/metasploit/model/module/target/platform.rb +0 -56
- data/spec/support/shared/examples/metasploit/model/platform.rb +0 -213
- data/spec/support/shared/examples/metasploit/model/real_pathname.rb +0 -29
- data/spec/support/shared/examples/metasploit/model/reference.rb +0 -410
- data/spec/support/shared/examples/search/query/metasploit/model/search/operator/deprecated/app.rb +0 -44
- data/spec/support/shared/examples/search/query/metasploit/model/search/operator/deprecated/authority.rb +0 -72
- data/spec/support/templates/metasploit/model/module/ancestors/_attributes.rb.erb +0 -9
- data/spec/support/templates/metasploit/model/module/ancestors/_methods.rb.erb +0 -8
- data/spec/support/templates/metasploit/model/module/ancestors/_validations.rb.erb +0 -6
- data/spec/support/templates/metasploit/model/module/ancestors/base.rb.erb +0 -3
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_auxiliary.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_encoder.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_exploit.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_non_payload.rb.erb +0 -5
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_nop.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_payload.rb.erb +0 -4
- data/spec/support/templates/metasploit/model/module/ancestors/module_types/_post.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/ancestors/payload_types/_handled.rb.erb +0 -20
- data/spec/support/templates/metasploit/model/module/ancestors/payload_types/_single.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/ancestors/payload_types/_stage.rb.erb +0 -0
- data/spec/support/templates/metasploit/model/module/ancestors/payload_types/_stager.rb.erb +0 -1
- data/spec/support/templates/metasploit/model/module/classes/_methods.rb.erb +0 -9
@@ -1,425 +0,0 @@
|
|
1
|
-
Metasploit::Model::Spec.shared_examples_for 'Architecture' do
|
2
|
-
subject(:architecture) do
|
3
|
-
# Architecture, don't have a factory, they have a sequence and can't use sequence generated architectures because
|
4
|
-
# validators so tightly constraint values.
|
5
|
-
architecture_class.new
|
6
|
-
end
|
7
|
-
|
8
|
-
context 'CONSTANTS' do
|
9
|
-
context 'ABBREVIATIONS' do
|
10
|
-
subject(:abbreviations) do
|
11
|
-
described_class::ABBREVIATIONS
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should be an Array<String>' do
|
15
|
-
abbreviations.should be_an Array
|
16
|
-
|
17
|
-
abbreviations.each do |architecture|
|
18
|
-
architecture.should be_a String
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should include both endians of ARM' do
|
23
|
-
abbreviations.should include('armbe')
|
24
|
-
abbreviations.should include('armle')
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should include 32-bit and 64-bit versions of Cell Broadband Engine Architecture' do
|
28
|
-
abbreviations.should include('cbea')
|
29
|
-
abbreviations.should include('cbea64')
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'should include cmd for command shell' do
|
33
|
-
abbreviations.should include('cmd')
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'should include dalvik for Dalvik Virtual Machine in Google Android' do
|
37
|
-
abbreviations.should include('dalvik')
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'should include firefox for Firefox privileged javascript API' do
|
41
|
-
expect(abbreviations).to include('firefox')
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should include java for Java Virtual Machine' do
|
45
|
-
abbreviations.should include('java')
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'should include endian-ware MIPS' do
|
49
|
-
abbreviations.should include('mipsbe')
|
50
|
-
abbreviations.should include('mipsle')
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'should include nodejs for javascript code that requires NodeJS extensions/libraries' do
|
54
|
-
expect(abbreviations).to include('nodejs')
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should include php for PHP code' do
|
58
|
-
abbreviations.should include('php')
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'should include 32-bit and 64-bit PowerPC' do
|
62
|
-
abbreviations.should include('ppc')
|
63
|
-
abbreviations.should include('ppc64')
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'should include python for Python code' do
|
67
|
-
abbreviations.should include('python')
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'should include ruby for Ruby code' do
|
71
|
-
abbreviations.should include('ruby')
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'should include sparc for Sparc' do
|
75
|
-
abbreviations.should include('sparc')
|
76
|
-
end
|
77
|
-
|
78
|
-
it 'should include tty for Terminals' do
|
79
|
-
abbreviations.should include('tty')
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'should include 32-bit and 64-bit x86' do
|
83
|
-
abbreviations.should include('x86')
|
84
|
-
abbreviations.should include('x86_64')
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
context 'BITS' do
|
89
|
-
subject(:bits) do
|
90
|
-
described_class::BITS
|
91
|
-
end
|
92
|
-
|
93
|
-
it { should include 32 }
|
94
|
-
it { should include 64 }
|
95
|
-
end
|
96
|
-
|
97
|
-
context 'ENDIANNESSES' do
|
98
|
-
subject(:endiannesses) do
|
99
|
-
described_class::ENDIANNESSES
|
100
|
-
end
|
101
|
-
|
102
|
-
it { should include 'big' }
|
103
|
-
it { should include 'little' }
|
104
|
-
end
|
105
|
-
|
106
|
-
context 'FAMILIES' do
|
107
|
-
subject(:families) do
|
108
|
-
described_class::FAMILIES
|
109
|
-
end
|
110
|
-
|
111
|
-
it 'includes arm for big- and little-endian ARM' do
|
112
|
-
expect(families).to include('arm')
|
113
|
-
end
|
114
|
-
|
115
|
-
it 'includes cbea for 32- and 64-bit Cell Broadband Engine Architecture' do
|
116
|
-
expect(families).to include('cbea')
|
117
|
-
end
|
118
|
-
|
119
|
-
it 'includes javascript for NodeJS' do
|
120
|
-
expect(families).to include('javascript')
|
121
|
-
end
|
122
|
-
|
123
|
-
it 'includes mips for big and little-endian MIPS' do
|
124
|
-
expect(families).to include('mips')
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'includes ppc for 32- and 64-bit PPC' do
|
128
|
-
expect(families).to include('ppc')
|
129
|
-
end
|
130
|
-
|
131
|
-
it 'includes sparc for sparc' do
|
132
|
-
expect(families).to include('sparc')
|
133
|
-
end
|
134
|
-
|
135
|
-
it 'includes x86 for x86 and x86_64' do
|
136
|
-
expect(families).to include('x86')
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
context 'search' do
|
142
|
-
context 'attributes' do
|
143
|
-
it_should_behave_like 'search_attribute',
|
144
|
-
:abbreviation,
|
145
|
-
type: {
|
146
|
-
set: :string
|
147
|
-
}
|
148
|
-
it_should_behave_like 'search_attribute',
|
149
|
-
:bits,
|
150
|
-
type: {
|
151
|
-
set: :integer
|
152
|
-
}
|
153
|
-
it_should_behave_like 'search_attribute',
|
154
|
-
:endianness,
|
155
|
-
type: {
|
156
|
-
set: :string
|
157
|
-
}
|
158
|
-
it_should_behave_like 'search_attribute',
|
159
|
-
:family,
|
160
|
-
type: {
|
161
|
-
set: :string
|
162
|
-
}
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
context 'seeds' do
|
167
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
168
|
-
:abbreviation => 'armbe',
|
169
|
-
:bits => 32,
|
170
|
-
:endianness => 'big',
|
171
|
-
:family => 'arm',
|
172
|
-
:summary => 'Little-endian ARM'
|
173
|
-
|
174
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
175
|
-
:abbreviation => 'armle',
|
176
|
-
:bits => 32,
|
177
|
-
:endianness => 'little',
|
178
|
-
:family => 'arm',
|
179
|
-
:summary => 'Big-endian ARM'
|
180
|
-
|
181
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
182
|
-
:abbreviation => 'cbea',
|
183
|
-
:bits => 32,
|
184
|
-
:endianness => 'big',
|
185
|
-
:family => 'cbea',
|
186
|
-
:summary => '32-bit Cell Broadband Engine Architecture'
|
187
|
-
|
188
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
189
|
-
:abbreviation => 'cbea64',
|
190
|
-
:bits => 64,
|
191
|
-
:endianness => 'big',
|
192
|
-
:family => 'cbea',
|
193
|
-
:summary => '64-bit Cell Broadband Engine Architecture'
|
194
|
-
|
195
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
196
|
-
:abbreviation => 'cmd',
|
197
|
-
:bits => nil,
|
198
|
-
:endianness => nil,
|
199
|
-
:family => nil,
|
200
|
-
:summary => 'Command Injection'
|
201
|
-
|
202
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
203
|
-
:abbreviation => 'dalvik',
|
204
|
-
:bits => nil,
|
205
|
-
:endianness => nil,
|
206
|
-
:family => nil,
|
207
|
-
:summary => 'Dalvik process virtual machine used in Google Android'
|
208
|
-
|
209
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
210
|
-
abbreviation: 'firefox',
|
211
|
-
bits: nil,
|
212
|
-
endianness: nil,
|
213
|
-
family: 'javascript',
|
214
|
-
summary: "Firefox's privileged javascript API"
|
215
|
-
|
216
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
217
|
-
:abbreviation => 'java',
|
218
|
-
:bits => nil,
|
219
|
-
:endianness => 'big',
|
220
|
-
:family => nil,
|
221
|
-
:summary => 'Java'
|
222
|
-
|
223
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
224
|
-
:abbreviation => 'mipsbe',
|
225
|
-
:bits => 32,
|
226
|
-
:endianness => 'big',
|
227
|
-
:family => 'mips',
|
228
|
-
:summary => 'Big-endian MIPS'
|
229
|
-
|
230
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
231
|
-
:abbreviation => 'mipsle',
|
232
|
-
:bits => 32,
|
233
|
-
:endianness => 'little',
|
234
|
-
:family => 'mips',
|
235
|
-
:summary => 'Little-endian MIPS'
|
236
|
-
|
237
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
238
|
-
:abbreviation => 'nodejs',
|
239
|
-
:bits => nil,
|
240
|
-
:endianness => nil,
|
241
|
-
:family => 'javascript',
|
242
|
-
:summary => 'NodeJS'
|
243
|
-
|
244
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
245
|
-
:abbreviation => 'php',
|
246
|
-
:bits => nil,
|
247
|
-
:endianness => nil,
|
248
|
-
:family => nil,
|
249
|
-
:summary => 'PHP'
|
250
|
-
|
251
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
252
|
-
:abbreviation => 'ppc',
|
253
|
-
:bits => 32,
|
254
|
-
:endianness => 'big',
|
255
|
-
:family => 'ppc',
|
256
|
-
:summary => '32-bit Peformance Optimization With Enhanced RISC - Performance Computing'
|
257
|
-
|
258
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
259
|
-
:abbreviation => 'ppc64',
|
260
|
-
:bits => 64,
|
261
|
-
:endianness => 'big',
|
262
|
-
:family => 'ppc',
|
263
|
-
:summary => '64-bit Performance Optimization With Enhanced RISC - Performance Computing'
|
264
|
-
|
265
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
266
|
-
:abbreviation => 'python',
|
267
|
-
:bits => nil,
|
268
|
-
:endianness => nil,
|
269
|
-
:family => nil,
|
270
|
-
:summary => 'Python'
|
271
|
-
|
272
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
273
|
-
:abbreviation => 'ruby',
|
274
|
-
:bits => nil,
|
275
|
-
:endianness => nil,
|
276
|
-
:family => nil,
|
277
|
-
:summary => 'Ruby'
|
278
|
-
|
279
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
280
|
-
:abbreviation => 'sparc',
|
281
|
-
:bits => nil,
|
282
|
-
:endianness => nil,
|
283
|
-
:family => 'sparc',
|
284
|
-
:summary => 'Scalable Processor ARChitecture'
|
285
|
-
|
286
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
287
|
-
:abbreviation => 'tty',
|
288
|
-
:bits => nil,
|
289
|
-
:endianness => nil,
|
290
|
-
:family => nil,
|
291
|
-
:summary => '*nix terminal'
|
292
|
-
|
293
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
294
|
-
:abbreviation => 'x86',
|
295
|
-
:bits => 32,
|
296
|
-
:endianness => 'little',
|
297
|
-
:family => 'x86',
|
298
|
-
:summary => '32-bit x86'
|
299
|
-
|
300
|
-
it_should_behave_like 'Metasploit::Model::Architecture seed',
|
301
|
-
:abbreviation => 'x86_64',
|
302
|
-
:bits => 64,
|
303
|
-
:endianness => 'little',
|
304
|
-
:family => 'x86',
|
305
|
-
:summary => '64-bit x86'
|
306
|
-
end
|
307
|
-
|
308
|
-
context 'validations' do
|
309
|
-
context 'abbreviation' do
|
310
|
-
# have to test inclusion validation manually because
|
311
|
-
# ensure_inclusion_of(:abbreviation).in_array(described_class::ABBREVIATIONS).allow_nil does not work with
|
312
|
-
# additional uniqueness validation.
|
313
|
-
context 'ensure inclusion of abbreviation in ABBREVIATIONS' do
|
314
|
-
let(:error) do
|
315
|
-
'is not included in the list'
|
316
|
-
end
|
317
|
-
|
318
|
-
abbreviations = [
|
319
|
-
'armbe',
|
320
|
-
'armle',
|
321
|
-
'cbea',
|
322
|
-
'cbea64',
|
323
|
-
'cmd',
|
324
|
-
'dalvik',
|
325
|
-
'firefox',
|
326
|
-
'java',
|
327
|
-
'mipsbe',
|
328
|
-
'mipsle',
|
329
|
-
'nodejs',
|
330
|
-
'php',
|
331
|
-
'ppc',
|
332
|
-
'ppc64',
|
333
|
-
'python',
|
334
|
-
'ruby',
|
335
|
-
'sparc',
|
336
|
-
'tty',
|
337
|
-
'x86',
|
338
|
-
'x86_64'
|
339
|
-
]
|
340
|
-
|
341
|
-
abbreviations.each do |abbreviation|
|
342
|
-
context "with #{abbreviation.inspect}" do
|
343
|
-
before(:each) do
|
344
|
-
architecture.abbreviation = abbreviation
|
345
|
-
|
346
|
-
architecture.valid?
|
347
|
-
end
|
348
|
-
|
349
|
-
it 'should not record error on abbreviation' do
|
350
|
-
architecture.errors[:abbreviation].should_not include(error)
|
351
|
-
end
|
352
|
-
end
|
353
|
-
end
|
354
|
-
end
|
355
|
-
end
|
356
|
-
|
357
|
-
it { should ensure_inclusion_of(:bits).in_array(described_class::BITS).allow_nil }
|
358
|
-
it { should ensure_inclusion_of(:endianness).in_array(described_class::ENDIANNESSES).allow_nil }
|
359
|
-
it { should ensure_inclusion_of(:family).in_array(described_class::FAMILIES).allow_nil }
|
360
|
-
it { should validate_presence_of(:summary) }
|
361
|
-
end
|
362
|
-
|
363
|
-
context 'abbreviation_set' do
|
364
|
-
subject(:abbreviation_set) do
|
365
|
-
architecture_class.abbreviation_set
|
366
|
-
end
|
367
|
-
|
368
|
-
it { should_not include nil }
|
369
|
-
it { should include 'armbe' }
|
370
|
-
it { should include 'armle' }
|
371
|
-
it { should include 'cbea' }
|
372
|
-
it { should include 'cbea64' }
|
373
|
-
it { should include 'cmd' }
|
374
|
-
it { should include 'dalvik' }
|
375
|
-
it { should include 'firefox' }
|
376
|
-
it { should include 'java' }
|
377
|
-
it { should include 'mipsbe' }
|
378
|
-
it { should include 'mipsle' }
|
379
|
-
it { should include 'nodejs' }
|
380
|
-
it { should include 'php' }
|
381
|
-
it { should include 'ppc' }
|
382
|
-
it { should include 'ppc64' }
|
383
|
-
it { should include 'python' }
|
384
|
-
it { should include 'ruby' }
|
385
|
-
it { should include 'sparc' }
|
386
|
-
it { should include 'tty' }
|
387
|
-
it { should include 'x86' }
|
388
|
-
it { should include 'x86_64' }
|
389
|
-
end
|
390
|
-
|
391
|
-
context 'bits_set' do
|
392
|
-
subject(:bits_set) do
|
393
|
-
architecture_class.bits_set
|
394
|
-
end
|
395
|
-
|
396
|
-
it { should_not include nil }
|
397
|
-
it { should include 32 }
|
398
|
-
it { should include 64 }
|
399
|
-
end
|
400
|
-
|
401
|
-
context 'endianness_set' do
|
402
|
-
subject(:endianness_set) do
|
403
|
-
architecture_class.endianness_set
|
404
|
-
end
|
405
|
-
|
406
|
-
it { should_not include nil }
|
407
|
-
it { should include 'big' }
|
408
|
-
it { should include 'little' }
|
409
|
-
end
|
410
|
-
|
411
|
-
context 'family_set' do
|
412
|
-
subject(:family_set) do
|
413
|
-
architecture_class.family_set
|
414
|
-
end
|
415
|
-
|
416
|
-
it { should_not include nil }
|
417
|
-
it { should include 'arm' }
|
418
|
-
it { should include 'cbea' }
|
419
|
-
it { should include 'mips' }
|
420
|
-
it { should include 'javascript' }
|
421
|
-
it { should include 'ppc' }
|
422
|
-
it { should include 'sparc' }
|
423
|
-
it { should include 'x86' }
|
424
|
-
end
|
425
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
shared_examples_for 'Metasploit::Model::Architecture seed' do |attributes={}|
|
2
|
-
attributes.assert_valid_keys(:abbreviation, :bits, :endianness, :family, :summary)
|
3
|
-
|
4
|
-
context_abbreviation = attributes.fetch(:abbreviation)
|
5
|
-
|
6
|
-
context "with #{context_abbreviation}" do
|
7
|
-
subject do
|
8
|
-
seed
|
9
|
-
end
|
10
|
-
|
11
|
-
# put in a let so that `let(:seed)` has access to abbreviation.
|
12
|
-
let(:abbreviation) do
|
13
|
-
context_abbreviation
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should exist' do
|
17
|
-
seed.should_not be_nil
|
18
|
-
end
|
19
|
-
|
20
|
-
its(:bits) { should == attributes.fetch(:bits) }
|
21
|
-
its(:endianness) { should == attributes.fetch(:endianness) }
|
22
|
-
its(:family) { should == attributes.fetch(:family) }
|
23
|
-
its(:summary) { should == attributes.fetch(:summary) }
|
24
|
-
end
|
25
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
Metasploit::Model::Spec.shared_examples_for 'Author' do
|
2
|
-
context 'factories' do
|
3
|
-
context author_factory do
|
4
|
-
subject(author_factory) do
|
5
|
-
FactoryGirl.build(author_factory)
|
6
|
-
end
|
7
|
-
|
8
|
-
it { should be_valid }
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
context 'mass assignment security' do
|
13
|
-
it { should allow_mass_assignment_of(:name) }
|
14
|
-
end
|
15
|
-
|
16
|
-
context 'search' do
|
17
|
-
context 'attributes' do
|
18
|
-
it_should_behave_like 'search_attribute', :name, :type => :string
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
context 'validations' do
|
23
|
-
context 'name' do
|
24
|
-
it { should validate_presence_of :name }
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|