From b4b14ba9fdfae28622ca33aad514a8e39379d82c Mon Sep 17 00:00:00 2001 From: FrixosTh <57304030+FrixosTh@users.noreply.github.com> Date: Sun, 3 Nov 2019 02:31:13 +0200 Subject: [PATCH] Bug Fix on AircrackOnly.py plugin The code will always delete the pcap file unless there is a PMKID due to the structure of the if statements. Added a new variable handshakeFound that will allow the file not to be deleted if there is a handshake and also it will scan for PMKID only if no handshake is found... If no handshake is found and no PMKID, only then the file is marked as to be deleted --- pwnagotchi/plugins/default/AircrackOnly.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pwnagotchi/plugins/default/AircrackOnly.py b/pwnagotchi/plugins/default/AircrackOnly.py index 4691e686..94372e4d 100644 --- a/pwnagotchi/plugins/default/AircrackOnly.py +++ b/pwnagotchi/plugins/default/AircrackOnly.py @@ -27,16 +27,16 @@ class AircrackOnly(plugins.Plugin): def on_handshake(self, agent, filename, access_point, client_station): display = agent._view todelete = 0 + handshakeFound = 0 result = subprocess.run(('/usr/bin/aircrack-ng ' + filename + ' | grep "1 handshake" | awk \'{print $2}\''), shell=True, stdout=subprocess.PIPE) result = result.stdout.decode('utf-8').translate({ord(c): None for c in string.whitespace}) if result: + handshakeFound = 1 logging.info("[AircrackOnly] contains handshake") - else: - todelete = 1 - if todelete == 0: + if handshakeFound == 0: result = subprocess.run(('/usr/bin/aircrack-ng ' + filename + ' | grep "PMKID" | awk \'{print $2}\''), shell=True, stdout=subprocess.PIPE) result = result.stdout.decode('utf-8').translate({ord(c): None for c in string.whitespace})