scapy packet manipulation and original pkt.time

前端 未结 1 1730
星月不相逢
星月不相逢 2021-01-24 20:01

I have python, scapy peace of code that store my data into database (IP src and dst, ports, ..) which i use for some statistics. On some packets i am doing some manipulation (ch

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-24 20:40

    After creating changed_pkt, you can simply set its time attribute as follows:

    changed_pkt.time = ts
    

    Note that even after changing the packet's timestamp and sending it, the updated timestamp won't be reflected in the received packet on the other end since the timestamp is set in the receiving machine as the packet is received, as described here.

    If you're interested in transmitting the packets to a remote machine, while keeping their timestamp, consider storing the manipulated packets in a pcap file and sending that file over to the other machine.

    0 讨论(0)
提交回复
热议问题