scapy icon indicating copy to clipboard operation
scapy copied to clipboard

Timestamp Scapy Sniff() produces current timestamp

Open Mitsj0l opened this issue 3 years ago • 0 comments

Brief description

Hi all, it seems when using the sniff function, timestamps are returned of the current time, instead of the original timestamp of the packet. I see this packet from version 2.4.3-2.5.0rc0.

scapy_cap = rdpcap('input/1688.com_11.pcap') test = sniff(lfilter=lambda x: UDP in x, offline=scapy_cap) sniff(offline=scapy_cap) | <Sniffed: TCP:0 UDP:127 ICMP:0 Other:0> test[0].time | 1661866415.282953 scapy_cap[0].time | Decimal('1661350730.946522')

Scapy version

2.4.5

Python version

3.8

Operating system

Windows 11 and macOS

Additional environment information

No response

How to reproduce

scapy_cap = rdpcap('input/1688.com_11.pcap') test = sniff(lfilter=lambda x: UDP in x, offline=scapy_cap) 1688.com_11.pcap.zip

sniff(offline=scapy_cap) | <Sniffed: TCP:0 UDP:127 ICMP:0 Other:0> test[0].time | 1661866415.282953 scapy_cap[0].time | Decimal('1661350730.946522')

Actual result

test = sniff(lfilter=lambda x: UDP in x, offline=scapy_cap) sniff(offline=scapy_cap) | <Sniffed: TCP:0 UDP:127 ICMP:0 Other:0> test[0].time | 1661866415.282953

Expected result

scapy_cap[0].time | Decimal('1661350730.946522')

Related resources

No response

Mitsj0l avatar Aug 31 '22 06:08 Mitsj0l