

# this list will store all domain names in the dns packets

Step-3: Creating a function for extracting DNS resource recordsĬreate a function that extracts Domain Names from DNS packets. def filter_packets(file_path, disp_filter):Ĭapture = pyshark.FileCapture(file_path, display_filter=disp_filter)

Since Pyshark is just a wrapper of Thsark, you can even use the same filter in Wireshark as well or you can use your saved display filter from Wireshark. Step-2: Creating a display filter for interesting trafficĬreate a function that takes a file and display filter.
