Guest User

cracker

a guest
Sep 22nd, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import crypt
  2. import hashlib
  3. import sys
  4. def passCheck(salt, hashes):
  5. dictFile = open("1000000passwords.txt", "r")
  6. for word in dictFile.readlines():
  7. word = word.strip('\n')
  8. cryptword = crypt.crypt(word, salt)
  9. if (cryptword == hashes):
  10. print ("Hacked password: %r\n" % word)
  11. return
  12. print("Unable to locate any passwords.\n")
  13. return
  14.  
  15. def main():
  16. passFile = open('shadows.txt', "r")
  17. for line in passFile.readlines():
  18. if "$6$" in line:
  19. user = line.split(':')[0]
  20. salt = line.split(':')[1]
  21. salt = salt[:11]
  22. hashes = line.split(":")[1]
  23. print(user + " using SHA-512\nUsing salt: " + salt + "\nUsing hash: " + hashes)
  24. passCheck(salt, hashes)
  25.  
  26. if "$1$" in line:
  27. user = line.split(":")[0]
  28. salt = line.split(':')[1]
  29. salt = salt[:11]
  30. hashes = line.split(":")[1]
  31. print(user + " using MD5\nUsing salt: " + salt + "\nUsing hash: " + hashes)
  32. passCheck(salt, hashes)
  33.  
  34. if __name__ == "__main__":
  35. main()
Add Comment
Please, Sign In to add comment