mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
@ -40,6 +40,8 @@ main.plugins.pisugar2.enabled = false
|
|||||||
main.plugins.pisugar2.shutdown = 5
|
main.plugins.pisugar2.shutdown = 5
|
||||||
main.plugins.pisugar2.sync_rtc_on_boot = false
|
main.plugins.pisugar2.sync_rtc_on_boot = false
|
||||||
|
|
||||||
|
main.plugins.display-password.enabled = false
|
||||||
|
|
||||||
main.plugins.grid.enabled = true
|
main.plugins.grid.enabled = true
|
||||||
main.plugins.grid.report = true
|
main.plugins.grid.report = true
|
||||||
main.plugins.grid.exclude = [
|
main.plugins.grid.exclude = [
|
||||||
|
@ -43,7 +43,7 @@ def toggle_plugin(name, enable=True):
|
|||||||
global loaded, database
|
global loaded, database
|
||||||
|
|
||||||
if pwnagotchi.config:
|
if pwnagotchi.config:
|
||||||
if name not in pwnagotchi.config['main']['plugins']:
|
if not name in pwnagotchi.config['main']['plugins']:
|
||||||
pwnagotchi.config['main']['plugins'][name] = dict()
|
pwnagotchi.config['main']['plugins'][name] = dict()
|
||||||
pwnagotchi.config['main']['plugins'][name]['enabled'] = enable
|
pwnagotchi.config['main']['plugins'][name]['enabled'] = enable
|
||||||
save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml')
|
save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml')
|
||||||
|
70
pwnagotchi/plugins/default/display-password.py
Normal file
70
pwnagotchi/plugins/default/display-password.py
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
# display-password shows recently cracked passwords on the pwnagotchi display
|
||||||
|
#
|
||||||
|
#
|
||||||
|
###############################################################
|
||||||
|
#
|
||||||
|
# Inspired by, and code shamelessly yoinked from
|
||||||
|
# the pwnagotchi memtemp.py plugin by https://github.com/xenDE
|
||||||
|
#
|
||||||
|
###############################################################
|
||||||
|
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 DisplayPassword(plugins.Plugin):
|
||||||
|
__author__ = '@nagy_craig'
|
||||||
|
__version__ = '1.0.0'
|
||||||
|
__license__ = 'GPL3'
|
||||||
|
__description__ = 'A plugin to display recently cracked passwords'
|
||||||
|
__name__ = 'display-password'
|
||||||
|
__help__ = """
|
||||||
|
Displays recently cracked passwords
|
||||||
|
"""
|
||||||
|
__defaults__ = {
|
||||||
|
'enabled': False,
|
||||||
|
}
|
||||||
|
|
||||||
|
def on_loaded(self):
|
||||||
|
logging.info("display-password loaded")
|
||||||
|
|
||||||
|
def on_ui_setup(self, ui):
|
||||||
|
with ui._lock():
|
||||||
|
if ui.is_waveshare_v2():
|
||||||
|
h_pos = (0, 95)
|
||||||
|
v_pos = (180, 61)
|
||||||
|
elif ui.is_waveshare_v1():
|
||||||
|
h_pos = (0, 95)
|
||||||
|
v_pos = (170, 61)
|
||||||
|
elif ui.is_waveshare144lcd():
|
||||||
|
h_pos = (0, 92)
|
||||||
|
v_pos = (78, 67)
|
||||||
|
elif ui.is_inky():
|
||||||
|
h_pos = (0, 83)
|
||||||
|
v_pos = (165, 54)
|
||||||
|
elif ui.is_waveshare27inch():
|
||||||
|
h_pos = (0, 153)
|
||||||
|
v_pos = (216, 122)
|
||||||
|
else:
|
||||||
|
h_pos = (0, 91)
|
||||||
|
v_pos = (180, 61)
|
||||||
|
|
||||||
|
if self.options['orientation'] == "vertical":
|
||||||
|
ui.add_element('display-password', LabeledValue(color=BLACK, label='', value='', position=v_pos,
|
||||||
|
label_font=fonts.Bold, text_font=fonts.Small))
|
||||||
|
else:
|
||||||
|
# default to horizontal
|
||||||
|
ui.add_element('display-password', LabeledValue(color=BLACK, label='', value='', position=h_pos,
|
||||||
|
label_font=fonts.Bold, text_font=fonts.Small))
|
||||||
|
|
||||||
|
def on_unload(self, ui):
|
||||||
|
with ui._lock:
|
||||||
|
ui.remove_element('display-password')
|
||||||
|
|
||||||
|
def on_ui_update(self, ui):
|
||||||
|
last_line = 'tail -n 1 /root/handshakes/wpa-sec.cracked.potfile | awk -F: \'{print $3 " - " $4}\''
|
||||||
|
ui.set('display-password', "%s" % (os.popen(last_line).read().rstrip()))
|
Reference in New Issue
Block a user