#!usr/bin/perl
#Finder Paths 0.5 Coded By Doddy H
use LWP::UserAgent;
use URI
::Split qw(uri_split
); use HTML::LinkExtor;
use Getopt::Long;
my $nave = LWP::UserAgent->new();
$nave->timeout(5);
$nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
GetOptions(
"-target=s" => \$target,
"-option=s" => \$opcion);
head();
unless ($target && $opcion) {
sintax();
}
else {
if ($opcion eq "spider") {
print "\n[+] Searching in $target\n"; escalar($target);
}
elsif($opcion eq "simple") {
print "\n[+] Searching in $target\n\n\n"; simple($target);
} else {
}
}
copyright();
sub escalar {
my $code = toma( $_[0] );
my @links = get_links($code);
if ( $code =~ /Index of (.*)</ig ) {
my $dir_found = $1;
print "\n\n[+] Directory Found : $dir_found\n\n"; while ( $code =~ /<a href=\"(.*)\">(.*)<\/a>/ig ) {
my $ruta = $1;
my $nombre = $2;
unless ( $nombre =~ /Parent Directory/ig or $nombre =~ /Description/ig ) {
unless ($nombre=~/\/$/) {
print "[+] File Found : $nombre\n"; }
push(@encontrados,$_[0]."/".$nombre); }
}
}
#get more
for my $com (@links) {
my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] );
if ( $path =~ /\/(.*)$/ ) {
my $path1 = $1;
$_[0] =~ s/$path1//ig;
my ( $scheme, $auth, $path, $query, $frag ) = uri_split($com);
if ( $path =~ /(.*)\// ) {
my $parche = $1;
unless($repetidos=~/$parche/){
$repetidos.=" ".$parche;
escalar("http://".$auth.$parche );
}
}
for(@encontrados) {
escalar($_);
}}}}
sub simple {
my $code = toma($_[0]);
my @links = get_links($code);
for my $com (@links) {
my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] );
if ( $path =~ /\/(.*)$/ ) {
my $path1 = $1;
$_[0] =~ s/$path1//ig;
my ( $scheme, $auth, $path, $query, $frag ) = uri_split($com);
if ( $path =~ /(.*)\// ) {
my $parche = $1;
unless($repetidos=~/$parche/){
$repetidos.=" ".$parche;
my $code=toma("http://".$auth.$parche);
if ( $code =~ /Index of (.*)</ig ) {
my $dir_found = $1;
print "[+] Directory Found : $dir_found\n"; }}}}}}
sub toma {
return $nave->get( $_[0] )->content; }
sub get_links {
$test = HTML::LinkExtor->new( \&agarrar )->parse( $_[0] );
sub agarrar {
my ( $a, %b ) = @_;
}
}
sub head {
print "\n\n-- == FinderPaths 0.5 == --\n\n"; }
sub sintax {
print "\n[+] Sintax : $0 -target <web> -option <simple/spider>\n"; }
sub copyright {
print "\n\n(C) Doddy Hackman 2011\n\n"; }
# The End ?