How to capture a PCAP on Linux and Windows
Safely capture PCAP or PCAPNG traffic with tcpdump on Linux and Pktmon on Windows, using filters and size limits without exposing unnecessary secrets.
Updated 7/30/20264 min read
Safely capture PCAP or PCAPNG traffic with tcpdump on Linux and Pktmon on Windows, using filters and size limits without exposing unnecessary secrets.
Updated 7/30/20264 min read
Identify the interface and filter by host and port. `-s 0` retains complete packets and `-w` writes to a file.
sudo tcpdump -i eth0 -s 0 -C 100 -W 1 -w incident.pcap 'host 203.0.113.10 and port 443'Related guide: How to run MTR and interpret loss and latency
Pktmon is included with modern Windows and records ETL that can be converted to PCAPNG for Wireshark. Run the console as administrator.
pktmon filter remove
pktmon filter add -p 443
pktmon start --capture --comp nics --pkt-size 0
# Reproduce the issue, then:
pktmon stop
pktmon etl2pcap PktMon.etl --out incident.pcapngRecord time, timezone, IPs, application and exact action. Stop immediately after reproduction, verify that the file opens and use an approved sharing channel.
Both store packets. PCAPNG supports richer metadata and multiple interfaces; Wireshark opens both.
Only when needed and through an approved channel. Filter first and assume payloads may contain credentials or third-party data.
