How to create a Scapy packet from raw bytes How to create a Scapy packet from raw bytes python python

How to create a Scapy packet from raw bytes


There is no way for Scapy to guess the first layer of your packet, so you need to specify it.

You can do so by using the appropriate Packet subclass. For example, say your packet's first layer is Ethernet, use Ether(raw_packet) instead of Packet(raw_packet).