I put together a python script based on Scapy which allows for easy replay of Layer3 network traffic, more specifically, TCP traffic.

The script uses a pcap file as a 'script' and simulates one of the parties in the file, listening for live packets and responding with the 'answers' that match from the pcap file.

The script:

#!/usr/bin/env python

##
## replay by c1de0x 
## ----------------------------------
## v0.1
##
## Scapy extension to allow pcap-captured network traffic to be used as
## a 'script' or 'template' for responses to live requests.
##


import scapy
from util.matches import get_match
from socket import gethostname,gethostbyname
import sys
import getopt


   test_MatchSelf()
   test_MatchEtherNoPayload()
   test_MatchIPNoPayload()
   test_MatchIPMissingSrc()
   test_NoMatchIP()
   test_NoMatchTCP()
   test_NoMatchTCP2()
   test_NoMatchRaw()
   test_PartialMatchTCP()
   test_PartialMatchTCP2()