关于镜像那些破事

 iptables -I INPUT -s IP地址 -j DROP
 /etc/rc.d/init.d/iptables restart 

运行这个命令
----------------------------------------------------------------------------------------------

<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); 

转载于:https://www.cnblogs.com/alex-13/p/4071890.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值