PHP 使用CURL库IP欺骗,隐藏真实客户端IP
2014-08-19 11:33
330 查看
<?php
error_reporting(0);
function curl_string ($url,$user_agent,$proxy){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_COOKIEJAR, "d:\cookies.txt");
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array('CLIENT-IP:125.210.188.36', 'X-FORWARDED-FOR:125.210.188.36')); //此处可以改为任意假IP
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
$url_page = "http://s4nd.no-ip.org/test/index.php";
$user_agent = "Mozilla/4.0";
$proxy = "http://125.210.188.36:80"; //此处为代理服务器IP和PORT
$string = curl_string($url_page,$user_agent,$proxy);
echo $string;
?>
访问curl_proxy.php
122.66.*.*是运行脚本服务器的IP,这样就实现了隐藏客户端真实IP的目的。
有的代理服务器会被HTTP_VIA方法侦测到使用了代理服务器,实际上透明代理和高级匿名代理有很大区别。
error_reporting(0);
function curl_string ($url,$user_agent,$proxy){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_COOKIEJAR, "d:\cookies.txt");
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array('CLIENT-IP:125.210.188.36', 'X-FORWARDED-FOR:125.210.188.36')); //此处可以改为任意假IP
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
$url_page = "http://s4nd.no-ip.org/test/index.php";
$user_agent = "Mozilla/4.0";
$proxy = "http://125.210.188.36:80"; //此处为代理服务器IP和PORT
$string = curl_string($url_page,$user_agent,$proxy);
echo $string;
?>
访问curl_proxy.php
122.66.*.*是运行脚本服务器的IP,这样就实现了隐藏客户端真实IP的目的。
有的代理服务器会被HTTP_VIA方法侦测到使用了代理服务器,实际上透明代理和高级匿名代理有很大区别。
相关文章推荐
- PHP 使用CURL库IP欺骗,隐藏真实客户端IP
- 使用PHP获取用户客户端真实IP的解决方案
- 使用PHP获取用户客户端真实IP的解决方案
- 使用apache 等反向代理后如何获得客户端的真实ip
- php 获取客户端的真实ip
- PHP获取客户端的真实IP
- PHP获得用户使用的代理服务器ip即真实ip
- PHP获得用户使用的代理服务器ip即真实ip
- php获得客户端真实ip
- PHP获取客户端的真实IP
- 使用php隐藏下载文件的真实地址
- PHP如何获取客户端真实IP
- PHP获取客户端真实 IP 地址
- [转载]PHP如何获取客户端真实IP
- loadunner使用socket协议来实现多客户端连接同一服务器脚本(使用到IP欺骗技术)
- PHP 获取客户端的ip、地理信息、浏览器信息、本地真实ip
- php 获取客户端的ip、地理信息、浏览器信息、本地真实ip
- php 获取客户端的ip、地理信息、浏览器信息、本地真实ip
- PHP如何获取客户端真实IP
- PHP获取客户端的真实IP