Is there a smart and fast way to get all IP addresses from a PCAP file? I need only (destination address, source address) tuples.
Currently I'm using Scapy's rdpcap
function like this:
from scapy.all import *
pcap = rdpcap('file.pcap')
ips = set([(p[IP].fields['src'], p[IP].fields['dst']) for p in pcap if p.haslayer(IP) == 1])
But it takes about two minutes on my machine to parse a 70MB PCAP file with 370 unique extracted entries...