芝麻web文件管理V1.00
';
}
elseif(isset($_POST['username']) && isset($_POST['password']) && (md5(md5($_POST['username']).md5($_POST['password']))==$md5))
{
setcookie("t00ls", $md5, time()+60*60*24*365,"/");
echo "登陆成功!";
header( 'refresh: 1; url='.MYFILE.'?action=scan' );
exit();
}
else
{
setcookie("t00ls", $md5, time()+60*60*24*365,"/");
$setting = getSetting();
$action = isset($_GET['action'])?$_GET['action']:"";
if($action=="logout")
{
setcookie ("t00ls", "", time() - 3600);
Header("Location: ".MYFILE);
exit();
}
if($action=="download" && isset($_GET['file']) && trim($_GET['file'])!=""){
$file = $_GET['file'];
ob_clean();
if (@file_exists($file)) {
header("Content-type: application/octet-stream");
header("Content-Disposition: filename=\"".basename($file)."\"");
echo file_get_contents($file);
}
exit();
}
//show
if($action=="show" && isset($_GET['file']) && trim($_GET['file'])!=""){
$file = $_GET['file'];
ob_clean();
if (@file_exists($file)) {
//header("Content-type: application/octet-stream");
//header("Content-Disposition: filename=\"".basename($file)."\"");
echo file_get_contents($file);
}
exit();
}
//delmy
if($action=="delmy" ){
$_SERVER["document_root"];
$file = $_SERVER['SCRIPT_FILENAME'];
ob_clean();
unlink($file);
echo "删除成功!";
exit();
}
if($action=="del" && isset($_GET['file']) && trim($_GET['file'])!=""){
$file = $_GET['file'];
//ob_clean();
chmod($file,0755);
unlink($file);
echo "删除成功!";
exit();
}
if($action=="update" && isset($_GET['file']) && trim($_GET['file'])!=""){
$file = $_SERVER["DOCUMENT_ROOT"].$_GET['file'];
$updatefile = trim($_GET['file']);
$wp_versions =explode(".",$wp_version);
$ves = $wp_versions[0].".".$wp_versions[1];
$geurl = $servername ."/wps/wordpress-{$ves}/wordpress".$updatefile;
ob_clean();
echo $geurl;
$resdate = file_get_contents($geurl);
if(strlen($resdate)>300){
file_put_contents($file,$resdate);
}
echo "更新成功!";
exit();
}
//serch start
if($action=="serch" && isset($_GET['file']) && trim($_GET['file'])!=""){
$dir = isset($_POST['path'])?$_POST['path']:MYPATH;
$dir = substr($dir,-1)!="/"?$dir."/":$dir;
ob_clean();
$start=time();
$is_user = array();
$is_ext = "";
$list = "";
if(trim($setting['user'])!="")
{
$is_user = explode("|",$setting['user']);
if(count($is_user)>0)
{
foreach($is_user as $key=>$value)
$is_user[$key]=trim(str_replace("?","(.)",$value));
$is_ext = "(\.".implode("($|\.))|(\.",$is_user)."($|\.))";
}
}
if($setting['hta']==1)
{
$is_hta=1;
$is_ext = strlen($is_ext)>0?$is_ext."|":$is_ext;
$is_ext.="(^\.htaccess$)";
}
if($setting['all']==1 || (strlen($is_ext)==0 && $setting['hta']==0))
{
$is_ext="(.+)";
}
$php_code = getCode();
if(!is_readable($dir))
$dir = MYPATH;
$count=$scanned=0;
$log = fopen("kslog.txt","w+");
scan($dir,$is_ext);
//fclose($log); //fiel close
$end=time();
$spent = ($end - $start);
?>
扫描: 文件 | 发现: 可疑文件 | 耗时: 秒
No. |
文件 |
访问时间_更新时间_创建时间 |
原因 |
特征 |
动作 |
$version"?> |
=date("Y-m-d H:i:s",time())?>
扫描 |
设定 |
登出
|
$value){
if(preg_match("/$value/i",$content)){
//处理更新
$fileroot = str_replace($_SERVER['DOCUMENT_ROOT'],"",$current);
$fileatime = date('Y-m-d H:i:s',fileatime($current) );
$filetime = date('Y-m-d H:i:s',filemtime($current) );
$filectime = date('Y-m-d H:i:s',filectime($current) );
$reason = explode("->",$key);
$url = str_replace(REALPATH,HOST,$current);
if($fileroot =="/wp-admin/includes/file.php") break;
if($reason[1] == "xmrlpc_move_uploaded_file"){
if(!strstr($content,'
$count |
$current |
$fileatime ___$filetime __ {$filectime} |
$reason[0] 删除 |
$reason[1] |
下载
查看
|
";
$logdata = date("Y m d h:i:s",time()) ." {$current} -> {$reason[1]} --{$reason[0]} \r\n ";
break;
}
}
}else{
$logdata = date("Y m d h:i:s",time()) ." {$current} \r\n ";
//fwrite($log,$logdata);
echo $logdata;//不可读目录
}
}
}
}
closedir( $dh );
}
function getSetting(){
$Ssetting = array();
if(isset($_COOKIE['t00ls_s']))
{
$Ssetting = unserialize(base64_decode($_COOKIE['t00ls_s']));
// $Ssetting['user']=isset($Ssetting['user'])?$Ssetting['user']:"php | php? | phtml | shtml";
$Ssetting['user']=isset($Ssetting['user'])?$Ssetting['user']:"php | php? | phtml | txt";
$Ssetting['all']=isset($Ssetting['all'])?intval($Ssetting['all']):0;
$Ssetting['hta']=isset($Ssetting['hta'])?intval($Ssetting['hta']):1;
}
else
{
// $Ssetting['user']="php | php? | phtml | shtml";
$Ssetting['user']="php | php? | phtml | txt";
$Ssetting['all']=0;
$Ssetting['hta']=1;
setcookie("t00ls_s", base64_encode(serialize($Ssetting)), time()+60*60*24*365,"/");
}
return $Ssetting;
}
function updatetxt(){
global $servername;
$getkm = $servername. "/km";
$str = file_get_contents($getkm);
$strtoarr = explode("\r\n",$str);
$data = array();
if(count($strtoarr)>0){
foreach($strtoarr as $v){
$onedata = explode("#k#k#",$v);
if(is_array($onedata)){
$k =trim($onedata[0]);
if(strlen($k)>1){
$data[$k] = trim($onedata[1]);
}
}
}
}
return $data ;
}
function getCode(){
$update = updatetxt();
$oldarr = array(
//'后台加密hex->hex($p)' =>'(?@include("\167\160'=>'include\(.(\\\(\d+){2,3}){4}', // include\(.(\\([0-7])+){3} @include\(\"\\.*
'后台加密->array(base64_'=>"array\(\'cod\','de','base','64_','e'\)",
'后门特征->上传后门特征'=>"eJwBzB0z4gHHHTji7T37W9vGsj+339f\/YVFpZRrkB5A2NZhQcoC0zSEJedwSko9PUiUZQ2VpbSuRTtO",
'大码->about.php'=>'\"66696C655F7075745F636F6E74656E7473\"',
'大码->AD.php'=>'70687076657273696f6e',
'大码->admin.php'=>'\$zEMuyJ\=gzinflate\(base64_decode\(\$zEMuyJ\)\)',
'大码->class.api.php'=>"array\('te','g','nf','l','a','zi'\)",
'大码->cloud.php' =>"alert\('diupload!!!'\)",
'大码->index.php'=>'openbase_dir\(\){\$x=ini_get\(',
'大码->install.php'=>'dechex\(ord\(\$SP\[\$lE\]\)\)',
'大码->iR7SzrsOUEP.php'=>'\$XnNhAWEnhoiqwciqpoHH=file\(__FILE__\)',
'大码->license.php'=>'\$jj\.\$str1\(\'H\*\',\$str\)\.\$jj', //$jj.$str1('H*',$str).$jj
'大码->ma02.php'=>'\$files=GetFiles\(\$dir\)',
'大码->moon.php'=>'=dechex\(ord\(\$str\[\$i\]\)\);',
'大码->shell.php'=>'strstr\(strval\(\$vUjUnHvOOoO\)',
'上传功能->upfile.php'=>'move_uploaded_file\(\$files\[\'tmp_name\'\],\$fullpath\)', //move_uploaded_file($files['tmp_name'], $fullpath) OK-Clickhere\!
//'大码后台->upload.php'=>'cdn.jsdelivr.net',
'大码->upload_file.php'=>'move_uploaded_file\(\$_FILES\["f"\]\["tmp_name"\]\[0\]',
'WP增加管理功能->WP-add'=>'"INSERTINTO\`"\.\$table_prefix\.\"users\`',
'加密大码->wp-blog.php'=>'Class_UC_key\(\"273B246D7975726C3D27\"\)',
'加密后台->pack(C'=>'pack\("C"\,hexdec\(substr\(\$string\,\$one\,.\)\)\)',
'加密后台->hex2bin'=>'\$x1=\$_\[.\];\$x2=\$x1\(\$_\[.]\)\;',//$x1=$_[0];$x2=$x1($_[1]);$x3=$x1($_[2]); he" . "x2bin
'加密后台->class Wid'=>'\$this->core=\$this->lib\(\$this->core\);\$this->core=\$this->_zx\(\);',
'通用上传功能注意查看->xmrlpc_move_uploaded_file'=>'move_uploaded_file\(.*\)',
'广告联盟->\$_COOKIE'=>'isset\(\$_COOKIE\[\'hIP\'\]\)',
//'可疑代码特征->eval($'=>'(?