Skip to content

Instantly share code, notes, and snippets.

@Krayons

Krayons/brute.py Secret

Created July 14, 2012 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Krayons/30202cb6cc500c9fcfc4 to your computer and use it in GitHub Desktop.
Save Krayons/30202cb6cc500c9fcfc4 to your computer and use it in GitHub Desktop.
Test
from hashlib import md5
easyRange = range(97, 123) #a-z
hash = "858ff3e88ae4cd1b9c55bebd031d2a95"
salt = "athotmaildotcom"
def checkPassword(password):
m = md5()
m.update(password + salt)
if (m.hexdigest() == hash):
print "match [" + password + "]"
sys.exit()
def recurse(width, position, baseString):
#current position
for char in easyRange:
if (position < width - 1):
recurse(width, position + 1, baseString + "%c" % char)
checkPassword(baseString + "%c" % char)
print "Target Hash [" + hash + "] Salt [" + salt + "]"
maxChars = 13
for baseWidth in range(1, maxChars + 1):
print "checking passwords width [" + `baseWidth` + "]"
recurse(baseWidth, 0, "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment