Remove debug print statements from get_aps_on_channel for cleaner output

This commit is contained in:
Yaro Kasear 2025-04-15 09:18:56 -05:00
parent 5d000b2a10
commit 439018ba85

View file

@ -160,14 +160,12 @@ def get_aps_on_channel(capture, ap_channel):
for packet in capture: for packet in capture:
try: try:
if 'radiotap' not in packet or 'wlan' not in packet: if 'radiotap' not in packet or 'wlan' not in packet:
print(f"[!] Packet missing radiotap or wlan layer: {packet}")
continue continue
radio = packet.radiotap radio = packet.radiotap
wlan = packet.wlan wlan = packet.wlan
if not hasattr(radio, 'channel') or not hasattr(radio.channel, 'freq'): if not hasattr(radio, 'channel') or not hasattr(radio.channel, 'freq'):
print(f"[!] Packet missing channel frequency: {packet}")
continue continue
packet_freq = int(radio.channel.freq) packet_freq = int(radio.channel.freq)
@ -178,13 +176,11 @@ def get_aps_on_channel(capture, ap_channel):
# print(f"Packet Channel: {packet_channel}, Frequency: {packet_freq} MHz") # print(f"Packet Channel: {packet_channel}, Frequency: {packet_freq} MHz")
if packet_channel != ap_channel: if packet_channel != ap_channel:
print(f"[!] Packet not on specified channel {ap_channel}: {packet_channel}")
continue continue
# Check for beacon or probe response # Check for beacon or probe response
ts_hex = getattr(wlan, 'type_subtype', None) ts_hex = getattr(wlan, 'type_subtype', None)
if ts_hex is None: if ts_hex is None:
print(f"[!] Missing type_subtype in packet: {packet}")
continue continue
# For debugging purposes, display the type_subtype value with some sarcasm # For debugging purposes, display the type_subtype value with some sarcasm
@ -192,7 +188,6 @@ def get_aps_on_channel(capture, ap_channel):
ts = int(ts_hex, 16) ts = int(ts_hex, 16)
if ts not in (5, 8): # Probe Response or Beacon if ts not in (5, 8): # Probe Response or Beacon
print(f"[!] Not a probe response or beacon: {ts}")
continue continue
# Grab BSSID # Grab BSSID