Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import crypt
- import hashlib
- import sys
- def passCheck(salt, hashes):
- dictFile = open("1000000passwords.txt", "r")
- for word in dictFile.readlines():
- word = word.strip('\n')
- cryptword = crypt.crypt(word, salt)
- if (cryptword == hashes):
- print ("Hacked password: %r\n" % word)
- return
- print("Unable to locate any passwords.\n")
- return
- def main():
- passFile = open('shadows.txt', "r")
- for line in passFile.readlines():
- if "$6$" in line:
- user = line.split(':')[0]
- salt = line.split(':')[1]
- salt = salt[:11]
- hashes = line.split(":")[1]
- print(user + " using SHA-512\nUsing salt: " + salt + "\nUsing hash: " + hashes)
- passCheck(salt, hashes)
- if "$1$" in line:
- user = line.split(":")[0]
- salt = line.split(':')[1]
- salt = salt[:11]
- hashes = line.split(":")[1]
- print(user + " using MD5\nUsing salt: " + salt + "\nUsing hash: " + hashes)
- passCheck(salt, hashes)
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment