When sniffing packets with scapy I can save them to a variable
sniffed = sniff(count=1)
Now I would like to see what\'s inside the packet by do
You are probably searching for scapy Hexdump(pkt) or hexraw(pkt) or repr(str(pkt))
for string encoded output. Note that sniff returns a list, not a single pkt.
If you want to access serialized packet bytes one by one just serialize the layers str(pkt)
to get a python (char/byte)-string.
for b in str(pkt):
print "char: %s ord/value: %d hex: %x"%(b,ord(b),ord(b))