From 460643b1eb331c2cd8814336d8da7b0ab2e2b939 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Thu, 1 May 2025 15:07:52 -0500 Subject: [PATCH] Enhance suspect AP reporting by adding reason for classification --- listener.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/listener.py b/listener.py index 5e1b50c..078f4ad 100755 --- a/listener.py +++ b/listener.py @@ -183,12 +183,16 @@ def print_suspect_aps(): keywords = ("setup", "direct-", "hp", "epson", "canon", "brother", "smart", "wifi-", "printer") for bssid, ssid in ssid_map.items(): - if any(kw in ssid.lower() for kw in keywords) or (bssid in deadpoint_candidates and not ap_clients.get(bssid)): - suspects.append((bssid, ssid)) + is_keyword_match = any(kw in ssid.lower() for kw in keywords) + is_deadpoint = bssid in deadpoint_candidates and not ap_clients.get(bssid) + + if is_keyword_match or is_deadpoint: + reason = "Non-Infrastructure" if is_keyword_match else "Deadpoint" + suspects.append((bssid, ssid, reason)) if suspects: - for bssid, ssid in suspects: - print(f" - {bssid} (SSID: {ssid})") + for bssid, ssid, reason in suspects: + print(f" - {bssid} (SSID: {ssid}) [{reason}]") else: print(" None found (yet).")