网络编程 
首页 > 网络编程 > 浏览文章

解析PHP跨站刷票的实现代码

(编辑:jimmy 日期: 2024/10/13 浏览:3 次 )
废话不多说,上代码
复制代码 代码如下:
function curlrequest($url, $postfield,$referer='',$cookie='') {
 //https://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 SPL标准库的用法(遍历目录,查找固定条件的文件)
一句话新闻
Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。