forked from itsdarklikehell/pwnagotchi-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay-aircrack.py
63 lines (55 loc) · 1.95 KB
/
display-aircrack.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
from pwnagotchi.ui.components import LabeledValue
from pwnagotchi.ui.view import BLACK
import pwnagotchi.ui.fonts as fonts
import pwnagotchi.plugins as plugins
import pwnagotchi
import logging
import os
class DisplayAircrack(plugins.Plugin):
__GitHub__ = ""
__author__ = "(edited by: itsdarklikehell [email protected]), @7h30th3r0n3"
__version__ = "1.0.0"
__license__ = "GPL3"
__description__ = "A plugin to display if aircrack is runing or not"
__name__ = "DisplayAircrack"
__help__ = "A plugin to display if aircrack is runing or not"
__dependencies__ = {
"apt": ["aircrack-ng"],
"pip": ["scapy"],
}
__defaults__ = {
"enabled": False,
}
def __init__(self):
self.ready = False
logging.debug(f"[{self.__class__.__name__}] plugin init")
self.title = ""
def on_loaded(self):
logging.info(f"[{self.__class__.__name__}] plugin loaded")
def on_ui_setup(self, ui):
ui.add_element(
"aircrack-ng-status",
LabeledValue(
color=BLACK,
label="",
value="",
position=(ui.width() // 2 - 10, 0),
label_font=fonts.Bold,
text_font=fonts.Medium,
),
)
def on_unload(self, ui):
with ui._lock:
try:
ui.remove_element("aircrack-ng-status")
logging.info(f"[{self.__class__.__name__}] plugin unloaded")
except Exception as e:
logging.error(f"[{self.__class__.__name__}] unload: %s" % e)
def on_ui_update(self, ui):
# Check if aircrack-ng is running and update status display
if "aircrack-ng" in os.popen("ps -A").read():
ui.set("aircrack-ng-status", "(1)")
else:
ui.set("aircrack-ng-status", "(0)")
def on_webhook(self, path, request):
logging.info(f"[{self.__class__.__name__}] webhook pressed")