-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdeauth.py
More file actions
81 lines (70 loc) · 2.51 KB
/
Copy pathdeauth.py
File metadata and controls
81 lines (70 loc) · 2.51 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
import logging
from pwnagotchi import plugins
from pwnagotchi.ui import fonts
from pwnagotchi.ui.components import LabeledValue
from pwnagotchi.ui.view import BLACK
class Deauth(plugins.Plugin):
__GitHub__ = ""
__author__ = "(edited by: itsdarklikehell bauke.molenaar@gmail.com), scorp"
__version__ = "2.0.0"
__license__ = "MIT"
__description__ = (
"A plugin that counts the successful deauth attacks of this session."
)
__name__ = "deauth"
__help__ = "A plugin that counts the successful deauth attacks of this session."
__dependencies__ = {
"apt": ["none"],
"pip": ["scapy"],
}
__defaults__ = {
"enabled": False,
}
def __init__(self):
self.deauth_counter = 0
self.handshake_counter = 0
logging.debug(f"[{self.__class__.__name__}] plugin init")
def on_loaded(self):
logging.info(f"[{self.__class__.__name__}] plugin loaded")
def on_ui_setup(self, ui):
# add custom UI elements
ui.add_element(
"deauth",
LabeledValue(
color=BLACK,
label="Deauths ",
value=str(self.deauth_counter),
position=(ui.width() / 2 + 50, ui.height() - 25),
label_font=fonts.Bold,
text_font=fonts.Medium,
),
)
ui.add_element(
"hand",
LabeledValue(
color=BLACK,
label="Handshakes ",
value=str(self.handshake_counter),
position=(ui.width() / 2 + 50, ui.height() - 35),
label_font=fonts.Bold,
text_font=fonts.Medium,
),
)
def on_ui_update(self, ui):
# update those elements
ui.set("deauth", str(self.deauth_counter))
ui.set("hand", str(self.handshake_counter))
def on_deauthentication(self, agent, access_point, client_station):
self.deauth_counter += 1
def on_handshake(self, agent, filename, access_point, client_station):
self.handshake_counter += 1
def on_unload(self, ui):
with ui._lock:
try:
ui.remove_element("deauth")
ui.remove_element("hand")
logging.info(f"[{self.__class__.__name__}] plugin unloaded")
except Exception as e:
logging.error(f"[{self.__class__.__name__}] unload: %s" % e)
def on_webhook(self, path, request):
logging.info(f"[{self.__class__.__name__}] webhook pressed")