简单的PHP刷投票,让你高居榜首!
代码如下:
header('Content-type: text/html; charset=gb2312');
//随机生成IP
$ip1 = rand(101, 255).'.';
$ip2 = rand(1, 255).'.';
$ip3 = rand(1, 255).'.';
$ip4 = rand(1, 255);
$ip = $ip1 . $ip2 . $ip3 . $ip4;
$clientIp = 'CLIENT-IP:'.$ip;
$xforwarded = 'X-FORWARDED-FOR:'.$ip;
//设置目标和来源
$url = 'http://www.dunhuangwomen.org.cn/vote/Vote.asp?id=67';
$referer = 'http://www.dunhuangwomen.org.cn/vote/list.asp?id=2';
//Curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //目标
curl_setopt($ch, CURLOPT_HTTPHEADER, array($xforwarded, $clientIp)); //构造IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //来源
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$ret = curl_exec($ch);
curl_close($ch);
echo $ret;
?>
分析:
1、仿造IP,网站有限制一个IP在一天只可以投一次
2、填写来源,网站会判断请求的来源是否合法路径
其他就是Curl的常规选项。
1万+

被折叠的 条评论
为什么被折叠?



