CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/support/acceptance/session/php.rb
Views: 11784
1
module Acceptance::Session
2
PHP_METERPRETER = {
3
payloads: [
4
{
5
name: "php/meterpreter_reverse_tcp",
6
extension: ".php",
7
platforms: [:osx, :linux, :windows],
8
execute_cmd: ["php", "${payload_path}"],
9
generate_options: {
10
'-f': "raw"
11
},
12
datastore: {
13
global: {},
14
module: {
15
MeterpreterDebugBuild: true
16
}
17
}
18
}
19
],
20
module_tests: [
21
{
22
name: "post/test/services",
23
platforms: [
24
[
25
:linux,
26
{
27
skip: true,
28
reason: "Windows only test"
29
}
30
],
31
[
32
:osx,
33
{
34
skip: true,
35
reason: "Windows only test"
36
}
37
],
38
[
39
:windows,
40
{
41
skip: [
42
:meterpreter_runtime_version,
43
:==,
44
"php5.3"
45
],
46
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"
47
}
48
]
49
],
50
skipped: false,
51
lines: {
52
linux: {
53
known_failures: []
54
},
55
osx: {
56
known_failures: []
57
},
58
windows: {
59
known_failures: []
60
}
61
}
62
},
63
{
64
name: "post/test/cmd_exec",
65
platforms: [:linux, :osx, :windows],
66
skipped: false,
67
lines: {
68
linux: {
69
known_failures: []
70
},
71
osx: {
72
known_failures: []
73
},
74
windows: {
75
known_failures: [
76
]
77
}
78
}
79
},
80
{
81
name: "post/test/extapi",
82
platforms: [:linux, :osx, :windows],
83
skipped: false,
84
lines: {
85
linux: {
86
known_failures: []
87
},
88
osx: {
89
known_failures: []
90
},
91
windows: {
92
known_failures: []
93
}
94
}
95
},
96
{
97
name: "post/test/file",
98
platforms: [:linux, :osx, :windows],
99
skipped: false,
100
lines: {
101
linux: {
102
known_failures: [
103
"[-] FAILED: should read the binary data we just wrote"
104
]
105
},
106
osx: {
107
known_failures: [
108
"[-] FAILED: should read the binary data we just wrote"
109
]
110
},
111
windows: {
112
known_failures: [
113
"[-] [should delete a symbolic link target] FAILED: should delete a symbolic link target",
114
"[-] [should delete a symbolic link target] Exception: Rex::Post::Meterpreter::RequestError: stdapi_fs_delete_dir: Operation failed: 1",
115
"[-] FAILED: should read the binary data we just wrote"
116
]
117
}
118
}
119
},
120
{
121
name: "post/test/get_env",
122
platforms: [:linux, :osx, :windows],
123
skipped: false,
124
lines: {
125
linux: {
126
known_failures: []
127
},
128
osx: {
129
known_failures: []
130
},
131
windows: {
132
known_failures: []
133
}
134
}
135
},
136
{
137
name: "post/test/meterpreter",
138
platforms: [:linux, :osx, :windows],
139
skipped: false,
140
lines: {
141
linux: {
142
known_failures: []
143
},
144
osx: {
145
known_failures: [
146
"[-] FAILED: should return a list of processes"
147
]
148
},
149
windows: {
150
known_failures: []
151
}
152
}
153
},
154
{
155
name: "post/test/railgun",
156
platforms: [:linux, :osx, :windows],
157
skipped: false,
158
lines: {
159
linux: {
160
known_failures: []
161
},
162
osx: {
163
known_failures: []
164
},
165
windows: {
166
known_failures: []
167
}
168
}
169
},
170
{
171
name: "post/test/railgun_reverse_lookups",
172
platforms: [:linux, :osx, :windows],
173
skipped: false,
174
lines: {
175
linux: {
176
known_failures: []
177
},
178
osx: {
179
known_failures: []
180
},
181
windows: {
182
known_failures: []
183
}
184
}
185
},
186
{
187
name: "post/test/registry",
188
platforms: [
189
[
190
:linux,
191
{
192
skip: true,
193
reason: "Windows only test"
194
}
195
],
196
[
197
:osx,
198
{
199
skip: true,
200
reason: "Windows only test"
201
}
202
],
203
[
204
:windows,
205
{
206
skip: [
207
:meterpreter_runtime_version,
208
:==,
209
"php5.3"
210
],
211
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"
212
}
213
]
214
],
215
skipped: false,
216
lines: {
217
linux: {
218
known_failures: []
219
},
220
osx: {
221
known_failures: []
222
},
223
windows: {
224
known_failures: []
225
}
226
}
227
},
228
{
229
name: "post/test/search",
230
platforms: [:linux, :osx, :windows],
231
skipped: false,
232
lines: {
233
linux: {
234
known_failures: []
235
},
236
osx: {
237
known_failures: []
238
},
239
windows: {
240
known_failures: []
241
}
242
}
243
},
244
{
245
name: "post/test/unix",
246
platforms: [
247
:linux,
248
:osx,
249
[
250
:windows,
251
{
252
skip: true,
253
reason: "Unix only test"
254
}
255
]
256
],
257
skipped: false,
258
lines: {
259
linux: {
260
known_failures: []
261
},
262
osx: {
263
known_failures: []
264
},
265
windows: {
266
known_failures: []
267
}
268
}
269
}
270
]
271
}
272
end
273
274