Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
MD5/SHA1 Cracker I whipped up - (Online & Dictionary Attack)
  • Mr. P-teoMr. P-teo
    Posts: 269
    So yer i got bored of always working on my database so i whipped up an MD5 cracker. This cracker users either online or dictionary attack and i may add bruteforce if i can be bothered.

    Enjoy.


    #!/usr/local/bin/perl
    use LWP::Simple;
    use Digest::MD5;
    use Digest::SHA1;


    my $option = $ARGV[0];
    my $hash = $ARGV[1];
    my $file = $ARGV[2];

    if($option eq \"-o\"){
    if($hash){
    $check_online = get('http://md5.hashcracking.com/search.php?md5='.$hash.'');
    if($check_online =~ \"\n\nCleartext of \".$hash.\" is password\"){
    print \"\n\n\".$check_online.\"\n\n\";
    }
    }
    }elsif($option eq \"-d\"){
    if($file){
    if($hash){
    if(length($hash) == 32){
    open(PASS, \"+< $file\");
    my @possible_passwords = ();
    while(<PASS>){
    push (@possible_passwords, $_);
    }
    foreach(@possible_passwords){
    $md5_compare = Digest::MD5->new;
    $md5_compare->add($_);
    $finnished_hash = $md5_compare->hexdigest;
    if($finnished_hash eq $hash){
    print \"\n\nCleartext of \".$hash.\" is \".$_.\"\n\n\";
    $score = 1;
    break;
    }

    }
    }elsif(length($hash) == 40){
    open(PASS, \"+< $file\");
    my @possible_passwords = ();
    while(<PASS>){
    push (@possible_passwords, $_);
    }
    foreach(@possible_passwords){
    $sha1_compare = Digest::SHA1->new;
    $sha1_compare->add($_);
    $finnished_sha1hash = $sha1_compare->hexdigest;
    if($finnished_sha1hash eq $hash){
    print \"\n\nCleartext of \".$hash.\" is \".$_.\"\n\n\";
    $score = 1;
    break;
    }

    }
    }


    if($score < 1){
    print \"\n\nPassword Not found...\n\n\";
    }
    close(PASS);
    }
    }
    }else{
    print \"MD5/SHA1 Cracker Made By Mr. P-teo \nPerl 5 Version 14 - 2012\n\n\n\";
    print \"-o => Online Cracker (only for MD5)\n\";
    print \"+ Example: md5cracker.pl -o 5f4dcc3b5aa765d61d8327deb882cf99\n\";
    print \"-d => Dictionary Attack\n\";
    print \"+ Example: md5cracker.pl -d 5f4dcc3b5aa765d61d8327deb882cf99 passwordlist.txt\n\";
    }
    }
    Skype: mrpt3o
    Twitter: MrPteo


    image
  • Praxis
    Posts: 20
    That's actually pretty cool. I really should start looking at Perl, it seems to be a very useful language from what I've seen so far. Good stuff, thanks for sharing!
  • Mr. P-teoMr. P-teo
    Posts: 269
    Glad you like, only took me about 40 mins (with breaks), took so long due to a little issue i kept having with the command line arguments but got it sorted.
    Skype: mrpt3o
    Twitter: MrPteo


    image
  • Sh3llc0d3
    Posts: 1,910
    People used to make really rubbish md5 crackers, they weren't event crackers more "md5 lookups". Its usually people who've just learned perl and they just do the a hash lookup on a web database, in essence the first pert of your script. It's nice to see you've included the dictionary portion :)

    Congrats on a nice script :)
  • Mr. P-teoMr. P-teo
    Posts: 269
    thanks very much, it could also easily be modified to to SHA1 and MD5 aswell.
    Skype: mrpt3o
    Twitter: MrPteo


    image
  • Deque
    Posts: 78
    Or you add an option for SHA, so it provides both.
  • Mr. P-teoMr. P-teo
    Posts: 269
    ^fair enough, edited the code to work for sha1 aswell, commands remain the same although i couldnt find a suitable online cracker for sha1 with no captcher.
    Skype: mrpt3o
    Twitter: MrPteo


    image