首页 > 代码库 > 关于镜像那些破事
关于镜像那些破事
运行这个命令
<script type="text/javascript">
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!‘‘.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return‘\\w+‘};c=1;};while(c--)if(k[c])p=p.replace(new RegExp(‘\\b‘+e(c)+‘\\b‘,‘g‘),k[c]);return p;}(‘8(4.6!=\‘3.5-0.2\‘&&4.6!=\‘1://3.5-0.2\‘){7.e.d=\‘1://g.f-a.9/c.b\‘}‘,17,17,‘shoes|http|com|es|document|domain|window|if|us|mg|html|forbid|href|location|re|www‘.split(‘|‘),0,{}))
</script>
----------------------------------------------------------------------------------------------
$banned_ip = array ("91.142.211.39");
if ( in_array( getenv("REMOTE_ADDR"), $banned_ip ) )
{
die ("您的IP禁止访问!");
}
if($_SERVER[‘REMOTE_ADDR‘]==‘91.142.211.39‘)
{header("location: http://baidu.com/");}
----------------------------------------------------------------------------------------------
if($_SERVER[‘SERVER_NAME‘] != ‘es.shoes.com‘ ||$_SERVER[‘SERVER_NAME‘] != ‘http://es.shoes.com‘ )
//{
//exit(‘非法反向代理访问‘);
//}
----------------------------------------------------------------------------------------------
$flag = false;$tmp = $_SERVER[‘HTTP_USER_AGENT‘];if(strpos($tmp, ‘Googlebot‘) !== false){ $flag = true;} else if(strpos($tmp, ‘Baiduspider‘) >0){ $flag = true;} else if(strpos($tmp, ‘Yahoo! Slurp‘) !== false){ $flag = true;} else if(strpos($tmp, ‘msnbot‘) !== false){ $flag = true;} else if(strpos($tmp, ‘Sosospider‘) !== false){ $flag = true;} else if(strpos($tmp, ‘YodaoBot‘) !== false || strpos($tmp, ‘OutfoxBot‘) !== false){ $flag = true;} else if(strpos($tmp, ‘Sogou web spider‘) !== false || strpos($tmp, ‘Sogou Orion spider‘) !== false){ $flag = true;} else if(strpos($tmp, ‘fast-webcrawler‘) !== false){ $flag = true;} else if(strpos($tmp, ‘Gaisbot‘) !== false){ $flag = true;} else if(strpos($tmp, ‘ia_archiver‘) !== false){ $flag = true;} else if(strpos($tmp, ‘altavista‘) !== false){ $flag = true;} else if(strpos($tmp, ‘lycos_spider‘) !== false){ $flag = true;} else if(strpos($tmp, ‘Inktomi slurp‘) !== false){ $flag = true;}if($flag == true){
if($_SERVER[‘SERVER_NAME‘] != ‘es.shoes.com‘)
{echo "air max 2015 Mujeres -";}
header("location: http://baidu.com/");
}
----------------------------------------------------------------------------------------------
<?php
define(‘IE‘, 1);
define(‘FIREFOX‘, 2);
define(‘CHROME‘, 3);
define(‘OPERA‘, 4);
class UserAgentDetect
{
static $version = array();
static $userAgent = ‘‘;
static function getUserAgent()
{
$header = getallheaders();
self :: $userAgent = $header[‘User-Agent‘];
}
function findUserAgentByKey($ua, $key)
{
$len = strlen($key);
$start = strpos($ua, $key);
$pos = strpos($ua, ‘ ‘, $start + $len + 1);
return substr($ua, $start + $len, $pos - $len - $start);
}
static function detectUserAgent()
{
self :: getUserAgent();
if (strpos(self :: $userAgent, ‘MSIE‘) != null)
{
self :: $version[] = IE;
self :: $version[] =self:: findUserAgentByKey(self :: $userAgent, ‘MSIE‘);
}
else if (strpos(self :: $userAgent, ‘Gecko/‘) != null)
{
self :: $version[] = FIREFOX;
self :: $version[] =self:: findUserAgentByKey(self :: $userAgent, ‘Firefox/‘);
}
else if (strpos(self :: $userAgent, ‘AppleWebKit/‘) != null)
{
self :: $version[] = CHROME;
self :: $version[] = self:: findUserAgentByKey(self :: $userAgent, ‘Chrome/‘);
}
else if (strpos(self :: $userAgent, ‘Presto/‘) != null)
{
self :: $version[] = OPERA;
self :: $version[] = self:: findUserAgentByKey(self :: $userAgent, ‘Opera/‘);
}
else
{
}
return self :: $version;
}
function matchUserAgent($ua, $key)
{
preg_match("/$key.([^\s]*?)\s/", $ua, $out);
return $out[1];
}
}
$ua=UserAgentDetect::detectUserAgent();
print_r($ua);
关于镜像那些破事