I've got a huge pcap file (100GB) and I'm interested in a small number of packets which I know are numbers 5,000,000 to 5,000,020.
How can I use tcpdump
to read a pcap file, filter out packets by packet number (or range), and then write them out to a new pcap file?
It is quite simple using editcap
that comes along with Wireshark (at least on CentOS and Debian). For the 5,000,000 to 5,000,020 packet numbers, you can do:
editcap -r <big_pcap_file> <new_pcap_file> 5000000-5000020