Go to file
2022-10-02 20:02:58 +03:00
.gitignore init 2022-10-02 20:02:58 +03:00
CMakeLists.txt init 2022-10-02 20:02:58 +03:00
main.c init 2022-10-02 20:02:58 +03:00
README.md init 2022-10-02 20:02:58 +03:00

Build IPv6 ICMP ECHO packet with Ethernet headers

Scapy code samples

Writen in scapy shell

# import hex as packet
e = Ether(bytes.fromhex('fc de ad be ef 05 fc de ad be ef 56 86 dd 60 00 00 00 00 08 3a 02 fe 80 00 00 00 00 00 00 00 00 00 00 00 00 00 01 fe 80 00 00 00 00 00 00 50 5d 18 fb 5e 52 ec c0 81 00 4e cd 00 00 00 00 ef be ad de'))
e.show()

# Write packet as pcap to open in Wireshark
wrpcap("test.pcap", e)

# Calculate icmpv6 checksum
i = e[IPv6][ICMPv6EchoReply]
i.cksum = 0
r = raw(i)
print(hex(in6_chksum(socket.IPPROTO_ICMPV6, e[IPv6], r)))