Advertisement
Guest User

Untitled

a guest
Feb 10th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. import crypt
  2.  
  3. def testPass(cryptPass):
  4.     hashType = cryptPass.split("$")[1]
  5.  
  6.     if hashType == '1':
  7.         print "[+] Hash Type is MD5"
  8.  
  9.     elif hashType == '5':
  10.         print "[+] Hash Type is SHA-256"
  11.  
  12.     elif hashType == '6':
  13.         print "[+] Hash Type is SHA-512"
  14.     else:
  15.         print "[+] Hash Type is Unknown"
  16.  
  17.     salt = cryptPass.split("$")[2]
  18.     dictFile = open('dictionary.txt', 'r')
  19.     for word in dictFile.readlines():
  20.         word = word.strip('\n')
  21.         pepper = "$" + hashType + "$" + salt
  22.         cryptWord = crypt.crypt(word, pepper)
  23.     if cryptWord == cryptPass:
  24.         print '[+] Found Password: ' + word + '\n'
  25.         return
  26.     print '[-] Password Not Found.\n'
  27. return
  28.  
  29. def main():
  30.     passFile = open('passwords.txt')
  31.     for line in passFile.readlines():
  32.  
  33.     if ':' in line:
  34.         user = line.split(':')[0]
  35.         cryptPass = line.split(':')[1].strip(' ')
  36.    
  37.         print '[*] Cracking Password For: ' + user
  38.         testPass(cryptPass)
  39.  
  40. if __name__ == '__main__':
  41. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement