Skip to content Skip to sidebar Skip to footer

Get Specific Bytes In Payload From A Pcap File

I have a PCAP file which I am parsing using Scapy, I have managed to dump the payload to a hexdump by using the code bellow pkts = rdpcap('Sink.pcap') print hexdump(pkts[0][2].loa

Solution 1:

Do you mean

print pkts[0][2].load[3]

or maybe as hex and char

val = pkts[0][2].load[3]
print"%x %s" % (ord(val), val)

Of course you can use it with hexdump too

print hexdump( pkts[0][2].load[3] )

Post a Comment for "Get Specific Bytes In Payload From A Pcap File"