scapy icon indicating copy to clipboard operation
scapy copied to clipboard

srp not receiving answers after upgrading from version 2.4 to 2.5

Open aaryan2k opened this issue 2 years ago • 2 comments

Brief description

I upgraded scapy version from 2.4 to 2.5.0.dev130 on Ubuntu. Now I get 0 answers

Scapy version

2.5.0.dev130

Python version

3.8.10

Operating system

Ubuntu 20.04.6 LTS (Focal Fossa

Additional environment information

Connect from one machine to another ipv6 enabled machine and interface

How to reproduce

#test 2 - version 6 positive test ans,unans=scapy.srp(scapy.Ether(dst=mac)/scapy.IPv6(dst=v6dst,version=6)/scapy.ICMPv6EchoRequest(id=1,seq=1),iface=interface,timeout=2)

received_reply = False for request, receive in ans: if receive.haslayer(scapy.ICMPv6EchoReply): received_reply = True break if received_reply: print("Response to IPv6 version # of 6 - PASS") output = ans.summary() else: print("No response to IPv6 version # of 6 - FAIL") time.sleep(2)

Actual result

With version 2.4 Got response Received 1 packets, got 1 answers, remaining 1 packets

With version 2.5 Received 1 packets, got 0 answers, remaining 1 packets

Expected result

Received 1 packets, got 1 answers, remaining 1 packets

Related resources

v6lc1.1.1.pcap.zip

aaryan2k avatar Jul 18 '23 15:07 aaryan2k

does running sr() instead srp() have the same result?

flashnuke avatar Aug 08 '23 13:08 flashnuke

Yes sr() has the same issue as srp()

Both versions 2.4 and 2.5 do not recognize an answer when an extension header like hop by hop header or destination header is sent as echo request. Adding some debugging statements found that the hash values do not match in https://github.com/secdev/scapy/blob/master/scapy/sendrecv.py#L276 therefore the result is returned as 0 answers

aaryan2k avatar Aug 10 '23 03:08 aaryan2k