This post is a quick attempt to show how you can use scapy to craft an IPv6 packet.
verify that this works we will first configure a host running Windows
10 to use a site local address "fec0::4/64" and our Linux host to use
site local "fec0::2/64"
The image below shows our Windows 10 site local configuration
Image below shows our Linux host IPv6 site local configuration
that we have our two hosts configured let's go ahead and craft our packet to test connectivity.
Let's craft our own ICMPv6 echo request, so that we can received an echo reply packet from our target.
first build our IPv6 layer. However, before we move ahead, let's see
what fields we have available to us for the IPv6 header in scapy.
that we know our fields, let's build our IPv6 header out by specifying our source of "fec0::02", our destination "fec0::04" and a "nh" or
next header field of "58" which represents ICMPv6.
With our built out IPv6 header, let's now build our ICMPv6 echo request.
Let's first look at the fields which scapy provides for us to use to create our own ICMPv6 echo request.
Now that we know what we need to use, let's fill out our fields.
Now that we have filled our fields out, let's send our packet along its merry way. Wireshark will be running simultaneously on the target.
Above we see we sent one packet. Let's see if our target accepted and sent a reply.
It looks like we've successfully crafted and sent an ICMPv6 echo request packet
along its merry way. We also see that the host at "fec0::4" replied to our request with a reply.
See this post if you would like to craft an IPv6 TCP packet and this post if you would like to craft an IPv6 UDP packet.