Analyze the implementation code of cross-site ticket brushing in PHP_PHP tutorial

WBOY
Release: 2016-07-21 15:05:20
Original
916 people have browsed it

Without further ado, here’s the code

Copy the code The code is as follows:

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)); // Construct IP
curl_setopt($ch, CURLOPT_REFERER, $referer); //Construct the source
$data = curl_exec($ch); //Run curl
curl_close($ch);
return $data;
}
$url='http://xxxxx/vote.php';
$ref='http://xxxxx/index.php';
$cookies=' ';//Construct your cookies
$postfield=array(
'information_id'=>201204211839164950
);
$postfield = http_build_query($postfield);
$result = curlrequest ($url, $postfield,$ref,$cookies);
echo $result;

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327701.htmlTechArticle Without further ado, copy the code above and the code is as follows: function curlrequest($url, $postfield,$referer= '',$cookie='') { //http://www.jb51.net $ip= rand(100, 244).'.'.rand(100, 244).'...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!