Question

I am trying to send an ICMPv6 Echo Request from within a python script. When I do this process out within the Scapy environment, it works perfectly. I can see the packet exchanges within Wireshark. However, when I have this code:

#Spacy commands
ip = IPv6()
ip.dst = "fe80::ba8d:12ff:fe42:98c8"
ip.show()
print'-----------------------------------------'
request = ICMPv6EchoRequest()
request.id=98
request.show()
print'-----------------------------------------\n'

send(request/ip) #send Echo Request w/ IPv6 Header

in my python script and then call the script, I get this:

WARNING: Mac address to reach destination not found. Using broadcast.
WARNING: No IPv6 underlayer to compute checksum. Leaving null.
.
Sent 1 packets.

But no packet is actually sent... does anyone have any idea what I'm doing wrong?

EDIT: I should have mentioned that the sending node is a Virtual Ubuntu Linux Machine and the attempted Receiver is a Macbook on a bridged network adapter.

Was it helpful?

Solution

In Scapy, when you use the / operator the operand on the left encapsulates or places the operand on the right as it's data, or underlayer. It's what will come next in the packet.

Your problem is your sending line -

send(request/ip)

You have them reversed. This produces a packet where the IP Layer is the data of the ICMPv6 layer. This is why you are getting the error WARNING: No IPv6 underlayer to compute checksum. Leaving null, because you aren't actually putting anything there since your layers are in the wrong order.

This is what you meant to do.

send(ip/request)

Changing that one send line and you should see the results you expect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top