From 4a2091e688ef3bc8b6b2294639b8e2fcbf8e7c04 Mon Sep 17 00:00:00 2001 From: friedphish <50951356+friedphish@users.noreply.github.com> Date: Mon, 21 Oct 2019 09:53:32 +0200 Subject: [PATCH] Update wpa-sec.py Part 2 of closing https://github.com/evilsocket/pwnagotchi/issues/347. --- pwnagotchi/plugins/default/wpa-sec.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/default/wpa-sec.py b/pwnagotchi/plugins/default/wpa-sec.py index efa3faaf..6bf99940 100644 --- a/pwnagotchi/plugins/default/wpa-sec.py +++ b/pwnagotchi/plugins/default/wpa-sec.py @@ -25,19 +25,23 @@ def on_loaded(): logging.error("WPA_SEC: API-KEY isn't set. Can't upload to wpa-sec.stanev.org") return + if 'api_url' not in OPTIONS or ('api_url' in OPTIONS and OPTIONS['api_url'] is None): + logging.error("WPA_SEC: API-URL isn't set. Can't upload, no endpoint configured.") + return + READY = True def _upload_to_wpasec(path, timeout=30): """ - Uploads the file to wpa-sec.stanev.org + Uploads the file to https://wpa-sec.stanev.org, or another endpoint. """ with open(path, 'rb') as file_to_upload: cookie = {'key': OPTIONS['api_key']} payload = {'file': file_to_upload} try: - result = requests.post('https://wpa-sec.stanev.org', + result = requests.post(OPTIONS['api_url'], cookies=cookie, files=payload, timeout=timeout)