Skip to content

Instantly share code, notes, and snippets.

@ii0
Forked from danielinux/pcap_replay.py
Created February 16, 2023 01:35
Show Gist options
  • Save ii0/ac4c63cc74ee54e6b4998f4e9b888063 to your computer and use it in GitHub Desktop.
Save ii0/ac4c63cc74ee54e6b4998f4e9b888063 to your computer and use it in GitHub Desktop.
replay a captured pcap stream
#!/usr/bin/python
from scapy.all import *
import time, sys
pkts = rdpcap(sys.argv[1])
clk = pkts[0].time
for p in pkts:
time.sleep(p.time - clk)
clk = p.time
sendp(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment