From 4d65fe1b496ed4ec297f1a0823c2a45c3ba78f76 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sat, 9 Sep 2023 23:05:08 +0200 Subject: [PATCH] Version 2.3.7 Signed-off-by: Jeroen Oudshoorn Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/auto-update.py | 8 +++++++- pwnagotchi/plugins/default/fix_services.py | 17 +++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pwnagotchi/plugins/default/auto-update.py b/pwnagotchi/plugins/default/auto-update.py index eac48f55..44329ff2 100644 --- a/pwnagotchi/plugins/default/auto-update.py +++ b/pwnagotchi/plugins/default/auto-update.py @@ -95,6 +95,7 @@ def verify(name, path, source_path, display, update): def install(display, update): + name = update['repo'].split('/')[1] path = make_path_for(name) @@ -125,7 +126,6 @@ def install(display, update): # setup.py is going to install data files for us os.system("cd %s && pip3 install ." % source_path) - return True @@ -189,9 +189,15 @@ class AutoUpdate(plugins.Plugin): for repo, local_version, is_native, svc_name in to_check: info = check(local_version, repo, is_native) if info['url'] is not None: + # Turn of bettercap wifi recon while updating + from pwnagotchi.bettercap import Client + agent = Client('localhost', port=8081, username="pwnagotchi", password="pwnagotchi") + agent.run("wifi.recon off") + logging.warning( "update for %s available (local version is '%s'): %s" % ( repo, info['current'], info['url'])) + logging.info("[update] turned off wifi recon ...") info['service'] = svc_name to_install.append(info) diff --git a/pwnagotchi/plugins/default/fix_services.py b/pwnagotchi/plugins/default/fix_services.py index 6fe52a45..c26af9cb 100644 --- a/pwnagotchi/plugins/default/fix_services.py +++ b/pwnagotchi/plugins/default/fix_services.py @@ -286,7 +286,7 @@ class FixServices(plugins.Plugin): # unload the module cmd_output = subprocess.check_output("sudo modprobe -r brcmfmac", shell=True) self.logPrintView("info", "[Fix_Services] unloaded brcmfmac", display, - {"status": "Turning it off #%d" % tries, "face": faces.SMART}) + {"status": "Turning it off #%s" % tries, "face": faces.SMART}) self._status = "ul" time.sleep(1 + tries) @@ -301,12 +301,9 @@ class FixServices(plugins.Plugin): # success! now make the mon0 try: - cmd_output = subprocess.check_output( - "monstart", - shell=True) - self.logPrintView("info", - "[Fix_Services interface add wlan0mon] worked #%d: %s" % ( - tries, cmd_output)) + cmd_output = subprocess.check_output("monstart", shell=True) + self.logPrintView("info", "[Fix_Services interface add wlan0mon] worked #%s: %s" + % (tries, cmd_output)) self._status = "up" time.sleep(tries + 5) try: @@ -326,15 +323,15 @@ class FixServices(plugins.Plugin): logging.info( "[Fix_Services set wifi.interface wlan0mon] except: %s" % repr(err)) except Exception as cerr: # - if not display: print("failed loading wlan0mon attempt #%d: %s" % (tries, repr(cerr))) + if not display: print("failed loading wlan0mon attempt #%s: %s" % (tries, repr(cerr))) except Exception as err: # from modprobe if not display: print("Failed reloading brcmfmac") logging.error("[Fix_Services] Failed reloading brcmfmac %s" % repr(err)) except Exception as nope: # from modprobe -r # fails if already unloaded, so probably fine - logging.error("[Fix_Services #%d modprobe -r] %s" % (tries, repr(nope))) - if not display: print("[Fix_Services #%d modprobe -r] %s" % (tries, repr(nope))) + logging.error("[Fix_Services #%s modprobe -r] %s" % (tries, repr(nope))) + if not display: print("[Fix_Services #%s modprobe -r] %s" % (tries, repr(nope))) pass tries = tries + 1