forked from hazcod/ISIS-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crack_network.py
executable file
·47 lines (41 loc) · 1.12 KB
/
crack_network.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
#!/usr/bin/python
import crack_wep
import socket
from database import *
import os
import capture_4_way_handshake
def crack_network(ESSID):
query="select encryption from ap_info where caption= '"
query+=socket.gethostname()
query+="'and wifi_network='"
query+=ESSID
query+="';"
result= executequery (query)
encryption= result [0][0]
query="select channel, mac_adress, quality from ap_info where caption = '"
query+=socket.gethostname()
query+="'and wifi_network ='"
query+=(ESSID)
query+="' order by 3 desc limit 1"
result= executequery(query)
channel=result[0][0]
BSSID=result[0][1]
print ("found encryption")
if encryption=="WEP":
crack_wep.automated_crack(ESSID, BSSID, channel)
file= open ("/home/isis/key")
key= file.read()
query= "update ap_info set wifi_key = '"
query+=key
query+="' where wifi_network = '"
query+=ESSID
query+="';"
executequery(query)
file.close()
os.remove("/home/isis/key")
elif encryption=="WPA2 Version 1 PSK":
capture_4_way_handshake.automated(BSSID, channel, ESSID)
else:
raise Exception("Cracking not supported")
if __name__ == '__main__':
crack_network ("airmon-ng")