-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUNIXcrack.py
More file actions
34 lines (28 loc) · 889 Bytes
/
UNIXcrack.py
File metadata and controls
34 lines (28 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
#Author: Miguel Rodriguez
#Date: 07/06/2016
#Description: UNIX password cracker
#Contact: [email protected]
import crypt
def testPass(cryptPass):
salt = cryptPass[:2]
dictFile = open("dictionary.txt", "r")
for word in dictFile.readlines():
word = word.strip("\n")
cryptWord = crypt.crypt(word, salt)
if cryptWord == cryptPass:
print "[+] Found password: %s\n"%(word)
return
print "[-] Password not found.\n"
return
def main():
passFile = open("passwords.txt", "r")
for line in passFile.readlines():
if ":" in line:
user = line.split(":")[0]
cryptPass = line.split(":")[1].strip("\n")
print "Cracking password for: %s"%(user)
testPass(cryptPass)
if __name__ == "__main__":
main()
#TODO: Update the script to crack SHA-512 hashes