[Perl] Finder Pass 0.3

Iniciado por BigBear, Marzo 31, 2012, 05:51:24 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Marzo 31, 2012, 05:51:24 PM Ultima modificación: Marzo 14, 2015, 10:17:34 AM por Expermicid
La nueva version de un programa que habia hecho para crackear hashes md5 mediante paginas online.

Código: perl

#!usr/bin/perl
#Finder Pass 0.3
#Coded By Doddy H

use LWP::UserAgent;

my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);

menu();

sub menu {

    head();

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

    if ( $op eq "1" ) {
        print "\n\n[+] Hash : ";
        chomp( my $ha = <stdin> );
        if ( ver_length($ha) ) {
            print "\n\n[+] Cracking Hash...\n";
            my $re = crackit($ha);
            unless ( $re =~ /false01/ ) {
                print "\n[+] Cracked : $re\n\n";
                savefile( "hashes-found.txt", $ha . ":" . $re );
            }
            else {
                print "\n[-] Not Found\n\n";
            }
        }
        else {
            print "\n\n[-] Hash invalid\n\n";
        }
        print "\n[+] Finished";
        <stdin>;
        menu();
    }
    if ( $op eq "2" ) {
        print "\n\n[+] Wordlist : ";
        chomp( my $fi = <stdin> );
        if ( -f $fi ) {
            print "\n\n[+] Opening File\n";
            open( WORD, $fi );
            my @varios = <WORD>;
            close WORD;
            my @varios = repes(@varios);
            print "[+] Hashes Found : " . int(@varios);
            print "\n\n[+] Cracking hashes...\n\n";
            for $hash (@varios) {
                chomp $hash;
                if ( ver_length($hash) ) {
                    my $re = crackit($hash);
                    unless ( $re =~ /false01/ ) {
                        print "[+] $hash : $re\n";
                        savefile( "hashes-found.txt", $hash . ":" . $re );
                    }
                }
            }
        }
        else {
            print "\n\n[-] File Not Found\n\n";
        }
        print "\n[+] Finished";
        <stdin>;
        menu();
    }
    if ( $op eq "3" ) {
        copyright();
    }
}

sub crackit {

    my $target = shift;

    chomp $target;

    my %hash = (

        'http://md5.hashcracking.com/search.php?md5=' => {
            'tipo'  => 'get',
            'regex' => "Cleartext of $target is (.*)",
        },

        'http://www.hashchecker.com/index.php?_sls=search_hash' => {
            'variables' => { 'search_field' => $target, 'Submit' => 'search' },
            'regex' =>
              "<td><li>Your md5 hash is :<br><li>$target is <b>(.*)<\/b>",
        },

        'http://md5.rednoize.com/?q=' => {
            'tipo'  => 'get',
            'regex' => "<div id=\"result\" >(.*)<\/div>"
        },

        'http://md52.altervista.org/index.php?md5=' => {
            'tipo'  => 'get',
            'regex' => "<br>Password: <font color=\"Red\">(.*)<\/font><\/b>"
          }

    );

    for my $data ( keys %hash ) {
        if ( $hash{$data}{tipo} eq "get" ) {
            $code = toma( $data . $target );
            if ( $code =~ /$hash{$data}{regex}/ig ) {
                my $found = $1;
                unless ( $found =~ /\[Non Trovata\]/ ) {
                    return $found;
                    last;
                }
            }
        }
        else {
            $code = tomar( $data, $hash{$data}{variables} );
            if ( $code =~ /$hash{$data}{regex}/ig ) {
                my $found = $1;
                return $found;
                last;
            }
        }
    }
    return "false01";
}

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

sub head {
    print qq(


##########  #########  #########     #####   #    ###  ###
#  # #  ##  #  #   #   #  # #  #     #  #   #   #  # #  #
#    #  ##  #  #    #  #    #  #     #  #  # #  #    #   
###  #  # # #  #    #  ###  ###      ###   # #   ##   ##
#    #  # # #  #    #  #    # #      #    #####    #    #
#    #  #  ##  #   #   #  # #  #     #    #   # #  # #  #
###  ######  # #####   ########  #   ###  ### ######  ###




[++] Options


[+] 1 : Hash
[+] 2 : File with hashes
[+] 3 : Exit


);
}

sub savefile {
    open( SAVE, ">>" . $_[0] );
    print SAVE $_[1] . "\n";
    close SAVE;
}

sub repes {
    my @limpio;
    foreach $test (@_) {
        push @limpio, $test unless $repe{$test}++;
    }
    return @limpio;
}

sub ver_length {
    return true if length( $_[0] ) == 32;
}

sub toma {
    return $nave->get( $_[0] )->content;
}

sub tomar {
    my ( $web, $var ) = @_;
    return $nave->post( $web, [ %{$var} ] )->content;
}

#The End ?