Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/support/acceptance/session/php.rb
67653 views
1
require_relative './shared'
2
3
module Acceptance::Session::Php
4
PHP_METERPRETER = {
5
payloads: [
6
{
7
name: "php/meterpreter_reverse_tcp",
8
extension: ".php",
9
platforms: [:osx, :linux, :windows],
10
execute_cmd: ["php", "${payload_path}"],
11
generate_options: {
12
'-f': "raw"
13
},
14
datastore: {
15
global: {},
16
module: {
17
MeterpreterDebugBuild: true
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
[
41
:windows,
42
{
43
skip: [
44
:meterpreter_runtime_version,
45
:==,
46
"php5.3"
47
],
48
reason: "Skip PHP 5.3 as the tests timeout - due to cmd_exec taking 15 seconds for each call. Caused by failure to detect feof correctly - https://github.com/rapid7/metasploit-payloads/blame/c7f7bc2fc0b86e17c3bc078149c71745c5e478b3/php/meterpreter/meterpreter.php#L1127-L1145"
49
}
50
]
51
],
52
skipped: false,
53
lines: {
54
linux: {
55
known_failures: []
56
},
57
osx: {
58
known_failures: []
59
},
60
windows: {
61
known_failures: []
62
}
63
}
64
},
65
{
66
name: "post/test/cmd_exec",
67
platforms: [:linux, :osx, :windows],
68
skipped: false,
69
lines: {
70
linux: {
71
known_failures: []
72
},
73
osx: {
74
known_failures: []
75
},
76
windows: {
77
known_failures: [
78
]
79
}
80
}
81
},
82
{
83
name: "post/test/extapi",
84
platforms: [:linux, :osx, :windows],
85
skipped: false,
86
lines: {
87
linux: {
88
known_failures: []
89
},
90
osx: {
91
known_failures: []
92
},
93
windows: {
94
known_failures: []
95
}
96
}
97
},
98
{
99
name: "post/test/file",
100
platforms: [:linux, :osx, :windows],
101
skipped: false,
102
lines: {
103
linux: {
104
known_failures: [
105
"[-] FAILED: should read the binary data we just wrote"
106
]
107
},
108
osx: {
109
known_failures: [
110
"[-] FAILED: should read the binary data we just wrote"
111
]
112
},
113
windows: {
114
known_failures: [
115
"[-] [should delete a symbolic link target] FAILED: should delete a symbolic link target",
116
"[-] [should delete a symbolic link target] Exception: Rex::Post::Meterpreter::RequestError: stdapi_fs_delete_dir: Operation failed: 1",
117
"[-] FAILED: should read the binary data we just wrote"
118
]
119
}
120
}
121
},
122
{
123
name: "post/test/get_env",
124
platforms: [:linux, :osx, :windows],
125
skipped: false,
126
lines: {
127
linux: {
128
known_failures: []
129
},
130
osx: {
131
known_failures: []
132
},
133
windows: {
134
known_failures: []
135
}
136
}
137
},
138
{
139
name: "post/test/meterpreter",
140
platforms: [:linux, :osx, :windows],
141
skipped: false,
142
lines: {
143
linux: {
144
known_failures: []
145
},
146
osx: {
147
known_failures: [
148
"[-] FAILED: should return a list of processes"
149
]
150
},
151
windows: {
152
known_failures: []
153
}
154
}
155
},
156
{
157
name: "post/test/railgun",
158
platforms: [:linux, :osx, :windows],
159
skipped: false,
160
lines: {
161
linux: {
162
known_failures: []
163
},
164
osx: {
165
known_failures: []
166
},
167
windows: {
168
known_failures: []
169
}
170
}
171
},
172
{
173
name: "post/test/railgun_reverse_lookups",
174
platforms: [:linux, :osx, :windows],
175
skipped: false,
176
lines: {
177
linux: {
178
known_failures: []
179
},
180
osx: {
181
known_failures: []
182
},
183
windows: {
184
known_failures: []
185
}
186
}
187
},
188
{
189
name: "post/test/registry",
190
platforms: [
191
[
192
:linux,
193
{
194
skip: true,
195
reason: "Windows only test"
196
}
197
],
198
[
199
:osx,
200
{
201
skip: true,
202
reason: "Windows only test"
203
}
204
],
205
[
206
:windows,
207
{
208
skip: [
209
:meterpreter_runtime_version,
210
:==,
211
"php5.3"
212
],
213
reason: "Skip PHP 5.3 as the tests timeout - due to cmd_exec taking 15 seconds for each call. Caused by failure to detect feof correctly - https://github.com/rapid7/metasploit-payloads/blame/c7f7bc2fc0b86e17c3bc078149c71745c5e478b3/php/meterpreter/meterpreter.php#L1127-L1145"
214
}
215
]
216
],
217
skipped: false,
218
lines: {
219
linux: {
220
known_failures: []
221
},
222
osx: {
223
known_failures: []
224
},
225
windows: {
226
known_failures: []
227
}
228
}
229
},
230
{
231
name: "post/test/search",
232
platforms: [:linux, :osx, :windows],
233
skipped: false,
234
lines: {
235
linux: {
236
known_failures: []
237
},
238
osx: {
239
known_failures: []
240
},
241
windows: {
242
known_failures: []
243
}
244
}
245
},
246
{
247
name: "post/test/socket_channels",
248
platforms: [:linux, :osx, :windows],
249
skipped: false,
250
lines: {
251
linux: {
252
known_failures: [
253
"[-] FAILED: [UDP] Has the correct peer information",
254
*Acceptance::Session::Shared::SOCKET_CHANNEL_FLAKES
255
]
256
},
257
osx: {
258
known_failures: [
259
"[-] FAILED: [UDP] Has the correct peer information",
260
*Acceptance::Session::Shared::SOCKET_CHANNEL_FLAKES
261
]
262
},
263
windows: {
264
known_failures: [
265
"[-] FAILED: [UDP] Has the correct peer information",
266
*Acceptance::Session::Shared::SOCKET_CHANNEL_FLAKES
267
]
268
}
269
}
270
},
271
{
272
name: "post/test/unix",
273
platforms: [
274
:linux,
275
:osx,
276
[
277
:windows,
278
{
279
skip: true,
280
reason: "Unix only test"
281
}
282
]
283
],
284
skipped: false,
285
lines: {
286
linux: {
287
known_failures: []
288
},
289
osx: {
290
known_failures: []
291
},
292
windows: {
293
known_failures: []
294
}
295
}
296
}
297
]
298
}
299
end
300
301