tools / fw / pcap

pcap host extractor

parse_pcap.py is a small, standard-library-only CLI that summarises host names seen in a packet capture. It is intended for local research on captures you are authorised to inspect.

What it extracts

The report contains only the extracted names and their occurrence counts. It does not print or write packet payloads, IP addresses, MAC addresses, or TCP connection lists.

Usage

python tools/pcap/parse_pcap.py capture.pcap
python tools/pcap/parse_pcap.py capture.pcapng --json
python tools/pcap/parse_pcap.py capture.pcap --json --out report.json

Both classic pcap (little/big endian, microsecond/nanosecond timestamps) and pcapng (section, interface, enhanced packet, simple packet blocks) are read. Supported link layers: Ethernet, RAW, NULL/AF_INET, Linux SLL/SLL2, and LINKTYPE_IPV4. Only IPv4 is parsed.

Limitations

Privacy

Packet captures routinely contain personal data: IP addresses, MAC addresses, host names, cookies, credentials, and full application payloads. Treat every capture as sensitive. This tool reduces the output to host names, but the result can still reveal browsing and device behaviour.