diff --git a/pwnagotchi/defaults.yml b/pwnagotchi/defaults.yml index 00ee2ff1d..a9e4c8298 100644 --- a/pwnagotchi/defaults.yml +++ b/pwnagotchi/defaults.yml @@ -64,6 +64,8 @@ main: quickdic: enabled: false wordlist_folder: /opt/wordlists/ + AircrackOnly: + enabled: false # monitor interface to use iface: mon0 # command to run to bring the mon interface up in case it's not up already diff --git a/pwnagotchi/plugins/default/AircrackOnly.py b/pwnagotchi/plugins/default/AircrackOnly.py new file mode 100644 index 000000000..b1baa9994 --- /dev/null +++ b/pwnagotchi/plugins/default/AircrackOnly.py @@ -0,0 +1,57 @@ +__author__ = 'pwnagotchi [at] rossmarks [dot] uk' +__version__ = '1.0.0' +__name__ = 'AircrackOnly' +__license__ = 'GPL3' +__description__ = 'confirm pcap contains handshake/PMKID or delete it' + +''' +Aircrack-ng needed, to install: +> apt-get install aircrack-ng +''' + +import logging +import subprocess +import string +import re +import os + +OPTIONS = dict() + +def on_loaded(): + logging.info("cleancap plugin loaded") + +def on_handshake(agent, filename, access_point, client_station): + display = agent._view + todelete = 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: + logging.info("[AircrackOnly] contains handshake") + else: + todetele = 1 + + if todelete == 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}) + if result: + logging.info("[AircrackOnly] contains PMKID") + else: + todetele = 1 + + if todelete == 1: + os.remove(filename) + set_text("uncrackable pcap") + display.update(force=True) + +text_to_set = ""; +def set_text(text): + global text_to_set + text_to_set = text + +def on_ui_update(ui): + global text_to_set + if text_to_set: + ui.set('face', "(>.<)") + ui.set('status', text_to_set) + text_to_set = ""