using python and the dpkt module. print out tcp and udp packetsfrom a pcap file. pPlease show program printing packets with tcpand udp protocols.
Solution
Hi,
Here is the code to parse a pcap file and print the tcp and udppackets. I have added comments in the code for your reference.
If you have any questions, leave me a message, I shall revert toyou with more information.
Step 1:
Make sure you install dpkt package before you run thiscode
pip3 install dpkt
or
pip install dpkt
(if you have python 2.7.x)
Step 2:
You may want to download a sample PCAP file fromhttp://packetlife.net/captures/OCSP-Good.cap. Ensure the PCAP fileis stored in the
OR
OR