From 9a13209620af69ade27b5dc1f74d778f0147dd09 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Tue, 15 Apr 2025 09:07:04 -0500 Subject: [PATCH] Add debug output to get_aps_on_channel for packet validation --- enrich.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/enrich.py b/enrich.py index c056516..940c2b0 100755 --- a/enrich.py +++ b/enrich.py @@ -167,16 +167,19 @@ def get_aps_on_channel(capture, ap_channel): for packet in capture: try: if 'radiotap' not in packet or 'wlan' not in packet: + print(f"[!] Packet missing radiotap or wlan layer: {packet}") continue # Match channel frequency freq = int(getattr(packet.radiotap, 'channel_freq', -1)) if freq != from_channel_freq: + print(f"[!] Frequency mismatch: {freq} != {from_channel_freq}") continue # Check for beacon or probe response ts_hex = getattr(packet.wlan, 'type_subtype', None) if ts_hex is None: + print(f"[!] Missing type_subtype in packet: {packet}") continue # For debugging purposes, display the type_subtype value with some sarcasm @@ -184,6 +187,7 @@ def get_aps_on_channel(capture, ap_channel): ts = int(ts_hex, 16) if ts not in (5, 8): # Probe Response or Beacon + print(f"[!] Not a probe response or beacon: {ts}") continue # Grab BSSID