解析PHP跨站刷票的实现代码
2018-10-12 13:58
519 查看
废话不多说,上代码
function curlrequest($url, $postfield,$referer='',$cookie='') {
////www.jb51.net
$ip= rand(100, 244).'.'.rand(100, 244).'.'.rand(100, 244).'.'.rand(100, 244);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfield);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$ip)); //构造IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //构造来路
$data = curl_exec($ch); //运行curl
curl_close($ch);
return $data;
}
$url='http://xxxxx/vote.php';
$ref='http://xxxxx/index.php';
$cookies='';//构造你的cookies
$postfield=array(
'information_id'=>201204211839164950
);
$postfield = http_build_query($postfield);
$result = curlrequest($url, $postfield,$ref,$cookies);
echo $result;
您可能感兴趣的文章:
相关文章推荐
- 解析PHP跨站刷票的实现代码
- php中使用parse_url()对网址进行解析的实现代码(parse_url详解)
- 微博短链接解析ShortUrl【PHP代码实现】
- 解析PHP留言本模块主要功能的函数说明(代码可实现)
- 解析php DOMElement 操作xml 文档的实现代码
- PHP实现抓取页面与代码解析
- Nginx 配置实现web解析php代码 过程记录
- 用php解析html的实现代码
- 解析PHP获取当前网址及域名的实现代码
- php中使用parse_url()对网址进行解析的实现代码(parse_url详解)
- PHP实现的防止跨站和xss攻击代码【来自阿里云】
- PHP跨站刷票代码
- php UBB 解析实现代码
- 解析php DOMElement 操作xml 文档的实现代码
- php点赞效果的制作代码+解析(jQuery+Ajax+PHP实现“赞”)
- 解析PHP计算页面执行时间的实现代码
- 解析PHP留言本模块主要功能的函数说明(代码可实现)