-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathupdate-network-status.py
61 lines (58 loc) · 2.8 KB
/
update-network-status.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import sys
import json
import re
import time
# this script has one argument, the filename of the pmkid/hccapx file whose status will be updated
filename = sys.argv[1]
def updateNetworkCrackedStatus(status):
global filename
networkCrackedStatusData = {}
with open('network-cracked-status.json') as f:
networkCrackedStatusData = json.load(f)
networkCrackedStatusData[filename]['status'] = status
with open('network-cracked-status.json', 'w') as f:
json.dump(networkCrackedStatusData, f, indent=4)
print("\n" + filename)
if(status == "cracked"):
print('''
▄▄· ▄▄▄ ▄▄▄· ▄▄· ▄ •▄ ▄▄▄ .·▄▄▄▄
▐█ ▌▪▀▄ █·▐█ ▀█ ▐█ ▌▪█▌▄▌▪▀▄.▀·██▪ ██
██ ▄▄▐▀▀▄ ▄█▀▀█ ██ ▄▄▐▀▀▄·▐▀▀▪▄▐█· ▐█▌
▐███▌▐█•█▌▐█ ▪▐▌▐███▌▐█.█▌▐█▄▄▌██. ██
·▀▀▀ .▀ ▀ ▀ ▀ ·▀▀▀ ·▀ ▀ ▀▀▀ ▀▀▀▀▀•
''')
else:
print('''
▄▄▄ .▐▄• ▄ ▄ .▄ ▄▄▄· ▄• ▄▌.▄▄ · ▄▄▄▄▄▄▄▄ .·▄▄▄▄
▀▄.▀· █▌█▌▪██▪▐█▐█ ▀█ █▪██▌▐█ ▀. •██ ▀▄.▀·██▪ ██
▐▀▀▪▄ ·██· ██▀▐█▄█▀▀█ █▌▐█▌▄▀▀▀█▄ ▐█.▪▐▀▀▪▄▐█· ▐█▌
▐█▄▄▌▪▐█·█▌██▌▐▀▐█ ▪▐▌▐█▄█▌▐█▄▪▐█ ▐█▌·▐█▄▄▌██. ██
▀▀▀ •▀▀ ▀▀▀▀▀ · ▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀▀▀•
''')
time.sleep(30)
if(".pmkid" in filename):
status = "exhausted"
with open("./hashcat/hashcat-output.txt") as hashcatOutput:
results = hashcatOutput.readlines()
for result in results:
result = result.split(":")[-4] + ":" + result.split(":")[-3]
with open("./handshakes/pmkid/" + filename) as pmkidFile:
pmkids = pmkidFile.readlines()
for pmkid in pmkids:
pmkid = pmkid.split("*")[1] + ":" + pmkid.split("*")[2]
if(pmkid == result):
status = "cracked"
break
updateNetworkCrackedStatus(status)
else:
ssid = filename.split("_")[0]
status = "exhausted"
with open("./hashcat/hashcat-output.txt") as hashcatOutput:
results = hashcatOutput.readlines()
for result in results:
result = result.split(":")[-2]
result = re.sub('\W+','', result)
if(ssid == result):
status = "cracked"
break
updateNetworkCrackedStatus(status)