Awin
Awin

Reputation: 91

Read pcap through scapy and fetching a specific value

wireshark_data

    pcapFile=rdpcap(pcap)
    for pkt in pcapFile:
        try:
            if pkt[IP].src=='198.18.32.1' and pkt[IP].dst=='198.18.50.97' and pkt[IP].len>=400:

                data= pkt[Raw].load

(Pdb) pkt[Raw]
<Raw  load='\x00\xab\x0b(\x00\x00\x01\xdf\xab(\x05\x04\x03\x05\x00\x00\x00S\x03\x0020181014T121200.0000000....

in wireshark bit followed for 00 ab 0b is 28 but what i get from scapy is a (.How to get the value 28 from scapy?

Upvotes: 0

Views: 190

Answers (1)

Ali Kargar
Ali Kargar

Reputation: 189

I had a similar problem I solved my problem with this :

print str(packet).encode("HEX")

Upvotes: 1

Related Questions