![]() |
|
SaltyTheHashCracker - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Python (https://sinister.ly/Forum-Python) +--- Thread: SaltyTheHashCracker (/Thread-SaltyTheHashCracker) |
SaltyTheHashCracker - Eclipse - 03-21-2015 Supports md5(), sha1(), sha224(), sha256(), sha384(), sha512(). Allows for you to enter your own custom hashing algorithm. Code: import time
import hashlib
from jinja2.sandbox import SandboxedEnvironment
cracked = []
print '''
____ ____ ____ ____ ____
||S |||a |||l |||t |||y ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|'''
def md5(s):
return hashlib.md5(s).hexdigest()
def sha1(s):
return hashlib.sha1(s).hexdigest()
def sha224(s):
return hashlib.sha224(s).hexdigest()
def sha256(s):
return hashlib.sha256(s).hexdigest()
def sha384(s):
return hashlib.sha384(s).hexdigest()
def sha512(s):
return hashlib.sha512(s).hexdigest()
def save():
wishtosave = str(raw_input('\nDo you want Salty to save the cracked hashes? (Y/N) > ')).upper()
if wishtosave == 'Y':
path = open(str(raw_input('File to save to > ')), 'a')
for x in cracked:
path.write(x + '\n')
print 'Saved.'
elif wishtosave == 'N':
print 'k.'
else:
print 'Whut?'
save()
def cracking(algorithm):
env = SandboxedEnvironment()
template = env.from_string('{{' + algorithm + '}}')
hashlist = open(str(raw_input('Hash List Path > ')), 'r').readlines()
passwords = open(str(raw_input('Password List Path > ')), 'r').readlines()
paslen = len(passwords)
print '\nYour password list has', str(paslen), 'passwords.\n'
speed = 0
try:
print 'Salty has started cracking...\nPress Ctrl + C to Stop\n'
for h in hashlist:
done = False
print 'Salty is nibbling on ' + h.strip()
if '||' in h:
hsh = h.split('||')[0].strip()
salt = h.split('||')[1].strip()
else:
hsh = h.strip()
salt = ''
start = time.time()
for pwd in passwords:
pwd = pwd.strip()
if template.render(md5=md5, sha1=sha1, sha224=sha224, sha256=sha256, sha384=sha384, sha512=sha512, salt=salt, password=pwd) == hsh:
elapsed = time.time() - start
if elapsed != 0:
speed = paslen / elapsed
done = True
print 'Salty cracked open ' + hsh + ' with ' + pwd + ' in ' + str(elapsed) + ' seconds.'
print 'Salty\'s time was', str(speed), 'Passwords Per Second.'
cracked.append(hsh + ' > ' + pwd)
break
if done == False:
elapsed = time.time() - start
if elapsed != 0:
speed = paslen / elapsed
print 'Salty\'s time was', str(speed), 'Passwords Per Second.'
print 'Salty failed to crack ' + hsh + ' which took ' + str(elapsed) + ' seconds.'
except KeyboardInterrupt:
print 'Keyboard Interrupt\n'
if cracked:
print '\nCracked:'
for x in cracked:
print x
save()
def main():
try:
print '\nBy Eclipse @ Sinister.ly\n'
print 'Available Hashing Algorithms:'
for x in hashlib.algorithms:
print '- ' + x
print '\nEncryption Algorithm Format:\n\nUse \'md5()\' for md5, \'sha1()\' for sha1 etc.\nUse \'+\' for joining strings.\nUse \'salt\' for the salt.\nUse \'password\' for the plaintext password.\nExample: md5(md5(salt)+md5(password))\n'
print 'Existing Algorithms:'
print '1 - MyBB: md5(md5(salt)+md5(password))'
print '2 - IP.Board: md5(md5(salt)+md5(password))'
print '3 - vBulletin: md5(md5(password)+salt)'
algorithm = str(raw_input('\nEnter the Encryption Algorithm or Corresponding Number > '))
if algorithm == '1':
algorithm = 'md5(md5(salt)+md5(password))'
if algorithm == '2':
algorithm = 'md5(md5(salt)+md5(password))'
if algorithm == '3':
algorithm = 'md5(md5(password)+salt)'
print '\nHashlist Format:\n\'hash||salt\' for salted hashes\n\'hash\' for unsalted hashes.\n'
cracking(algorithm)
except Exception,e:
print str(e)
print 'Program will auto-restart in 3 seconds...'
time.sleep(3)
main()
main()
raw_input('\nPress anything to exit...')Achieves around 25k passwords per second on my crappy i3 laptop. Cracked these from a public database: Code: Jimmy>d3485e489e3eda476e97fb6b2b55d88d>rocket
Poop>a52efb47d411655e5abc870ca03b7683>yankees
Assassin>e7c84b459ee84deda72b1859c8480bf0>ghost1
MinecraftGeek>5596e556f9c20680597ca2dcb7b337be>westham
shadowvamp>3f19ecb72d7ce60d7d3a5ecc47d71bba>spiderman
Chrishockey55>faf9b837857cfe452eb215bf659c24d1>qwerty
Slacker>e99d74ac15df1b5d7fa5a00196b631af>abc123
chloride91>a2db40843c3ea38f13319de2b43baa6f>147147
soyfueda>ddb85475a4c3b357f102e0e4d9e1ff7b>123123
themask>8f631a0b6ba4189ae6ae4e96a38c2430>123123
ooh>7fe05d025522f3be283e0121cbafa321>cardinalsUsing this wordlist: https://xato.net/passwords/more-top-worst-passwords/ This program can be used in conjunction with this to parse databases into hash-cracking format (only some databases are supported): https://www.sinister.ly/Thread-db2booby-py-DB-Parsing-and-Hash-Cracking-Tool Feedback? RE: SaltyTheHashCracker - Eclipse - 03-23-2015 No feedback?Niggurs? RE: SaltyTheHashCracker - Satan - 03-23-2015 You missed calling it The Hash-Slinging Slasher. RE: SaltyTheHashCracker - Eclipse - 03-23-2015 (03-23-2015, 10:10 PM)Six Wrote: You missed calling it The Hash-Slinging Slasher. Naa, I prefer Salty. 'aint he cute? RE: SaltyTheHashCracker - Dyme - 03-23-2015 Tbh, why not just use hashcat? I mean this might be useful if you wanted to implement it in another script that needs smth like this, but as a stand alone program, I don't see a purpose for it. RE: SaltyTheHashCracker - Eclipse - 03-24-2015 (03-23-2015, 11:49 PM)Dyme Wrote: Tbh, why not just use hashcat? I mean this might be useful if you wanted to implement it in another script that needs smth like this, but as a stand alone program, I don't see a purpose for it. I was bored and I didn't have any better ideas. |