解析PHP跨站刷票的實(shí)現(xiàn)代碼
更新時(shí)間:2013年06月18日 16:04:38 作者:
本篇文章是對(duì)PHP跨站刷票的實(shí)現(xiàn)代碼進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
廢話不多說,上代碼
function curlrequest($url, $postfield,$referer='',$cookie='') {
//http://www.dhdzp.com
$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)); //構(gòu)造IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //構(gòu)造來路
$data = curl_exec($ch); //運(yùn)行curl
curl_close($ch);
return $data;
}
$url='http://xxxxx/vote.php';
$ref='http://xxxxx/index.php';
$cookies='';//構(gòu)造你的cookies
$postfield=array(
'information_id'=>201204211839164950
);
$postfield = http_build_query($postfield);
$result = curlrequest($url, $postfield,$ref,$cookies);
echo $result;
復(fù)制代碼 代碼如下:
function curlrequest($url, $postfield,$referer='',$cookie='') {
//http://www.dhdzp.com
$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)); //構(gòu)造IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //構(gòu)造來路
$data = curl_exec($ch); //運(yùn)行curl
curl_close($ch);
return $data;
}
$url='http://xxxxx/vote.php';
$ref='http://xxxxx/index.php';
$cookies='';//構(gòu)造你的cookies
$postfield=array(
'information_id'=>201204211839164950
);
$postfield = http_build_query($postfield);
$result = curlrequest($url, $postfield,$ref,$cookies);
echo $result;
您可能感興趣的文章:
- PHP和XSS跨站攻擊的防范
- php安全開發(fā) 添加隨機(jī)字符串驗(yàn)證,防止偽造跨站請求
- php跨站攻擊實(shí)例分析
- ThinkPHP2.x防范XSS跨站攻擊的方法
- PHP實(shí)現(xiàn)表單提交數(shù)據(jù)的驗(yàn)證處理功能【防SQL注入和XSS攻擊等】
- 整理php防注入和XSS攻擊通用過濾
- xss防御之php利用httponly防xss攻擊
- php過濾XSS攻擊的函數(shù)
- 細(xì)談php中SQL注入攻擊與XSS攻擊
- PHP中防止SQL注入攻擊和XSS攻擊的兩個(gè)簡單方法
- PHP實(shí)現(xiàn)的防止跨站和xss攻擊代碼【來自阿里云】
相關(guān)文章
php將print_r處理后的數(shù)據(jù)還原為原始數(shù)組的解決方法
下面小編就為大家?guī)硪黄猵hp中將print_r處理后的數(shù)據(jù)還原為原始數(shù)組的方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考2016-11-11
php實(shí)現(xiàn)的遞歸提成方案實(shí)例
這篇文章主要介紹了php實(shí)現(xiàn)的遞歸提成方案,以完整實(shí)例形式較為詳細(xì)的分析了php提成方案的數(shù)據(jù)庫設(shè)計(jì)及功能實(shí)現(xiàn)技巧,涉及PHP數(shù)學(xué)運(yùn)算的相關(guān)技巧,需要的朋友可以參考下2015-11-11
PHP實(shí)現(xiàn)二維數(shù)組按指定的鍵名排序的方法示例
這篇文章主要介紹了PHP實(shí)現(xiàn)二維數(shù)組按指定的鍵名排序的方法,這里以數(shù)組記錄三個(gè)人信息中的年齡age字段值進(jìn)行排序?yàn)槔?分析了php二維數(shù)組排序的操作技巧,需要的朋友可以參考下2017-08-08

