diff --git a/scripts/create_sibling.sh b/scripts/create_sibling.sh index 55b784f..f2f5c5f 100755 --- a/scripts/create_sibling.sh +++ b/scripts/create_sibling.sh @@ -335,7 +335,13 @@ fi setup_raspbian provision_raspbian -echo -e "[+] Congratz, it's a boy (⌐■_■)!" +#Make a baby with a random gender, maybe do something fun with this later! +gender[0]="boy" +gender[1]="girl" + +rand=$[ $RANDOM % 2 ] + +echo -e "[+] Congratz, it's a ${arr[$rand]} (⌐■_■)!" echo -e "[+] One more step: dd if=../${PWNI_OUTPUT} of=<PATH_TO_SDCARD> bs=4M status=progress" if [ "${OPT_SPARSE}" -eq 1 ]; diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py new file mode 100644 index 0000000..48ea525 --- /dev/null +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py @@ -0,0 +1,76 @@ +__author__ = '33197631+dadav@users.noreply.github.com' +__version__ = '1.0.0' +__name__ = 'wpa_sec' +__license__ = 'GPL3' +__description__ = 'This plugin automatically uploades handshakes to https://wpa-sec.stanev.org' +__enabled__ = False + +import os +import logging +import subprocess + +READY = False +API_KEY = None +ALREADY_UPLOADED = None + +# INSTALLATION: +## apt-get install libcurl4-openssl-dev +## https://github.com/ZerBea/hcxtools.git +## cd hcxtools; gcc wlancap2wpasec.c -o wlancap2wpasec -lcurl +## mv wlancap2wpasec /usr/bin/ + +def on_loaded(): + global READY + global API_KEY + global ALREADY_UPLOADED + + if not API_KEY: + logging.error("WPA_SEC: API-KEY isn't set. Can't upload to wpa-sec.stanev.org") + return + + try: + subprocess.call("wlancap2wpasec -h >/dev/null".split(), stdout=open(os.devnull, 'wb')) + except OSError: + logging.error("WPA_SEC: Can't find wlancap2wpasec. Install hcxtools to use this plugin!") + return + + try: + with open('/root/.wpa_sec_uploads', 'r') as f: + ALREADY_UPLOADED = f.read().splitlines() + except OSError: + logging.error('WPA_SEC: No upload-file found.') + ALREADY_UPLOADED = [] + + READY = True + + +def _upload_to_wpasec(path): + try: + subprocess.call(f"wlancap2wpasec -k {API_KEY} {path}".split(), stdout=open(os.devnull, 'wb')) + except OSError as os_e: + logging.error(f"WPA_SEC: Error while uploading {path}") + raise os_e + +# called in manual mode when there's internet connectivity +def on_internet_available(display, config, log): + if READY: + + handshake_dir = config['bettercap']['handshakes'] + handshake_filenames = os.listdir(handshake_dir) + handshake_paths = [os.path.join(handshake_dir, filename) for filename in handshake_filenames] + handshake_new = set(handshake_paths) - set(ALREADY_UPLOADED) + + if handhake_new: + logging.info("Internet connectivity detected.\ + Uploading new handshakes to wpa-sec.stanev.org") + + for idx, handshake in enumerate(handshake_new): + display.set('status', f"Uploading handshake to wpa-sec.stanev.org ({idx + 1}/{len(handshake_new})") + display.update(force=True) + try: + _upload_to_wpasec(handshake) + ALREADY_UPLOADED.append(handshake) + with open('/root/.wpa_sec_uploads', 'a') as f: + f.write(handshake + "\n") + except OSError: + pass