If you have ever used Wireshark, tcpdump, or any network monitoring tool, you have probably created a PCAP file without thinking too hard about what it actually is. So let's fix that.
The short version
A PCAP file (Packet Capture) is a binary file that contains a recording of network traffic. Every packet that was seen on the network interface during the capture period gets written to the file in order, along with a timestamp for when it was observed.
That is really all it is. A list of packets with timestamps.
Why they matter
Network traffic is ephemeral. Once a packet is sent and received, it is gone. If something goes wrong (or something suspicious happens), you cannot go back and look at what happened on the wire unless you were recording.
PCAPs give you that recording. They are used for:
- Troubleshooting network problems ("why is this connection timing out?")
- Security analysis ("what did the malware communicate with?")
- Forensics ("what data was exfiltrated?")
- Learning ("what does a TLS handshake actually look like?")
- Compliance ("can we prove the data was encrypted in transit?")
The file format
There are two common formats you will encounter:
PCAP (.pcap) is the original format. It has a 24-byte global header followed by individual packet records, each with their own header containing the timestamp and length. Simple, widely supported, and has been around since the early 1990s.
PCAPNG (.pcapng) is the newer format. It supports multiple capture interfaces in a single file, better timestamp resolution, packet comments, and other metadata. Wireshark uses PCAPNG as its default save format.
Both formats work with the same tools. When people say "PCAP" they usually mean either format. PcapHub accepts both.
What is inside a PCAP?
Each packet in the file contains the raw bytes that were captured from the network. Depending on where the capture was taken, this usually starts at the Ethernet frame level. That means you get everything: MAC addresses, IP headers, TCP/UDP headers, and the application data (if it is not encrypted).
This is both powerful and sensitive. A PCAP from a busy network might contain passwords, emails, API keys, or other confidential data. Always be careful about what you capture and who you share it with.
PCAP files can contain sensitive data. Before sharing a capture publicly, review the contents and consider whether it contains information that should remain private. PcapHub scans for common PII patterns automatically, but this is not a guarantee.
Creating your first capture
The quickest way to create a PCAP is with tcpdump:
sudo tcpdump -i eth0 -w capture.pcap -c 100
This captures 100 packets from the eth0 interface and writes them to capture.pcap. You can then open this file in Wireshark, upload it to PcapHub, or analyse it with any tool that reads PCAP files.
If you prefer a GUI, Wireshark lets you start a capture with a single click and save it when you are done.
What does a PCAP file contain?
Next steps
Now that you know what a PCAP is, the next lesson covers how network layers work, which is essential for understanding what you are looking at when you open a capture file.