From 5d668ae34ef0ee94af5f85118bd9eae936ed32d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?fr=C3=A9d=C3=A9ric?= Date: Wed, 12 Feb 2025 13:04:37 +0100 Subject: [PATCH] update wigle.py --- pwnagotchi/plugins/default/wigle.py | 32 +---------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/pwnagotchi/plugins/default/wigle.py b/pwnagotchi/plugins/default/wigle.py index 2d9cb7a7..ec120a67 100644 --- a/pwnagotchi/plugins/default/wigle.py +++ b/pwnagotchi/plugins/default/wigle.py @@ -57,12 +57,11 @@ class WigleStatistics: def update_group(self, json_res): rank = 1 for group in json_res["groups"]: - if group['groupId'] == self.groupID: + if group["groupId"] == self.groupID: self.grouprank = rank rank += 1 - class Wigle(plugins.Plugin): __author__ = "Dadav and updated by Jayofelony and fmatray" __version__ = "4.0.0" @@ -89,9 +88,6 @@ class Wigle(plugins.Plugin): self.handshake_dir = config["bettercap"].get("handshakes") report_filename = os.path.join(self.handshake_dir, ".wigle_uploads") self.report = StatusFile(report_filename, data_format="json") - self.cache_dir = os.path.join(self.handshake_dir, "cache") - if not (os.path.exists(self.cache_dir)): - os.mkdir(self.cache_dir) self.cvs_dir = self.options.get("cvs_dir", None) self.whitelist = config["main"].get("whitelist", []) self.timeout = self.options.get("timeout", 30) @@ -117,17 +113,6 @@ class Wigle(plugins.Plugin): return None return pcap_filename - def get_cache(self, pcap_file): - cache_filename = os.path.basename(pcap_file.replace(".pcap", ".cache")) - cache_filename = os.path.join(self.cache_dir, cache_filename) - if not os.path.exists(cache_filename): - return None - try: - with open(cache_filename, "r") as f: - return json.load(f) - except Exception as e: - return None - @staticmethod def extract_gps_data(path): """ @@ -338,21 +323,6 @@ class Wigle(plugins.Plugin): else: self.get_statistics() - def cache_ap(self, ap): - mac = ap["mac"].replace(":", "") - hostname = re.sub(r"[^a-zA-Z0-9]", "", ap["hostname"]) - filename = os.path.join(self.cache_dir, f"{hostname}_{mac}.cache") - with open(filename, "w") as f: - json.dump(ap, f) - - def on_unfiltered_ap_list(self, agent, aps): - for ap in filter(lambda ap: ap["hostname"] not in ["", ""], aps): - self.cache_ap(ap) - - def on_handshake(self, agent, filename, access_point, client_station): - logging.info(f"[WIGLE] on_handshake") - self.cache_ap(access_point) - def on_ui_setup(self, ui): with ui._lock: ui.add_element(