diff --git a/pwnagotchi/plugins/default/wigle.py b/pwnagotchi/plugins/default/wigle.py index 353660ea..3f387795 100644 --- a/pwnagotchi/plugins/default/wigle.py +++ b/pwnagotchi/plugins/default/wigle.py @@ -86,10 +86,11 @@ def _send_to_wigle(lines, api_key, donate=True, timeout=30): dummy.seek(0) - headers = {'Authorization': f"Basic {api_key}", - 'Accept': 'application/json'} - data = {'donate': 'on' if donate else 'false'} - payload = {'file': (pwnagotchi.name() + ".csv", dummy, 'multipart/form-data', {'Expires': '0'})} + headers = {"Authorization": f"Basic {api_key}", + "Accept": "application/json", + "HTTP_USER_AGENT": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"} + data = {"donate": "on" if donate else "false"} + payload = {"file": (pwnagotchi.name() + ".csv", dummy, "multipart/form-data", {"Expires": "0"})} try: res = requests.post('https://api.wigle.net/api/v2/file/upload', data=data, diff --git a/pwnagotchi/plugins/default/wpa-sec.py b/pwnagotchi/plugins/default/wpa-sec.py index 0d2f20c1..ff1a0fbd 100644 --- a/pwnagotchi/plugins/default/wpa-sec.py +++ b/pwnagotchi/plugins/default/wpa-sec.py @@ -35,12 +35,15 @@ def _upload_to_wpasec(self, path, timeout=30): Uploads the file to https://wpa-sec.stanev.org, or another endpoint. """ with open(path, 'rb') as file_to_upload: - cookie = {'key': self.options['api_key']} - payload = {'file': file_to_upload} + cookie = {"key": self.options['api_key']} + payload = {"file": file_to_upload, + "multipart/form-data": {"Expires": "0"}} + headers = {"HTTP_USER_AGENT": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"} try: result = requests.post(self.options['api_url'], cookies=cookie, files=payload, + headers=headers, timeout=timeout) if result.status_code == 200: if ' already submitted' in result.text: @@ -97,7 +100,7 @@ def on_webhook(self, path, request): def on_internet_available(self, agent): """ - Called in manual mode when there's internet connectivity + Called when there's internet connectivity """ if not self.ready or self.lock.locked(): return