Enhance suspect AP reporting by including multiple classification reasons

This commit is contained in:
Yaro Kasear 2025-05-01 15:29:21 -05:00
parent 460643b1eb
commit 2e3484ed83

View file

@ -179,20 +179,21 @@ def get_connected_bssid(interface):
def print_suspect_aps():
print("\n[?] Suspect SSIDs (possibly printers, IoT, weird stuff):")
suspects = []
keywords = ("setup", "direct-", "hp", "epson", "canon", "brother", "smart", "wifi-", "printer")
suspects = []
for bssid, ssid in ssid_map.items():
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))
flags = []
if any(kw in ssid.lower() for kw in keywords):
flags.append("Suspicious SSID")
if bssid in deadpoint_candidates and not ap_clients.get(bssid):
flags.append("Deadpoint")
if flags:
suspects.append((bssid, ssid, flags))
if suspects:
for bssid, ssid, reason in suspects:
print(f" - {bssid} (SSID: {ssid}) [{reason}]")
for bssid, ssid, flags in suspects:
print(f" - {bssid} (SSID: {ssid}) <-- {' + '.join(flags)}")
else:
print(" None found (yet).")