Fix display filter typo and add error handling for packet filtering in analyze_pcap function

This commit is contained in:
Yaro Kasear 2025-04-28 16:08:05 -05:00
parent 3675a5e97e
commit 24d9783bb9

View file

@ -30,7 +30,7 @@ def parse_args():
def analyze_pcap(pcapng_path, start_ts, end_ts, ap_bssid, ap_channel):
display_filter = (
"(wlan.fx.type_subtype == 8 || wlan.fx.type_subtype == 5 || wlan.fc.type == 2) && "
"(wlan.fc.type_subtype == 8 || wlan.fc.type_subtype == 5 || wlan.fc.type == 2) && "
"(wlan.bssid || wlan.sa || wlan.da)"
)
cap = pyshark.FileCapture(
@ -60,8 +60,12 @@ def analyze_pcap(pcapng_path, start_ts, end_ts, ap_bssid, ap_channel):
cisco_reported_clients = []
ssid_packet_counts = defaultdict(int)
try:
try:
filtered_packets = filter_by_time(cap, start_ts, end_ts)
except Exception as e:
print(f"[!] Error filtering packets: {e}")
filtered_packets = []
(
bssid_to_ssid,