-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathlinuxcracker.py
41 lines (31 loc) · 862 Bytes
/
linuxcracker.py
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
35
36
37
38
39
40
#!/usr/bin/env python
import crypt, sys
def printer(thing):
sys.stdout.write(thing+" \r")
sys.stdout.flush()
return True
def cracker(passcrypt, dicfile):
count=1
lines = len(open(dicfile).readlines())
dicfile = open(dicfile, 'r')
for word in dicfile:
printer("["+str(count)+"/"+str(lines)+"]")
count+=1
password = word.strip('\n')
cryptword = crypt.crypt(password, passcrypt)
if cryptword == passcrypt:
print("\n[+]Password Found: "+word)
return True
print("[-]Not Found!")
try:
filepass = sys.argv[1]
dictfile = sys.argv[2]
except:
print('#Usage:\n\tpython linuxcracker.py passfile.txt dictfile.txt')
exit(0)
readpass = open(filepass, 'r')
for line in readpass:
user = line.split(':')[0]
cryptpass = line.split(':')[1].strip(' ')
print("[*] Cracking | User: "+user)
cracker(cryptpass, dictfile)