Repository navigation
Expand file tree
/
Copy pathenable_deauth.py
More file actions
88 lines (75 loc) · 2.82 KB
/
Copy pathenable_deauth.py
File metadata and controls
88 lines (75 loc) · 2.82 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import logging
import pwnagotchi.plugins as plugins
from pwnagotchi.ui.components import LabeledValue
from pwnagotchi.ui.view import BLACK
import pwnagotchi.ui.fonts as fonts
class Do_Deauth(plugins.Plugin):
__GitHub__ = ""
__author__ = "(edited by: itsdarklikehell bauke.molenaar@gmail.com), evilsocket@gmail.com"
__version__ = "1.0.0"
__license__ = "GPL3"
__description__ = "Enable and disable DEAUTH on the fly. Enabled when plugin loads, disabled when plugin unloads."
__name__ = "Do_Deauth"
__help__ = "Enable and disable DEAUTH on the fly. Enabled when plugin loads, disabled when plugin unloads."
__dependencies__ = {
"apt": ["none"],
"pip": ["scapy"],
}
__defaults__ = {
"enabled": False,
}
def __init__(self):
self.ready = False
logging.debug(f"[{self.__class__.__name__}] plugin init")
self.title = ""
self._agent = None
self._count = 0
def on_webhook(self, path, request):
pass
# called when the plugin is loaded
def on_loaded(self):
self._count = 0
logging.info(f"[{self.__class__.__name__}] plugin loaded")
# called before the plugin is unloaded
def on_unload(self, ui):
if self._agent:
self._agent._config["personality"]["deauth"] = False
ui.remove_element("deauth_count")
logging.info(f"[{self.__class__.__name__}] unloading: disabled deauth")
# called when everything is ready and the main loop is about to start
def on_ready(self, agent):
agent._config["personality"]["deauth"] = True
self._agent = agent
logging.info(f"[{self.__class__.__name__}] ready: enabled deauth")
def on_deauthentication(self, agent, access_point, client_station):
self._count += 1
# called to setup the ui elements
def on_ui_setup(self, ui):
# add custom UI elements
try:
if "position" in self.options:
pos = self.options["position"].split(",")
pos = [int(x.strip()) for x in pos]
else:
pos = (0, 36)
ui.add_element(
"deauth_count",
LabeledValue(
color=BLACK,
label="D",
value="0",
position=pos,
label_font=fonts.BoldSmall,
text_font=fonts.Small,
),
)
except Exception as err:
logging.info("enable deauth ui error: %s" % repr(err))
# called when the ui is updated
def on_ui_update(self, ui):
# update those elements
try:
ui.set("deauth_count", "%d" % (self._count))
except Exception as err:
logging.info(
f"[{self.__class__.__name__}] ui error: %s" % repr(err))