diff --git a/pwnagotchi/defaults.yml b/pwnagotchi/defaults.yml index 0d503465..72964598 100644 --- a/pwnagotchi/defaults.yml +++ b/pwnagotchi/defaults.yml @@ -19,26 +19,10 @@ main: report: false # don't report pwned networks by default! exclude: # do not report the following networks (accepts both ESSIDs and BSSIDs) - YourHomeNetworkHere - auto-update: enabled: true install: true # if false, it will only warn that updates are available, if true it will install them interval: 1 # every 1 hour - - auto-backup: - enabled: false - interval: 1 # every day - max_tries: 0 # 0=infinity - files: - - /root/brain.nn - - /root/brain.json - - /root/.api-report.json - - /root/handshakes/ - - /root/peers/ - - /etc/pwnagotchi/ - - /var/log/pwnagotchi.log - commands: - - 'tar czf /root/pwnagotchi-backup.tar.gz {files}' net-pos: enabled: false api_key: 'test' @@ -46,12 +30,6 @@ main: enabled: false speed: 19200 device: /dev/ttyUSB0 - twitter: - enabled: false - consumer_key: aaa - consumer_secret: aaa - access_token_key: aaa - access_token_secret: aaa onlinehashcrack: enabled: false email: ~ @@ -62,14 +40,6 @@ main: wigle: enabled: false api_key: ~ - screen_refresh: - enabled: false - refresh_interval: 50 - quickdic: - enabled: false - wordlist_folder: /opt/wordlists/ - AircrackOnly: - enabled: false bt-tether: enabled: false # if you want to use this, set ui.display.video.address to 0.0.0.0 devices: diff --git a/pwnagotchi/plugins/default/AircrackOnly.py b/pwnagotchi/plugins/default/AircrackOnly.py deleted file mode 100644 index 1470b1c9..00000000 --- a/pwnagotchi/plugins/default/AircrackOnly.py +++ /dev/null @@ -1,56 +0,0 @@ -import pwnagotchi.plugins as plugins - -import logging -import subprocess -import string -import os - -''' -Aircrack-ng needed, to install: -> apt-get install aircrack-ng -''' - - -class AircrackOnly(plugins.Plugin): - __author__ = 'pwnagotchi [at] rossmarks [dot] uk' - __version__ = '1.0.1' - __license__ = 'GPL3' - __description__ = 'confirm pcap contains handshake/PMKID or delete it' - - def __init__(self): - self.text_to_set = "" - - def on_loaded(self): - logging.info("aircrackonly plugin loaded") - - 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") - - 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}) - if result: - logging.info("[AircrackOnly] contains PMKID") - else: - todelete = 1 - - if todelete == 1: - os.remove(filename) - self.text_to_set = "Removed an uncrackable pcap" - display.update(force=True) - - def on_ui_update(self, ui): - if self.text_to_set: - ui.set('face', "(>.<)") - ui.set('status', self.text_to_set) - self.text_to_set = "" diff --git a/pwnagotchi/plugins/default/auto-backup.py b/pwnagotchi/plugins/default/auto-backup.py deleted file mode 100644 index a033e05c..00000000 --- a/pwnagotchi/plugins/default/auto-backup.py +++ /dev/null @@ -1,65 +0,0 @@ -import pwnagotchi.plugins as plugins -from pwnagotchi.utils import StatusFile -import logging -import os -import subprocess - - -class AutoBackup(plugins.Plugin): - __author__ = '33197631+dadav@users.noreply.github.com' - __version__ = '1.0.0' - __license__ = 'GPL3' - __description__ = 'This plugin backups files when internet is available.' - - def __init__(self): - self.ready = False - self.tries = 0 - self.status = StatusFile('/root/.auto-backup') - - def on_loaded(self): - for opt in ['files', 'interval', 'commands', 'max_tries']: - if opt not in self.options or (opt in self.options and self.options[opt] is None): - logging.error(f"AUTO-BACKUP: Option {opt} is not set.") - return - - self.ready = True - logging.info("AUTO-BACKUP: Successfully loaded.") - - def on_internet_available(self, agent): - if not self.ready: - return - - if self.options['max_tries'] and self.tries >= self.options['max_tries']: - return - - if self.status.newer_then_days(self.options['interval']): - return - - # Only backup existing files to prevent errors - existing_files = list(filter(lambda f: os.path.exists(f), self.options['files'])) - files_to_backup = " ".join(existing_files) - - try: - display = agent.view() - - logging.info("AUTO-BACKUP: Backing up ...") - display.set('status', 'Backing up ...') - display.update() - - for cmd in self.options['commands']: - logging.info(f"AUTO-BACKUP: Running {cmd.format(files=files_to_backup)}") - process = subprocess.Popen(cmd.format(files=files_to_backup), shell=True, stdin=None, - stdout=open("/dev/null", "w"), stderr=None, executable="/bin/bash") - process.wait() - if process.returncode > 0: - raise OSError(f"Command failed (rc: {process.returncode})") - - logging.info("AUTO-BACKUP: backup done") - display.set('status', 'Backup done!') - display.update() - self.status.update() - except OSError as os_e: - self.tries += 1 - logging.info(f"AUTO-BACKUP: Error: {os_e}") - display.set('status', 'Backup failed!') - display.update() diff --git a/pwnagotchi/plugins/default/quickdic.py b/pwnagotchi/plugins/default/quickdic.py deleted file mode 100644 index 7bdd6470..00000000 --- a/pwnagotchi/plugins/default/quickdic.py +++ /dev/null @@ -1,51 +0,0 @@ -import logging -import subprocess -import string -import re -import pwnagotchi.plugins as plugins - -''' -Aircrack-ng needed, to install: -> apt-get install aircrack-ng -Upload wordlist files in .txt format to folder in config file (Default: /opt/wordlists/) -Cracked handshakes stored in handshake folder as [essid].pcap.cracked -''' - - -class QuickDic(plugins.Plugin): - __author__ = 'pwnagotchi [at] rossmarks [dot] uk' - __version__ = '1.0.0' - __license__ = 'GPL3' - __description__ = 'Run a quick dictionary scan against captured handshakes' - - def __init__(self): - self.text_to_set = "" - - def on_loaded(self): - logging.info("Quick dictionary check plugin loaded") - - def on_handshake(self, agent, filename, access_point, client_station): - display = agent.view() - 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 not result: - logging.info("[quickdic] No handshake") - else: - logging.info("[quickdic] Handshake confirmed") - result2 = subprocess.run(('aircrack-ng -w `echo ' + self.options[ - 'wordlist_folder'] + '*.txt | sed \'s/\ /,/g\'` -l ' + filename + '.cracked -q -b ' + result + ' ' + filename + ' | grep KEY'), - shell=True, stdout=subprocess.PIPE) - result2 = result2.stdout.decode('utf-8').strip() - logging.info("[quickdic] " + result2) - if result2 != "KEY NOT FOUND": - key = re.search('\[(.*)\]', result2) - pwd = str(key.group(1)) - self.text_to_set = "Cracked password: " + pwd - display.update(force=True) - - def on_ui_update(self, ui): - if self.text_to_set: - ui.set('face', "(·ω·)") - ui.set('status', self.text_to_set) - self.text_to_set = "" diff --git a/pwnagotchi/plugins/default/screen_refresh.py b/pwnagotchi/plugins/default/screen_refresh.py deleted file mode 100644 index 25ea3252..00000000 --- a/pwnagotchi/plugins/default/screen_refresh.py +++ /dev/null @@ -1,23 +0,0 @@ -import logging -import pwnagotchi.plugins as plugins - - -class ScreenRefresh(plugins.Plugin): - __author__ = 'pwnagotchi [at] rossmarks [dot] uk' - __version__ = '1.0.0' - __license__ = 'GPL3' - __description__ = 'Refresh he e-ink display after X amount of updates' - - def __init__(self): - self.update_count = 0; - - def on_loaded(self): - logging.info("Screen refresh plugin loaded") - - def on_ui_update(self, ui): - self.update_count += 1 - if self.update_count == self.options['refresh_interval']: - ui.init_display() - ui.set('status', "Screen cleaned") - logging.info("Screen refreshing") - self.update_count = 0 diff --git a/pwnagotchi/plugins/default/twitter.py b/pwnagotchi/plugins/default/twitter.py deleted file mode 100644 index 80bb2bac..00000000 --- a/pwnagotchi/plugins/default/twitter.py +++ /dev/null @@ -1,49 +0,0 @@ -import logging -from pwnagotchi.voice import Voice -import pwnagotchi.plugins as plugins - - -class Twitter(plugins.Plugin): - __author__ = 'evilsocket@gmail.com' - __version__ = '1.0.0' - __license__ = 'GPL3' - __description__ = 'This plugin creates tweets about the recent activity of pwnagotchi' - - def on_loaded(self): - logging.info("twitter plugin loaded.") - - # called in manual mode when there's internet connectivity - def on_internet_available(self, agent): - config = agent.config() - display = agent.view() - last_session = agent.last_session - - if last_session.is_new() and last_session.handshakes > 0: - try: - import tweepy - except ImportError: - logging.error("Couldn't import tweepy") - return - - logging.info("detected a new session and internet connectivity!") - - picture = '/root/pwnagotchi.png' - - display.on_manual_mode(last_session) - display.update(force=True) - display.image().save(picture, 'png') - display.set('status', 'Tweeting...') - display.update(force=True) - - try: - auth = tweepy.OAuthHandler(self.options['consumer_key'], self.options['consumer_secret']) - auth.set_access_token(self.options['access_token_key'], self.options['access_token_secret']) - api = tweepy.API(auth) - - tweet = Voice(lang=config['main']['lang']).on_last_session_tweet(last_session) - api.update_with_media(filename=picture, status=tweet) - last_session.save_session_id() - - logging.info("tweeted: %s" % tweet) - except Exception as e: - logging.exception("error while tweeting")