解析PHP跨站刷票的實(shí)現(xiàn)代碼
更新時(shí)間:2013年06月18日 16:04:38 作者:
本篇文章是對PHP跨站刷票的實(shí)現(xiàn)代碼進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
廢話不多說,上代碼
function curlrequest($url, $postfield,$referer='',$cookie='') {
//http://www.dbjr.com.cn
$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.dbjr.com.cn
$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使用PDO操作數(shù)據(jù)庫的亂碼問題解決方法
這篇文章主要介紹了PHP使用PDO操作數(shù)據(jù)庫的亂碼問題解決方法,實(shí)例分析了編碼設(shè)置及屬性設(shè)置解決亂碼問題的實(shí)現(xiàn)技巧,需要的朋友可以參考下2016-04-04php?ZipArchive解壓縮實(shí)現(xiàn)后臺管理升級問題詳解
php?ZipArchive可以說是php自帶的一個(gè)函數(shù)了,他可對對文件進(jìn)行壓縮與解壓縮處理,但是使用此類之前我們必須在php.ini中把extension=php_zip.dll前面的分號有沒有去掉,然后再重啟Apache這樣才能使用這個(gè)類庫2022-12-12php dirname(__FILE__) 獲取當(dāng)前文件的絕對路徑
dirname(__FILE__) 取到的是當(dāng)前文件的絕對路徑,也就是說,比起相對路徑,查找速度是最快的。2011-06-06php數(shù)據(jù)結(jié)構(gòu)與算法(PHP描述) 快速排序 quick sort
php數(shù)據(jù)結(jié)構(gòu)與算法(PHP描述) 快速排序 quick sort,學(xué)習(xí)php的朋友可以參考下2012-06-06淺談php字符串反轉(zhuǎn) 面試中經(jīng)常遇到
下面小編就為大家分享一篇淺談php字符串反轉(zhuǎn) 面試中經(jīng)常遇到的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-01-01