Search code examples
pythonwiresharkpcappacket-snifferspcap-ng

Python | Merging multiple pcap/pcapng files using Pyshark


Using the Pyshark module, is there a way to efficientaly merge/join multiple pcap/pcapng files?

Tried playing around with pyshark.FileCapture and native file methodes in Python, but with no success.

Any ideas?

Thanks in advance!


Solution

  • Since no one answered, the right way to do it is to use the OS module and run "mergecap -w destfile.pcap [source_files.pcap]". You'll have to configure mergecap as into the Path veriable in Windows, or otherwise use the absolute destination, which is to the Wireshark folder.