-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
show_pwd.py
40 lines (33 loc) · 1.47 KB
/
show_pwd.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
from pwnagotchi.ui.components import LabeledValue
from pwnagotchi.ui.view import BLACK
import pwnagotchi.ui.fonts as fonts
import pwnagotchi.plugins as plugins
import logging
import os
class ShowPwd(plugins.Plugin):
__author__ = '@jayofelony'
__version__ = '1.0.1'
__name__ = "Show Pwd"
__license__ = 'GPL3'
__description__ = 'A plugin to display recently cracked passwords'
def __init__(self):
self.options = dict()
def on_loaded(self):
logging.info("show_pwd loaded")
if 'orientation' not in self.options:
self.options['orientation'] = 'horizontal'
def on_ui_setup(self, ui):
if self.options['orientation'] == "vertical":
ui.add_element('show_pwd', LabeledValue(color=BLACK, label='', value='', position=(180, 61),
label_font=fonts.Bold, text_font=fonts.Small))
else:
# default to horizontal
ui.add_element('show_pwd', LabeledValue(color=BLACK, label='', value='', position=(0, 91),
label_font=fonts.Bold, text_font=fonts.Small))
def on_unload(self, ui):
with ui._lock:
ui.remove_element('show_pwd')
def on_ui_update(self, ui):
last_line = os.popen('awk -F: \'!seen[$3]++ {print $3 " - " $4}\' /root/handshakes/wpa-sec.cracked.potfile | tail -n 1')
last_line = last_line.read().rstrip()
ui.set('show_pwd', "%s" % last_line)