Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use HTTP::Request;
- use LWP::UserAgent;
- if(!$ARGV[3])
- {
- print "\n\n##################################";
- print "\n# Apache-Home Finder by localh0t #";
- print "\n##################################";
- print "\n\nUso: perl $0 [WEBSITE] [USERS LIST] [DIRECTORY LIST] [PATH TO SAVE (HTML)]";
- print "\nEx : perl $0 http://www.website.com users.txt dirs.txt results.html\n\n";
- exit(0);
- }
- $ua = LWP::UserAgent->new;
- $ua->agent("Google Bot");
- ($web, $users, $dirs, $save) = @ARGV;
- if ( $web !~ /^http:/ )
- {
- $web = "http://" . $web;
- }
- open USERS, $users;
- open SAVE, ">>$save";
- print "\n[!] Scanning $web for files in users, saving in $save\n\n";
- foreach $lista(<USERS>)
- {
- chomp($lista);
- open DIRS, $dirs;
- foreach $dir(<DIRS>)
- {
- chomp($dir);
- $host = $web.'/~'.$lista.'/'.$dir;
- $req = HTTP::Request->new(GET => "$host");
- $res = $ua->request($req);
- $result = $res->code;
- if ($result != 404 and $result != 403)
- {
- print "\n".$res->status_line.": $host";
- print SAVE $res->status_line.' : <a href="'.$host.'" TARGET="_new">'.$host.'</a><br>';
- }
- }
- close(DIRS);
- }
- print "\n";
- close(USERS,SAVE);
- __END__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement