Reading pcap files with scapy

With the rdpcap() function, we can read a pcap file and get a list of packages that can be handled directly from Python:

scapy> file=rdpcap('<path_file.pcap>')scapy> file.summary()scapy> file.sessions()scapy> file.show()

Get Mastering Python for Networking and Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.