I am capturing a single package using scapy:
from scapy.all import *
while True:
data = sniff(iface="lo", count = 1)
Then I try to convert the resulting object into bytes:
print(raw(data))
And I’m getting an error:
TypeError: ‘Ether’ object cannot be interpreted as an integer
I need to capture a packet and store it in a variable as bytes.
I tried it this way:
from scapy.all import *
while True:
data = sniff(iface="lo", count = 1)
print(raw(data))
and this:
from scapy.all import *
while True:
data = sniff(iface="lo", count = 1, prn = lambda x: raw(x))
print(data)