时时商务社区

标题: 解析PHP跨站刷票的实现代码 [打印本页]

作者: 阿情    时间: 2018-2-14 08:17

            废话不多说,上代码
[U]复制代码[/U] 代码如下:
function curlrequest($url, $postfield,$referer='',$cookie='') {
//http://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和XSS跨站攻击的防范
  • php安全开发 添加随机字符串验证,防止伪造跨站请求
  • php跨站攻击实例分析
  • ThinkPHP2.x防范XSS跨站攻击的方法
  • PHP实现表单提交数据的验证处理功能【防SQL注入和XSS攻击等】
  • 整理php防注入和XSS攻击通用过滤
  • xss防御之php利用httponly防xss攻击
  • php过滤XSS攻击的函数
  • 细谈php中SQL注入攻击与XSS攻击
  • PHP中防止SQL注入攻击和XSS攻击的两个简单方法
  • PHP实现的防止跨站和xss攻击代码【来自阿里云】
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2