Cracking hashes with Python

TheRandomPast wishingforsam at gmail.com
Tue Nov 26 11:30:03 CET 2013


On Tuesday, 26 November 2013 02:46:09 UTC, Frank Cui  wrote:
> Hi,
> 
> 
> I'm assuming you are taking a computer/network security course.
> 
> Md5 hashing operation is designed to be mathematically unidirectional, you can only attempt to find a collision situation but it's technically impossible to reverse the operation.
> 
> 
> With that said, it's possible to "crack" or "decrypt" a md5 hash value by searching through a value-hash database to find the most commonly used password under a given hash value. You can see the tool at http://www.md5crack.com/home.
> 
> Yatong
> 
> 
> > From: st... at pearwood.info
> > Subject: Re: Cracking hashes with Python
> > Date: Tue, 26 Nov 2013 02:55:58 +0000
> > To: pytho... at python.org
> > 
> > On Mon, 25 Nov 2013 15:32:41 -0800, TheRandomPast wrote:
> > 
> > > Hi,
> > > 
> > > I have a school project to do where I've to download MD5 Hashes from a
> > > particular website and write a code that will crack them.
> > 
> > A school project. Right. Heh. :-)
> > 
> > And which website's hashes would this be?
> > 
> > 
> > > Does anyone
> > > know where I'll find out more information on how to do this? There's
> > > only 4 hashes that I need to do so it doesn't have to be a large script
> > > just needs to be able to download the hashes from the website. Can
> > > anyone help me out?
> > 
> > The size of the script has nothing to do with the number of hashes you 
> > have to crack. Whether it is one hash and one million, the script will be 
> > exactly the same.
> > 
> > Do you have to write a program to download the hashes, or can you just 
> > browse to the web address with your browser and save them?
> > 
> > If you have to write your own program, start here:
> > 
> > https://duckduckgo.com/?q=python+how+to+download+data+from+the+web
> > 
> > 
> > -- 
> > Steven
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list

Hi, Thanks for answering. 

I have already created a script that downloads the hash values and prints them on my GUI, now I'm just struggling to figure out how to pass these values into the next part of my code to crack them. 

This is the code that downloads them;
>def getMD5Pass(webpage):
>    print '[*] getMD5Pass()'
>    values = re.findall(r'([a-fA-F\d]{32})', webpage)
>    values.sort()
>    print '[+]', str(len(values)), 'Amount of MD5 passwords found :'

>    for value in values:
        print value


3d4fe7a00bc6fb52a91685d038733d6f
cf673f7ee88828c9fb8f6acf2cb08403
1341daac6408df15c166a3e4580ee4b1

and I've started the second part, the part to crack them. If anyone could tell me where I'd find more information on this subject and how to crack them that would be great. As I print them on screen I was thinking I could write a program that allows the md5 to be entered and then cracked.

>import hashlib
>def crackMD5Hash():
>    md5Hash = raw_input('What is the Hash to be decrypted  :  ')


This is as far as I've gotten so far. It's back to the drawing board. 





More information about the Python-list mailing list