• Inicio
  • Buscar
  • Ingresar
  • Registrarse

    Starfield: el juego que revolucionará el espacio y la tecnología

    • Hack x Crack - Comunidad de Seguridad informática »
    • Programación »
    • Scripting »
    • Perl »
    • [Perl] Finder Paths 0.6
    • Imprimir
    Páginas: [1]   Ir Abajo

    Autor Tema: [Perl] Finder Paths 0.6  (Leído 1681 veces)

    Desconectado BigBear

    • { L5 } Smurf
    • *****
    • Mensajes: 594
      • Ver Perfil
    [Perl] Finder Paths 0.6
    « en: Abril 08, 2012, 01:54:10 am »
    Un simple script para buscar los famosos listados de directorios en una pagina.

    Código: [Seleccionar]
    #!usr/bin/perl
    #Finder Paths 0.6
    #Coded By Doddy H

    use LWP::UserAgent;
    use URI::Split qw(uri_split);
    use HTML::LinkExtor;

    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"
    );

    head();

    print "[+] Web : ";
    chomp( my $web = <stdin> );

    print "\n\n[+] Scan Type\n\n";
    print "[+] 1 : Fast\n";
    print "[+] 2 : Full\n";

    print "\n\n[+] Option : ";
    chomp( my $op = <stdin> );

    print "\n\n[+] Scanning ....\n\n\n";

    if ( $op eq "1" ) {
        simple($web);
    }
    elsif ( $op eq "2" ) {
        escalar($web);
    }
    else {
        simple($web);
    }
    copyright();

    sub escalar {

        my $co    = $_[0];
        my $code  = toma( $_[0] );
        my @links = get_links($code);

        if ( $code =~ /Index of (.*)/ig ) {
            print "[+] Link : $co\n";
            savefile( "paths-logs.txt", $co );
            my $dir_found = $1;
            chomp $dir_found;
            while ( $code =~ /<a href=\"(.*)\">(.*)<\/a>/ig ) {
                my $ruta   = $1;
                my $nombre = $2;
                unless ( $nombre =~ /Parent Directory/ig
                    or $nombre =~ /Description/ig )
                {
                    push( @encontrados, $_[0] . "/" . $nombre );
                }
            }
        }

        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 $yeah = "http://" . $auth . $parche;
                        escalar($yeah);
                    }
                }
                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;
                            my $yeah = "http://" . $auth . $parche;
                            print "[+] Link : $yeah\n";
                            savefile( "paths-logs.txt", $yeah );
                        }
                    }
                }
            }
        }
    }

    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 savefile {
        open( SAVE, ">>" . $_[0] );
        print SAVE $_[1] . "\n";
        close SAVE;
    }

    sub head {
        print qq(


     @@@@@ @           @             @@@@@           @         
     @                 @             @    @       @  @         
     @                 @             @    @       @  @         
     @     @ @ @@   @@@@  @@@  @@    @    @  @@@  @@ @ @@   @@
     @@@@  @ @@  @ @   @ @   @ @     @@@@@      @ @  @@  @ @  @
     @     @ @   @ @   @ @@@@@ @     @       @@@@ @  @   @  @ 
     @     @ @   @ @   @ @     @     @      @   @ @  @   @   @
     @     @ @   @ @   @ @   @ @     @      @   @ @  @   @ @  @
     @     @ @   @  @@@@  @@@  @     @       @@@@  @ @   @  @@





    );
    }

    sub copyright {
        print "\n\n(C) Doddy Hackman 2012\n\n";
        <stdin>;
        exit(1);
    }

    # The End ?
    En línea

    • Imprimir
    Páginas: [1]   Ir Arriba
    • Hack x Crack - Comunidad de Seguridad informática »
    • Programación »
    • Scripting »
    • Perl »
    • [Perl] Finder Paths 0.6
     

    • SMF | SMF © 2013, Simple Machines
    • XHTML
    • RSS
    • WAP2
    Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso... Learn more