Fix display filter typo and add error handling for packet filtering in analyze_pcap function
This commit is contained in:
parent
3675a5e97e
commit
24d9783bb9
1 changed files with 6 additions and 2 deletions
|
@ -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(
|
||||
|
@ -61,7 +61,11 @@ def analyze_pcap(pcapng_path, start_ts, end_ts, ap_bssid, ap_channel):
|
|||
ssid_packet_counts = defaultdict(int)
|
||||
|
||||
try:
|
||||
filtered_packets = filter_by_time(cap, start_ts, end_ts)
|
||||
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue