From 8b62108a1538bd6162cfc1199a40c9714ee7d701 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 09:01:35 +0200 Subject: [PATCH 1/6] v2.4.3 Signed-off-by: Jeroen Oudshoorn --- builder/pwnagotchi.yml | 2 +- pwnagotchi/ui/view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index ec8366c2..70a91bbb 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -418,7 +418,7 @@ - name: install pwngrid 1.10.4 shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && sudo make && sudo make install" args: - executables: /bin/bash + executable: /bin/bash chdir: /usr/local/src/pwngrid when: pwngrid.changed diff --git a/pwnagotchi/ui/view.py b/pwnagotchi/ui/view.py index 7647ca23..4d05894f 100644 --- a/pwnagotchi/ui/view.py +++ b/pwnagotchi/ui/view.py @@ -40,7 +40,7 @@ class View(object): self._width = self._layout['width'] self._height = self._layout['height'] self._state = State(state={ - 'channel': LabeledValue(color=BLACK, label='CH', value='000', position=self._layout['channel'], + 'channel': LabeledValue(color=BLACK, label='CH', value='00', position=self._layout['channel'], label_font=fonts.Bold, text_font=fonts.Medium), 'aps': LabeledValue(color=BLACK, label='APS', value='0 (00)', position=self._layout['aps'], From 9640f88d2f5ffa13ec1dfd291e226a5333b4dbd6 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 07:24:06 +0200 Subject: [PATCH 2/6] multiple edits Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/__init__.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py index c5d2efd7..8f4ed73c 100644 --- a/pwnagotchi/plugins/__init__.py +++ b/pwnagotchi/plugins/__init__.py @@ -130,8 +130,21 @@ def load_from_path(path, enabled=()): def load(config): enabled = [name for name, options in config['main']['plugins'].items() if 'enabled' in options and options['enabled']] - - pwnagotchi.grid.update_data(None, enabled) + data = { + 'session': { + 'duration': "", + 'epochs': "", + 'train_epochs': "", + 'avg_reward': "", + 'min_reward': "", + 'max_reward': "", + 'deauthed': "", + 'associated': "", + 'handshakes': "", + 'peers': "", + } + } + pwnagotchi.grid.update_data(data, enabled) # load default plugins load_from_path(default_path, enabled=enabled) From 1a1638a68e130880af8ea3e3d48bc1b8c91dbcec Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 07:28:50 +0200 Subject: [PATCH 3/6] multiple edits Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/grid.py | 3 +-- pwnagotchi/plugins/__init__.py | 15 --------------- pwnagotchi/plugins/default/grid.py | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pwnagotchi/grid.py b/pwnagotchi/grid.py index dab0034f..11101c51 100644 --- a/pwnagotchi/grid.py +++ b/pwnagotchi/grid.py @@ -84,8 +84,7 @@ def update_data(last_session, plugin_data): 'uname': subprocess.getoutput("uname -a"), 'brain': brain, 'version': pwnagotchi.__version__, - 'build': "Pwnagotchi-Torch by Jayofelony", - 'plugins': plugin_data + 'build': "Pwnagotchi-Torch by Jayofelony" } logging.debug("updating grid data: %s" % data) diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py index 8f4ed73c..0d913b49 100644 --- a/pwnagotchi/plugins/__init__.py +++ b/pwnagotchi/plugins/__init__.py @@ -130,21 +130,6 @@ def load_from_path(path, enabled=()): def load(config): enabled = [name for name, options in config['main']['plugins'].items() if 'enabled' in options and options['enabled']] - data = { - 'session': { - 'duration': "", - 'epochs': "", - 'train_epochs': "", - 'avg_reward': "", - 'min_reward': "", - 'max_reward': "", - 'deauthed': "", - 'associated': "", - 'handshakes': "", - 'peers': "", - } - } - pwnagotchi.grid.update_data(data, enabled) # load default plugins load_from_path(default_path, enabled=enabled) diff --git a/pwnagotchi/plugins/default/grid.py b/pwnagotchi/plugins/default/grid.py index 79259a3a..2fbd0427 100644 --- a/pwnagotchi/plugins/default/grid.py +++ b/pwnagotchi/plugins/default/grid.py @@ -130,7 +130,7 @@ class Grid(plugins.Plugin): with self.lock: try: - grid.update_data(agent.last_session, None) + grid.update_data(agent.last_session) except Exception as e: logging.error("error connecting to the pwngrid-peer service: %s" % e) logging.debug(e, exc_info=True) From 1a629d749e5772e917b93bbcc62afcd815f05e41 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 07:30:01 +0200 Subject: [PATCH 4/6] multiple edits Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwnagotchi/grid.py b/pwnagotchi/grid.py index 11101c51..78edb804 100644 --- a/pwnagotchi/grid.py +++ b/pwnagotchi/grid.py @@ -60,7 +60,7 @@ def closest_peer(): return all[0] if len(all) else None -def update_data(last_session, plugin_data): +def update_data(last_session): brain = {} try: with open('/root/brain.json') as fp: From 5ed92eec7ab77eddfcbc51304210fd0e31078e32 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 07:48:47 +0200 Subject: [PATCH 5/6] multiple edits Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/grid.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pwnagotchi/grid.py b/pwnagotchi/grid.py index 78edb804..f5e77353 100644 --- a/pwnagotchi/grid.py +++ b/pwnagotchi/grid.py @@ -67,6 +67,8 @@ def update_data(last_session): brain = json.load(fp) except: pass + enabled = [name for name, options in config['main']['plugins'].items() if + 'enabled' in options and options['enabled']] data = { 'session': { @@ -84,7 +86,8 @@ def update_data(last_session): 'uname': subprocess.getoutput("uname -a"), 'brain': brain, 'version': pwnagotchi.__version__, - 'build': "Pwnagotchi-Torch by Jayofelony" + 'build': "Pwnagotchi-Torch by Jayofelony", + 'plugins': enabled } logging.debug("updating grid data: %s" % data) From bd355086349bba2d6d2cf0443f5ec5e8fe588af3 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 07:57:07 +0200 Subject: [PATCH 6/6] multiple edits Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwnagotchi/grid.py b/pwnagotchi/grid.py index f5e77353..eecb288f 100644 --- a/pwnagotchi/grid.py +++ b/pwnagotchi/grid.py @@ -67,7 +67,7 @@ def update_data(last_session): brain = json.load(fp) except: pass - enabled = [name for name, options in config['main']['plugins'].items() if + enabled = [name for name, options in pwnagotchi.config['main']['plugins'].items() if 'enabled' in options and options['enabled']] data = {