diff --git a/bin/pwnagotchi b/bin/pwnagotchi index 3be7320e..6e9584f6 100755 --- a/bin/pwnagotchi +++ b/bin/pwnagotchi @@ -7,6 +7,7 @@ import sys import toml import requests import os +import re import pwnagotchi from pwnagotchi import utils @@ -160,6 +161,14 @@ if __name__ == '__main__': sys.exit(0) if args.wizard: + def is_valid_hostname(hostname): + if len(hostname) > 255: + return False + if hostname[-1] == ".": + hostname = hostname[:-1] # strip exactly one dot from the right, if present + allowed = re.compile("(?!-)[A-Z\d-]{1,63}(? 0: f.write("main.whitelist = [\n") for x in range(int(pwn_whitelist)): @@ -198,7 +209,7 @@ if __name__ == '__main__': f.write("\t\"" + bssid + "\",\n") f.write("]\n") # set bluetooth tether - pwn_bluetooth = input("Do you want to enable BT-Tether? [Y/N]") + pwn_bluetooth = input("Do you want to enable BT-Tether? [Y/N] ") if pwn_bluetooth.lower() in ('y', 'yes'): f.write("main.plugins.bt-tether.enabled = true\n\n") pwn_bluetooth_device = input("What device do you use? Android or iOS? ") @@ -213,7 +224,7 @@ if __name__ == '__main__': if pwn_bluetooth_mac != "": f.write("main.plugins.bt-tether.devices.android-phone.mac = \"" + pwn_bluetooth_mac + "\"\n") # set up display settings - pwn_display_enabled = input("Do you use a display? [Y/N]\n") + pwn_display_enabled = input("Do you use a display? [Y/N] ") if pwn_display_enabled.lower() in ('y', 'yes'): f.write("ui.display.enabled = true\n") pwn_display_type = input("What display do you use?\n\n"