Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/support/acceptance/session/python.rb
31327 views
1
require_relative './shared'
2
3
module Acceptance::Session::Python
4
PYTHON_METERPRETER = {
5
payloads: [
6
{
7
name: "python/meterpreter_reverse_tcp",
8
extension: ".py",
9
platforms: [:osx, :linux, :windows],
10
execute_cmd: ["python", "${payload_path}"],
11
generate_options: {
12
'-f': "raw"
13
},
14
datastore: {
15
global: {},
16
module: {
17
MeterpreterTryToFork: false,
18
PythonMeterpreterDebug: true
19
}
20
}
21
}
22
],
23
module_tests: [
24
{
25
name: "post/test/services",
26
platforms: [
27
[
28
:linux,
29
{
30
skip: true,
31
reason: "Windows only test"
32
}
33
],
34
[
35
:osx,
36
{
37
skip: true,
38
reason: "Windows only test"
39
}
40
],
41
:windows
42
],
43
skipped: false,
44
lines: {
45
linux: {
46
known_failures: []
47
},
48
osx: {
49
known_failures: []
50
},
51
windows: {
52
known_failures: [
53
"[-] [should start W32Time] FAILED: should start W32Time",
54
"[-] [should start W32Time] Exception: RuntimeError: Could not open service. OpenServiceA error: FormatMessage failed to retrieve the error for value 0x6.",
55
"[-] [should stop W32Time] FAILED: should stop W32Time",
56
"[-] [should stop W32Time] Exception: RuntimeError: Could not open service. OpenServiceA error: FormatMessage failed to retrieve the error for value 0x6.",
57
"[-] [should list services] FAILED: should list services",
58
# Ruby 3.2
59
["[-] [should list services] Exception: NoMethodError: undefined method `service' for nil:NilClass", { flaky: true }],
60
# Ruby 3.4 - https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/#Compatibility%20issues
61
["[-] [should list services] Exception: NoMethodError: undefined method 'service' for nil", { flaky: true }],
62
"[-] [should return info on a given service winmgmt] FAILED: should return info on a given service winmgmt",
63
# Ruby 3.2
64
["[-] [should return info on a given service winmgmt] Exception: NoMethodError: undefined method `service' for nil:NilClass", { flaky: true }],
65
# Ruby 3.4 - https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/#Compatibility%20issues
66
["[-] [should return info on a given service winmgmt] Exception: NoMethodError: undefined method 'service' for nil", { flaky: true }],
67
"[-] FAILED: should create a service testes",
68
"[-] [should return info on the newly-created service testes] FAILED: should return info on the newly-created service testes",
69
# Ruby 3.2
70
["[-] [should return info on the newly-created service testes] Exception: NoMethodError: undefined method `service' for nil:NilClass", { flaky: true }],
71
# Ruby 3.4 - https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/#Compatibility%20issues
72
["[-] [should return info on the newly-created service testes] Exception: NoMethodError: undefined method 'service' for nil", { flaky: true }],
73
"[-] [should delete the new service testes] FAILED: should delete the new service testes",
74
"[-] [should delete the new service testes] Exception: RuntimeError: Could not open service. OpenServiceA error: FormatMessage failed to retrieve the error for value 0x6.",
75
"[-] [should return status on a given service winmgmt] FAILED: should return status on a given service winmgmt",
76
"[-] [should return status on a given service winmgmt] Exception: RuntimeError: Could not open service. OpenServiceA error: FormatMessage failed to retrieve the error for value 0x6.",
77
"[-] [should modify config on a given service] FAILED: should modify config on a given service",
78
"[-] [should modify config on a given service] Exception: RuntimeError: Could not open service. OpenServiceA error: FormatMessage failed to retrieve the error for value 0x6.",
79
"[-] FAILED: should start a disabled service",
80
"[-] [should restart a started service W32Time] FAILED: should restart a started service W32Time",
81
"[-] [should restart a started service W32Time] Exception: RuntimeError: Could not open service. OpenServiceA error: FormatMessage failed to retrieve the error for value 0x6."
82
]
83
}
84
}
85
},
86
{
87
name: "post/test/cmd_exec",
88
platforms: [:linux, :osx, :windows],
89
skipped: false,
90
lines: {
91
linux: {
92
known_failures: []
93
},
94
osx: {
95
known_failures: []
96
},
97
windows: {
98
known_failures: []
99
}
100
}
101
},
102
{
103
name: "post/test/extapi",
104
platforms: [:linux, :osx, :windows],
105
skipped: false,
106
lines: {
107
linux: {
108
known_failures: []
109
},
110
osx: {
111
known_failures: []
112
},
113
windows: {
114
known_failures: [
115
# Ruby 3.2
116
["[-] [should return clipboard jpg dimensions] FAILED: should return clipboard jpg dimensions", { flaky: true }],
117
["[-] [should return clipboard jpg dimensions] Exception: NoMethodError: undefined method `clipboard' for nil:NilClass", { flaky: true }],
118
["[-] [should download clipboard jpg data] FAILED: should download clipboard jpg data", { flaky: true }],
119
["[-] [should download clipboard jpg data] Exception: NoMethodError: undefined method `clipboard' for nil:NilClass", { flaky: true }],
120
# Ruby 3.4 - https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/#Compatibility%20issues
121
["[-] [should return clipboard jpg dimensions] FAILED: should return clipboard jpg dimensions", { flaky: true }],
122
["[-] [should return clipboard jpg dimensions] Exception: NoMethodError: undefined method 'clipboard' for nil", { flaky: true }],
123
["[-] [should download clipboard jpg data] FAILED: should download clipboard jpg data", { flaky: true }],
124
["[-] [should download clipboard jpg data] Exception: NoMethodError: undefined method 'clipboard' for nil", { flaky: true }],
125
]
126
}
127
}
128
},
129
{
130
name: "post/test/file",
131
platforms: [:linux, :osx, :windows],
132
skipped: false,
133
lines: {
134
linux: {
135
known_failures: []
136
},
137
osx: {
138
known_failures: []
139
},
140
windows: {
141
known_failures: []
142
}
143
}
144
},
145
{
146
name: "post/test/get_env",
147
platforms: [:linux, :osx, :windows],
148
skipped: false,
149
lines: {
150
linux: {
151
known_failures: []
152
},
153
osx: {
154
known_failures: []
155
},
156
windows: {
157
known_failures: []
158
}
159
}
160
},
161
{
162
name: "post/test/meterpreter",
163
platforms: [:linux, :osx, :windows],
164
skipped: false,
165
lines: {
166
linux: {
167
known_failures: []
168
},
169
osx: {
170
known_failures: []
171
},
172
windows: {
173
known_failures: [
174
]
175
}
176
}
177
},
178
{
179
name: "post/test/railgun",
180
platforms: [:linux, :osx, :windows],
181
skipped: false,
182
lines: {
183
linux: {
184
known_failures: []
185
},
186
osx: {
187
known_failures: []
188
},
189
windows: {
190
known_failures: []
191
}
192
}
193
},
194
{
195
name: "post/test/railgun_reverse_lookups",
196
platforms: [:linux, :osx, :windows],
197
skipped: false,
198
lines: {
199
linux: {
200
known_failures: []
201
},
202
osx: {
203
known_failures: []
204
},
205
windows: {
206
known_failures: []
207
}
208
}
209
},
210
{
211
name: "post/test/registry",
212
platforms: [
213
[
214
:linux,
215
{
216
skip: true,
217
reason: "Windows only test"
218
}
219
],
220
[
221
:osx,
222
{
223
skip: true,
224
reason: "Windows only test"
225
}
226
],
227
:windows
228
],
229
skipped: false,
230
lines: {
231
linux: {
232
known_failures: []
233
},
234
osx: {
235
known_failures: []
236
},
237
windows: {
238
known_failures: []
239
}
240
}
241
},
242
{
243
name: "post/test/search",
244
platforms: [:linux, :osx, :windows],
245
skipped: false,
246
lines: {
247
linux: {
248
known_failures: []
249
},
250
osx: {
251
known_failures: []
252
},
253
windows: {
254
known_failures: []
255
}
256
}
257
},
258
{
259
name: "post/test/socket_channels",
260
platforms: [:linux, :osx, :windows],
261
skipped: false,
262
lines: {
263
linux: {
264
known_failures: [
265
"[-] FAILED: [UDP] Has the correct peer information",
266
*Acceptance::Session::Shared::SOCKET_CHANNEL_FLAKES
267
]
268
},
269
osx: {
270
known_failures: [
271
"[-] FAILED: [UDP] Has the correct peer information",
272
*Acceptance::Session::Shared::SOCKET_CHANNEL_FLAKES
273
]
274
},
275
windows: {
276
known_failures: [
277
"[-] FAILED: [UDP] Has the correct peer information",
278
*Acceptance::Session::Shared::SOCKET_CHANNEL_FLAKES
279
]
280
}
281
}
282
},
283
{
284
name: "post/test/unix",
285
platforms: [
286
:linux,
287
:osx,
288
[
289
:windows,
290
{
291
skip: true,
292
reason: "Unix only test"
293
}
294
]
295
],
296
skipped: false,
297
lines: {
298
linux: {
299
known_failures: []
300
},
301
osx: {
302
known_failures: []
303
},
304
windows: {
305
known_failures: []
306
}
307
}
308
}
309
]
310
}
311
end
312
313