From 7cdb89b203f3fb95424e61639074ec51f5950f56 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Mon, 14 Apr 2025 10:16:10 -0500 Subject: [PATCH] Refactor get_clients_on_channel to remove redundant debug prints and improve clarity --- kismet_enrich_from_pcap.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/kismet_enrich_from_pcap.py b/kismet_enrich_from_pcap.py index 662b586..ca9fa03 100755 --- a/kismet_enrich_from_pcap.py +++ b/kismet_enrich_from_pcap.py @@ -110,11 +110,6 @@ def get_clients_on_channel(capture, ap_channel, ap_bssid): print(f"[!] Could not parse channel number: {ap_channel}") return 0 - # For debugging purposes, we can print the channel details - channel_details = get_freq_details(ap_channel) - if channel_details: - print(f"[+] Channel {ap_channel} details: {channel_details}") - clients = set() for packet in capture: @@ -122,27 +117,14 @@ def get_clients_on_channel(capture, ap_channel, ap_bssid): if 'radiotap' not in packet or 'wlan' not in packet: continue + print(f"[DEBUG] Packet has channel_freq: {hasattr(packet.radiotap, 'channel_freq')}, freq: {getattr(packet.radiotap, 'channel_freq', 'N/A')}") + radio = packet.radiotap wlan = packet.wlan packet_freq = int(getattr(radio, 'channel_freq', -1)) packet_channel = get_channel_from_freq(packet_freq) - # For debugging purposes, we can print the frequency and channel - if packet_channel: - print(f"[+] Packet Frequency: {packet_freq} MHz, Channel: {packet_channel}") - else: - print(f"[!] Packet Frequency: {packet_freq} MHz, Channel: Unknown") - if packet_channel == -1: - print(f"[!] Packet channel not found in lookup table.") - continue - if packet_channel == 0: - print(f"[!] Packet channel is zero, skipping.") - continue - if packet_channel == 255: - print(f"[!] Packet channel is 255, skipping.") - continue - if packet_channel != ap_channel: continue