Go to file
Arti Zirk 33f6d16c51 Update readme 2022-10-02 20:07:13 +03:00
.gitignore init 2022-10-02 20:02:58 +03:00
CMakeLists.txt init 2022-10-02 20:02:58 +03:00
README.md Update readme 2022-10-02 20:07:13 +03:00
main.c init 2022-10-02 20:02:58 +03:00

README.md

Build IPv6 ICMP ECHO packet with Ethernet headers

Simple C code that builds a valid (ish) ethernet icmpv6 echo packet.

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)))