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