I am getting the payload of tcp packet using scapy easily :
def handle_pkt(pkt):
try :
pay_load_tcp = pkt[IP].load
except :
pay_load_tcp = ""
for packet in PcapReader(filename):
if TCP in packet and packet[IP].dst == '192.168.1.1':
handle_pkt(packet)
How can I get the same payload(Just the text info on the packet) using dpkt library?