MD5 brute force

fender

Limp Gawd
Joined
Mar 2, 2003
Messages
417
Is there an MD5 brute force program that can be given a list of hashes instead of just one? This isn't to find passwords, but rather to find a pattern amongst several hundred hashed strings. As far as I know, only numbers are involved so it shouldn't take more than a few days to get a couple matches.
 
Make one. There are a bunch of tutorials on how to program brute forcers, just use one of those and edit it a bit.
 
A hash can be viewed as a number, though its usually represented in ASCII. I'm not exactly sure what you are looking for as far as patterns go - remember that a good hash algorithm should not have any predictable patterns or anything that could compromise any of the basis premises of a good hashing algorithm. Generally speaking, if you change one bit, at least half of the bits in the hash should change.

If you arn't capable of writing your own simple program to do this I'm not sure exactly how you could do any attempts to decipher any sort of pattern. I have no idea why you would want to do this anyways, but I'm going to venture to guess that whatever you are attempting to do probably isn't worthwhile.
 
As far as I know, only numbers are involved so it shouldn't take more than a few days to get a couple matches.
I think you'll find that this isn't the case. You shouldn't be able to find patterns among the hashes of similar data (I think this is what you mean), at least for a decent algorithm like md5. You might find patterns among the hashes, but it should be independent of the data.

I think there are dictionaries available which might assist in figuring out common (unsalted) hashes.
 
It is worthwhile to me. The pattern is amongst the strings, not their hashes.
 
It is worthwhile to me. The pattern is amongst the strings, not their hashes.

It's been explained to you above that the hashes and their associated data will be unmatchable between iterations of the hashing algorithm. If "the strings" are the data itself then changing the strings will drastically and violently change the associated hash. This is by nature with any hashing algorithm to ensure tampering can not occur.

Most people here aren't sure what you are referring to when you say "the strings".... be specific: the payload, the encrypted payload, the hash (either pre-encryption or post-encryption), the salt, etc. Look up common terms for computer encryption and make sure you fully understand them, then post back what you are looking for and I'm sure someone here can assist you further.

202276
 
Like jimmy said, a good hash shouldn't be suceptible to patterns. Changing one bit on the original data should, on average but also not predictablly, result in a change in half of the output. What this means is that the hashing algorithm is a one way street without patterns. You could hash "aaaa", "aaab" and "aaac" and you will not notice any more of a pattern than you would if you had looked at the hashed results for "akta", "xuwl", and "qpem" (random keyboard mashings.)

Although you seem persistent that you have a worthy cause -- mind sharing what you are thinking or is this a top secret project?
 
Here is a quick printout from a console to show just how much things change:
>>> import md5
>>> def a(s):
... m = md5.new()
... m.update(s)
... return m.hexdigest()
...
>>> a("a")
'0cc175b9c0f1b6a831c399e269772661'
>>> a("b")
'92eb5ffee6ae2fec3ad71c777531578f'
>>> a("c")
'4a8a08f09d37b73795649038408b5f33'
>>> a("d")
'8277e0910d750195b448797616e091ad'
>>> a("e")
'e1671797c52e15f763380b45e841ec32'
>>> a("f")
'8fa14cdd754f91cc6554c9e71929cce7'
>>> a("aaaa")
'74b87337454200d4d33f80c4663dc5e5'
>>> a("aaab")
'4c189b020ceb022e0ecc42482802e2b8'
>>> a("aaac")
'3963a2ba65ac8eb1c6e2140460031925'
>>> a("aaad")
'aa836f154f3bf01eed8df286a1fbb388'
>>> a("aaae")
'5f83cfb6ca6b50d3323a6377e1241b1f'
>>> a("aaaf")
'14acbed198e2456a400321cd9b065ce3'
>>> a("aaa")
'47bce5c74f589f4867dbd57e9ca9f808'

If you are trying to find some brilliant workaround to the amazing amount of math and voodoo involved in hash algorithms, I suggest you start reading some papers by Xiaoyun Wang. Hint: This stuff ain't easy.
 
The only reason I brought up my intentions is because I know someone would have accused my of trying to get at passwords or something like that. The only thing I wanted was a program that could perform a brute force "decryption" on more than one encrypted string at a time.
 
First, I don't care much either way if you are trying to decrypt passwords or go pattern hunting but I could give you better help if I knew what you were doing.

It sounds like your goal is to figure out what data was used to create a known hash. If this is the case then your strategy depends on what kind of data was used to create the hash. The only known way to reverse is to simply do a brute force like you have mentioned.

If you have no idea what kind of data created the hash, you will be out of luck. First, there are collisions in hashing. This means that there are multiple inputs that may create the same output. If you only know the output, you can never be certain that your calculated input is what truly created that output. Not only this but it will take a very long time to try combinations before you find a match.

However, if you can make some assumptions about what created the hash then you can cut down your workload substantially. For instance, passwords tend to be words (dictionary attack) and contain far fewer uppercase and numbers than they do lowercase characters. Using this sort of assumption you can try the most likely input first.

If you are looking to write a program that performs a dictionary attack it shouldn't be too difficult. Read a dictionary file line by line, check the md5 of that line to see if it matches the target. If you get through the file without luck then you can add code to your program that appends separate words together or inserts random numbers and uppercases things. All in all, it shouldn't be more than an afternoon of coding.

Or if that isn't your fancy, I would imagine there are some floating around the web try a google search.
 
Here's a neat page that describes how to set up pair of executable programs that have the same MD5 hash. This is possible by exploiting known weaknesses in the algorithm to produce collisions:

http://www.mscs.dal.ca/~selinger/md5collision/

I'd have to agree with the other posters--even after reading this entire thread, I really have no idea what the OP is trying to accomplish :)
 
Back
Top