How to sanitize a PCAP before sending it to a vendor

Support teams often ask for "a capture of the problem". The packets that show the problem also carry internal addresses, hostnames, and sometimes passwords and personal data. Sanitizing means giving the recipient what they need to diagnose the fault, and nothing more.

By Stuart Mathieson8 minute readeditcap + tshark + tcprewriteUpdated 12 October 2026
The quick way

PCAPNG Analyzer Pro does steps 3 to 5 in one download. Choose Shareable copy, tick what to strip and what to leave out, and you get a classic pcap with payloads cut at each packet’s real header length, addresses replaced consistently and no pcapng metadata. Then run the checks in step 6 before it leaves.

Try it free on your own computer →
In this guide
  1. Know what a capture gives away
  2. Reduce it first
  3. Strip payloads
  4. Replace addresses
  5. Drop the file metadata
  6. Check the result
  7. Manual vs automated workflow

1. Know what a capture gives away

Before choosing tools, list what the file can reveal:

Then ask the recipient what they actually need. Most network faults (resets, retransmissions, slow handshakes, MTU problems) can be diagnosed from headers, sizes and timing alone. Application faults may genuinely need payloads, and then the honest answer may be a screen-share or an on-site session rather than a file.

2. Reduce it first

The safest data is data that isn't in the file. Cut the capture down to the conversation and time window that show the problem. In Wireshark, apply a display filter, then choose File → Export Specified Packets with All packets: Displayed. With tshark:

tshark -r incident.pcapng \
  -Y "ip.addr == 10.20.30.40 && tcp.port == 443" \
  -w reduced.pcapng

Keep both directions of the affected conversation, and its DNS lookup if name resolution is part of the problem. Keep the untouched original yourself: you may need to answer follow-up questions from it.

3. Strip payloads

editcap, shipped with Wireshark, can truncate every packet to a fixed number of bytes:

editcap -s 96 reduced.pcapng truncated.pcapng

Each packet's original length is still recorded, so Wireshark shows the true sizes and the TCP analysis keeps working. But a fixed length is a blunt cut:

Pick the length for the traffic in front of you (54 bytes covers Ethernet, IPv4 and a TCP header without options), and drop protocols the recipient doesn't need entirely, such as DNS or DHCP, with a display filter at the reduce step.

4. Replace addresses

Replacing addresses has to be consistent: the same original address must always become the same new one, or the conversations fall apart. tcprewrite, from the tcpreplay suite on Linux and macOS, can do this for IP addresses with a seed:

editcap -F pcap truncated.pcapng truncated.pcap
tcprewrite --seed=48213 --fixcsum \
  --infile=truncated.pcap --outfile=shareable.pcap

The mapping is deterministic, so anyone with the seed and tcprewrite can reproduce it: treat the seed like a key. tcprewrite can set MAC addresses to fixed values, but that collapses every host to one MAC, so check whether the recipient needs to tell hosts apart at layer 2. Things that are easy to miss:

On Windows, TraceWrangler is a long-standing graphical option that reads pcapng and can replace addresses and remove payloads in one pass.

5. Drop the file metadata

Check what the file says about where it came from:

capinfos shareable.pcap

A pcapng file can name the capture machine's hardware and operating system, the interface, and carry comments. Converting to classic pcap with editcap -F pcap, as above, leaves all of that behind, since the older format has nowhere to keep it.

6. Check the result before it leaves

Open the final file and look for what you meant to remove:

# Any names left?
tshark -r shareable.pcap -Y "dns.qry.name || tls.handshake.extensions_server_name || http.host" \
  -T fields -e dns.qry.name -e tls.handshake.extensions_server_name -e http.host | sort -u

# Which addresses remain?
tshark -r shareable.pcap -q -z endpoints,ip

# Your own domain or hostnames, anywhere in the bytes
tshark -r shareable.pcap -Y 'frame contains "corp.example"'

Also check Statistics → Protocol Hierarchy for protocols you meant to drop. Then confirm the file still shows the problem: a sanitized capture that no longer reproduces the symptom wastes everyone's time.

Sanitizing reduces risk; it doesn't remove it.

Timing, sizes and the protocols in use survive any method that keeps the capture useful. Send the file over an agreed channel, tell the recipient how long they may keep it, and keep a note of what you sent.

Manual method vs PCAPNG Analyzer

Manual method

  1. Reduce the capture to the affected conversation.
  2. Truncate packets with editcap.
  3. Convert to pcap and remap addresses with tcprewrite.
  4. Check names, addresses and metadata with tshark and capinfos.
  5. Confirm the symptom is still visible.

With PCAPNG Analyzer

  1. Open the capture’s analysis and choose Shareable copy.
  2. Tick Strip payloads and Remap addresses; optionally keep subnet structure, include the address key, and leave out protocols.
  3. Download the copy, and run the checks in step 6 on it.
What the shareable copy does

Payloads are cut after each packet's last header (TCP, UDP or ICMP), so the cut follows the real header length instead of a fixed size; the true sizes, flags, sequence numbers and timing survive. MAC, IPv4 and IPv6 addresses are replaced consistently, ARP’s addresses included, IPv4 options that can carry addresses are blanked, and checksums are kept valid; broadcast and multicast addresses stay as they are. Keep subnet structure keeps hosts that shared a subnet together. The address key, if you ask for it, is a CSV in the download and is never stored. The output is classic pcap, so no pcapng metadata travels with it. Only Ethernet captures are accepted: a Linux "cooked" capture (tcpdump -i any) or raw-IP capture is refused, since its addresses can't be found reliably, and when remapping, any frame whose headers can't be parsed is left out rather than copied.

Share the evidence, not the network

Make a sanitized copy in two clicks, while the original capture and its analysis stay on infrastructure you control.

Compare Free and ProSelf-host it