So here's the layer i made:
And then I made some packets in scapy terminal like this:
Am I doing this right? If so, when I use sniff() in a terminal, I get raw load instead of the layer. I read the scapy docs but it's pretty confusing and not really clear. I imported the packets.py package as well. My goal is to get the packet in the format as described in the layer "CusPack". How do I do that? Do I need to copy "packets.py" to "/lib/python2.7/dist-packages/scapy/layers".
(Please note that I'm not asking for code or anything, but I just wanna know what I should do to view the data as my packet in the receiving terminal. I need this for a project, so all help is welcome. Thanks.)
Python:
# "packets.py"
class CusPack(Packet):
name = "CusPack1"
fields_desc=[XByteField("mode", 0), IntField("data", 108)]
And then I made some packets in scapy terminal like this:
Code:
>>>import packets
>>>x=IP(dst="192.168.0.10")/packets.CusPack()
>>>send(x, count=1000)
Am I doing this right? If so, when I use sniff() in a terminal, I get raw load instead of the layer. I read the scapy docs but it's pretty confusing and not really clear. I imported the packets.py package as well. My goal is to get the packet in the format as described in the layer "CusPack". How do I do that? Do I need to copy "packets.py" to "/lib/python2.7/dist-packages/scapy/layers".
(Please note that I'm not asking for code or anything, but I just wanna know what I should do to view the data as my packet in the receiving terminal. I need this for a project, so all help is welcome. Thanks.)
