解析PHP跨站刷票的实现代码
程序员文章站
2022-03-08 10:48:21
废话不多说,上代码复制代码 代码如下:function curlrequest($url, $postfield,$referer='',$cookie='') { &nb...
废话不多说,上代码
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;
复制代码 代码如下:
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;
上一篇: 游戏手机都汗颜!OPPO Reno5几个小功能太实用了
下一篇: 苹果关闭iOS 12.2降级通道!