Skip to content

Instantly share code, notes, and snippets.

@xen0bit
Last active November 7, 2025 04:21
Show Gist options
  • Save xen0bit/9546646a57cce6fe844d9af2ff35dd10 to your computer and use it in GitHub Desktop.
Save xen0bit/9546646a57cce6fe844d9af2ff35dd10 to your computer and use it in GitHub Desktop.
PCAP merger
import glob
from scapy.all import rdpcap, wrpcap
all_packets = []
for file in sorted(glob.glob("*.pcap")):
try:
packets = rdpcap(file)
all_packets.extend(packets)
print(f"{file}: Completed.")
except Exception as e:
print(f"{file}: {e}")
wrpcap("merged.pcap", all_packets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment