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

yipeiwu_com6年前PHP代码库
废话不多说,上代码
复制代码 代码如下:

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;

相关文章

解析Win7 XAMPP apache无法启动的问题

在Win7上下载安装版的xampp,无法启动apache ,现象是短暂显示了running标志之后就停止了,日志显示WARNING:terminating worker thread 0...

Zend Studio for Eclipse的java.lang.NullPointerException错误的解决方法

当然这个东西很吃内存,配置差点的就不推荐使用了. 最近用的时候, 发现, 建立PHP工程后,再打开 Zend Studio for Eclipse就出现这个错误 An internal...

PHP实现的62进制转10进制,10进制转62进制函数示例

本文实例讲述了PHP实现的62进制转10进制,10进制转62进制函数。分享给大家供大家参考,具体如下: 百度出来的无法使用,只好自己写,有bug的地方欢迎留言,感谢 function...

/etc/php-fpm.d/www.conf 配置注意事项

1、php-fpm 配置文件里 rlimit_files的值 要与系统的打开连接数一致 1)查看系统文件打开连接数 [root@iZ94eveq0q4Z ~]# ulimit -n 65...

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下 复制代码 代码如下: yum -y install gcc gcc-c++ automake autoconf libtool glibc make libmcryp...