Add display filter to pyshark FileCapture in analyze_pcap function
This commit is contained in:
parent
150f8fc448
commit
3675a5e97e
1 changed files with 6 additions and 1 deletions
|
@ -29,11 +29,16 @@ def parse_args():
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def analyze_pcap(pcapng_path, start_ts, end_ts, ap_bssid, ap_channel):
|
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.bssid || wlan.sa || wlan.da)"
|
||||||
|
)
|
||||||
cap = pyshark.FileCapture(
|
cap = pyshark.FileCapture(
|
||||||
pcapng_path,
|
pcapng_path,
|
||||||
use_json=True,
|
use_json=True,
|
||||||
include_raw=False,
|
include_raw=False,
|
||||||
keep_packets=False
|
keep_packets=False,
|
||||||
|
display_filter=display_filter
|
||||||
)
|
)
|
||||||
|
|
||||||
ap_channel = int(ap_channel)
|
ap_channel = int(ap_channel)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue