elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 09:17  


Tema destacado: Grupo de Facebook de elhacker.net

+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting (Moderadores: Novlucker, Leo Gutiérrez., EleKtro H@cker)
| | |-+  [Perl] FinderPaths 0.5
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] FinderPaths 0.5  (Leído 92 veces)
Doddy

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Perl] FinderPaths 0.5
« en: 1 Diciembre 2011, 22:10 »

Simple programa para buscar el tipico listado de directorios , lo pueden usar de dos formas , la primera es una busqueda simple y la otra al estilo spider , esta ultima nos ayuda a seguir buscando directorios escalando los encontrados

Código
#!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 {
print "\n[-] Error\n";
}
}
copyright();
 
sub escalar {
 
my $code  = toma( $_[0] );
my @links = get_links($code);
 
if ( $code =~ /Index of (.*)</ig ) {
my $dir_found = $1;
chomp $dir_found;
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;
chomp $dir_found;
print "[+] Directory Found : $dir_found\n";
}}}}}}
 
sub toma {
return $nave->get( $_[0] )->content;
}
 
sub get_links {
 
$test = HTML::LinkExtor->new( \&agarrar )->parse( $_[0] );
return @links;
 
sub agarrar {
my ( $a, %b ) = @_;
push( @links, values %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 ?
 


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ayuda con el Active Perl + Perl
Hacking Básico
Aironjack 3 926 Último mensaje 8 Marzo 2005, 07:52
por Aironjack
Que significa #!/usr/bin/perl ?? como ejecutamos un exploit en perl...
Bugs y Exploits
mousehack 7 2,198 Último mensaje 4 Noviembre 2005, 23:16
por BenRu
-=PERL=-
Scripting
D4RIO 1 3,005 Último mensaje 25 Febrero 2008, 17:27
por D4RIO
MSN Perl y PHP
Scripting
isseu 0 980 Último mensaje 30 Diciembre 2008, 14:36
por isseu
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 854 Último mensaje 18 Mayo 2011, 21:49
por madpitbull_99
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines