Hack Forums
[Python] D4rk-cracker : A md5 cracker in python - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] D4rk-cracker : A md5 cracker in python (/showthread.php?tid=815185)



D4rk-cracker : A md5 cracker in python - MooseHide - Nov 13, 2010

This is my second code in python .. i have worked upon handling unexpected requests and a good format in which the information will be printed .
This tool can easily be expanded by adding more online md5 crack resources .

Code
#!/usr/bin/python

# D4rk-cracker-- A small python code for MD5 cracking
# Coded By D4rk357[2010]


import urllib,urllib2, re,sys,cookielib
from socket import*

if len(sys.argv) != 2:
    print "\n|-----------------------------------------------------------------|"
        print "|          lastman100[@]gmail[dot]com                             |"
        print "|           10/2010     MD 5 Cracker    v0.1                      |"                  
    print "| Visit   : www.garage4hackers.com                                |"
        print "|-----------------------------------------------------------------|\n"
    
mhash= raw_input('please enter the hash to crack :')
params =  urllib.urlencode({'term':mhash})
f=urllib.urlopen("http://md5crack.com/crackmd5.php", params)
tas= f.read()
link=re.compile('Found: md5'+'\S+'+'\s+'+'\S+'+'\s+'+'\w+')

if link.search(tas):
    a= link.search(tas).group()
    print("[+]cracking...\n \n[+]Hash Cracked from md5crack.com \n")
    print a.strip('[Found,:]')
else:
    print "[+] Hash not found on md5crack.com\n"


    
params=urllib.urlencode({'oc_check_md5':mhash})
f=urllib.urlopen("http://opencrack.hashkiller.com/",params)
tas=f.read()
link=re.compile('result'+'.*'+'\S')
if link.search(tas):
    a= link.search(tas).group()
    print("\n[+]Hash Cracked from hashkiller.com \n")
    print a.strip('[result,",>,<br/>]')
else:
    print "[+] \nHash not found on hashkiller.com\n"

params=urllib.urlencode({'search_field':mhash})
f=urllib.urlopen("http://hashchecker.com/index.php?_sls=search_hash",params)
tas=f.read()
link=re.compile('Your md5 hash is :'+'\S+'+'\s+'+'\S+'+'\s+'+'\S+')

if link.search(tas):
    a= link.search(tas).group()
    print("\n[+]Hash Cracked from hashchecker.com \n")
    print a.strip('[Your md5 hash is :,<br>,<li>,<b>,</b>]')
else:
    print "[+] \nHash not found on hashchecker.com\n"
[IMG]http://img337.imageshack.us/img337/3289/desktop2f.png[/IMG]


* - Xyk™ - Nov 13, 2010

link=re.compile('Found: md5'+'\S+'+'\s+'+'\S+'+'\s+'+'\w+')

Learn some more about regular expression. And there's no need to split the string up, but you should use a raw string (r"").


* - Starwiz - Nov 13, 2010

Also, there's no need for the:
if len(sys.argv) != 2:

Since you don't specify what to do if len(sys.argv) == 2
Meaning you could just delete that part of the code, and un-indent the prints... And I don't know why some are double indented.
Also, you don't use cookielib, or urllib2, so neither of those need to be imported.
Also, half your print tags were formated for python 2.x, the other for 3
Also, make sure they enter a proper hash
If they don't enter a proper hash, it still says hash cracked from hashkiller:
Code
[+]Hash Cracked from hashkiller.com

:&lt;notfound&gt;</div></td
check out the API for hashkiller

Also, try to not get into the habit of using
Code
from module import *



* - Zach - Nov 13, 2010

Interesting, nicely coded, good work man.


* - EloBoosted - Nov 14, 2010

I'm new to python and have a question about the program. I'm interested in the face it can use the internet and search for stuff.

Code
params =  urllib.urlencode({'term':mhash})
f=urllib.urlopen("http://md5crack.com/crackmd5.php", params)
tas= f.read()
link=re.compile('Found: md5'+'\S+'+'\s+'+'\S+'+'\s+'+'\w+')

Could someone please explain to me what each line does? Also, is there a module to use the internet and search for things?


* - EloBoosted - Nov 14, 2010

Sorry about the repeated posts. Hit refresh by mistake -_-


* - EloBoosted - Nov 14, 2010

Sorry about the repeated posts. Hit refresh by mistake -_-


* - Starwiz - Nov 14, 2010

(Nov 14, 2010 05:24 AM)heavenwings Wrote:  I'm new to python and have a question about the program. I'm interested in the face it can use the internet and search for stuff.

Code
params =  urllib.urlencode({'term':mhash})
f=urllib.urlopen("http://md5crack.com/crackmd5.php", params)
tas= f.read()
link=re.compile('Found: md5'+'\S+'+'\s+'+'\S+'+'\s+'+'\w+')

Could someone please explain to me what each line does? Also, is there a module to use the internet and search for things?

params = urllib.urlencode({'term':mhash})
The Filehandle "params" becomes:" &term= *Whatever mhash is equal to*"

f = urllib.urlopen("http://md5crack.com/crackmd5.php", params)
The filehandle "f" becomes connects to that link, and grabs the source, but does not store it.

tas = f.read()
The filehandle "tas" uses "f" and saves the source of the website specified in "f"

link=re.compile('Found: md5'+'\S+'+'\s+'+'\S+'+'\s+'+'\w+')
The filehandle "link" contains a regular expression, which is used to search for specific strings.


* - MooseHide - Nov 15, 2010

Thanks Zyk and starwiz for your invaluable suggestions :). I will try to incorporate it in my next code


Starwiz i could have + reped you for pointing out these errors if i was a 1337. I will correct them .. Thanks


* - Starwiz - Nov 15, 2010

(Nov 15, 2010 03:06 AM)●๋•D4rk357™© . Wrote:  Thanks Zyk and starwiz for your invaluable suggestions :). I will try to incorporate it in my next code


Starwiz i could have + reped you for pointing out these errors if i was a 1337. I will correct them .. Thanks

Yeah man, no problems. I'm here to help =P


* - xarisis - Jan 30, 2011

Is there a mass one? I mean, is there a version that can handdle the hashes from a text file?


* - JrMn - Feb 1, 2011

Nice application.

/TOO SHORT