Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

D4rk-cracker : A md5 cracker in python

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]
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"").
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 *
Interesting, nicely coded, good work man.
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?
Sorry about the repeated posts. Hit refresh by mistake -_-
Sorry about the repeated posts. Hit refresh by mistake -_-
(Nov 14, 2010 05:24 AM)EloBoosted 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.
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
(Nov 15, 2010 03:06 AM)MooseHide 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
Is there a mass one? I mean, is there a version that can handdle the hashes from a text file?
Nice application.

/TOO SHORT


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 632 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[Python] by XxClassifiedxXMay 31, 2017 04:11 PM 10 368 May 31, 2017 04:11 PM
Last Post: Goodies
[Python] by bhop_alexNov 13, 2016 05:46 AM 8 325 Nov 13, 2016 05:46 AM
Last Post: 0xBD