|
24 | 24 | print 'Please install fcrypt if you are on Windows'
|
25 | 25 |
|
26 | 26 |
|
27 |
| - |
28 |
| -def testPass(cryptPass): # Start the function |
| 27 | +def testPass(cryptPass): # Start the function |
29 | 28 | salt = cryptPass[0:2]
|
30 |
| - dictFile=open('dictionary.txt','r') # Open the dictionary file |
31 |
| - for word in dictFile.readlines(): # Scan through the file |
32 |
| - word=word.strip('\n') |
33 |
| - cryptWord=crypt.crypt(word,salt) # Check for password in the file |
| 29 | + dictFile = open('dictionary.txt','r') # Open the dictionary file |
| 30 | + for word in dictFile.readlines(): # Scan through the file |
| 31 | + word = word.strip('\n') |
| 32 | + cryptWord = crypt.crypt(word, salt) # Check for password in the file |
34 | 33 | if (cryptWord == cryptPass):
|
35 | 34 | print "[+] Found Password: "+word+"\n"
|
36 | 35 | return
|
37 | 36 | print "[-] Password Not Found.\n"
|
38 | 37 | return
|
39 | 38 |
|
| 39 | + |
40 | 40 | def main():
|
41 |
| - passFile = open('passwords.txt') # Open the password file |
42 |
| - for line in passFile.readlines(): # Read through the file |
| 41 | + passFile = open('passwords.txt') # Open the password file |
| 42 | + for line in passFile.readlines(): # Read through the file |
43 | 43 | if ":" in line:
|
44 |
| - user=line.split(':')[0] |
| 44 | + user = line.split(':')[0] |
45 | 45 | cryptPass = line.split(':')[1].strip(' ') # Prepare the user name etc
|
46 |
| - print "[*] Cracking Password For: "+user |
| 46 | + print "[*] Cracking Password For: " + user |
47 | 47 | testPass(cryptPass) # Call it to crack the users password
|
48 | 48 |
|
49 | 49 | if __name__ == "__main__":
|
|
0 commit comments