I am trying to replay a recorded packet traffic with edited Ips and Mac addresses. The appropriate packets were not reieved, so I checked what Scapy was creating by writing the produced packets to a file.Whenever I use this code:
from scapy.all import *
from scapy.utils import rdpcap
#This code reads packet data from the pcap file supplied, and then edits the packets.
pkts = rdpcap("Zeus.pcap")
for pkt in pkts:
pkt[Ether].src = "00:E0:4C:00:02:42"
pkt[Ether].dst = "00:E0:4C:01:08:99"
pkt[IP].src = "169.254.162.71"
pkt[IP].dst = "169.254.208.208"
pkt[IP].chksum = None
pkt[IP].payload.chksum = None
wrpcap('ModifiedZeus.pcap', pkt, append=True)
Which is a derivative of the answer provided here:
Sending packets from pcap with changed src/dst in scapy
I get these packets:
Excerpt from Zeus.pcap (The expected outcome is this packet file with changed source and destination addresses.)
The Issue To my understanding, the Scapy code should reply what is in the packet file, with the updated ip,mac and checksums. Why does the code only send BROWSER protocol packets? And why is the Source and Destination IP addresses wrong in the output?