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 (1)

Powered by Vanilla. Made with Bootstrap.
MD5 Cracker
  • s1n4
    Posts: 88
    Hi guys,
    [align=center]Edited[/align]
    A simple tool for cracking MD5 passwords.
    you need a dictionary file with this script.
    Password dictionaries

    #!/usr/bin/python

    about = \"\"\"
    ########## ##########
    ##### _ _ _ #####
    ##### ___/ |_ __ | || | #####
    ##### / __| | '_ \| || |_ #####
    ##### \__ \ | | | |__ _| #####
    ##### |___/_|_| |_| |_| #####
    ##### #####
    ##### MD5 Cracker (Dictionary attack) #####
    ##### s1n4_c0der[at]yahoo.com #####
    ########## ##########

    \"\"\"

    import hashlib, sys

    def cracking() :

    encrypted = str(sys.argv[0])
    count = 0

    try :
    dict = open(sys.argv[1], \"rb\")
    buffer = dict.read().splitlines()
    except :
    print \"\n\t[-]Sorry, it can't open dictionary file\"

    if len(encrypted) == 32 :
    out = \"\n\t[+]MD5 --->\"
    else :
    print \"\n\t[-]Sorry, this is not md5 hash\"

    try :
    while True :
    md5 = hashlib.md5(buffer[count])

    if md5.hexdigest().lower() == encrypted.lower() :
    cracked = buffer[count]
    print \"\n\t\t\tCracked!\n\"
    print out, encrypted, \"\n\n\t[+]Cracked --->\", cracked
    break

    else :
    count += 1

    except :
    print \"\n\t[-]Sorry, it can't crack this hash\"


    print about
    while True :
    cracking()


    Enjoy :)
  • m0rph
    Posts: 332
    you've already imported sys, why not use argv statements instead of prompting?


    encrypted = raw_input("\nEnter MD5 encrypted for cracking >> ")


    replace this line with the following line so they can input the hash from the command line instead of being prompted for it:

    encrypted = str(sys.argv[0])

    also this line:


    dict = open("dict.txt", "rb")


    can be replaced with this line:

    dict = open(sys.argv[1], \"rb\")


    then the usage would look like:
    Usage: py md5crack.py hash dictionary

    That way the user isn't prompted to input both in separate instances, and they can just put all required info from command line.
    while( !(succeed = try() ) );
  • s1n4
    Posts: 88
    Thanks nice your accuracy :)
  • Sh3llc0d3
    Posts: 1,910
    Nice one m0rph and s1n4 :)
  • chroniccommand
    Posts: 1,389
    said:


    you've already imported sys, why not use argv statements instead of prompting?


    encrypted = raw_input("\nEnter MD5 encrypted for cracking >> ")


    replace this line with the following line so they can input the hash from the command line instead of being prompted for it:

    encrypted = str(sys.argv[0])

    also this line:


    dict = open("dict.txt", "rb")


    can be replaced with this line:

    dict = open(sys.argv[1], \"rb\")


    then the usage would look like:
    Usage: py md5crack.py hash dictionary

    That way the user isn't prompted to input both in separate instances, and they can just put all required info from command line.


    Also just a note here, you may wanna add some usage messages. Like so:

    if len(sys.argv) != 3:
    print(\"Usage: %s <hash> <dictionary file>\" % sys.argv[0])
    sys.exit()

    Also another option would be to use the optparser module which would look like so:

    md5cracker.py -p hash -d dictionary file
  • s1n4
    Posts: 88
    Thanks men :)

    That is a test version but full version coming soon.[hr]
    Main problem was :

    if md5.hexdigest() == encrypted :
    ...
    ...


    Edited to :

    if md5.hexdigest().lower() == encrypted.lower() :
    ...
    ...
  • Xin
    Posts: 3,251
    Nice, hows the speed on it
    Xin
  • s1n4
    Posts: 88
    Thanks Xinapse, your welcome :)

    I didn't consider the speed on it because it's dictionary attack.