I am doing a project that involves shimming a packet with a custom layer containing some specific fields. I managed to do this using the guide here:
http://www.secdev.org/projects/scapy/doc/build_dissect.html
The guide is great on how to build and send packets with custom layers, but not so much on how to receive them.
I have a packet with the form:
IP()/CustomLayer()/ICMP()
And I am sending this packet to another host that will receive the packet using python's netfilter queue and scapy libraries.
My question is, how do I receive an incoming packet with custom layers in it and still have access to the fields? Trying to parse the packet with
IP(packet)
seems to not be working.. Any help is greatly appreciated!