Guest User

UnixPassCracker

a guest
Jul 18th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import crypt
  2.  
  3. def testPass(cryptPass): #recibe una contrasena cifrada
  4.     salt = cryptPass[0:2]
  5.     dictFile = open('dictionary.txt','r')
  6.     for word in dictFile.readlines():
  7.         word = word.strip('\n')
  8.         cryptWord = crypt.crypt(word,salt)
  9.         if (cryptWord == cryptPass):
  10.             print "[+] Found Password: "+word+"\n"
  11.             return
  12.     print "[-] Password Not Found. \n"
  13.     return
  14.  
  15. def main():
  16.     passFile = open('passwords.txt','r')
  17.     for line in passFile.readlines():
  18.         if ":" in line:
  19.             user = line.split(':')[0]
  20.             cryptPass = line.split(':')[1].strip(' ')
  21.             print "[*] Cracking Password For: "+user
  22.             testPass(cryptPass)
  23.  
  24. if __name__ == '__main__':
  25. main()
Add Comment
Please, Sign In to add comment