You can pull files out of Wireshark captures, but it’s not as simple as "save as."

Let’s see it in action. Imagine you’ve captured network traffic to a web server and you suspect a user downloaded a PDF. You’ve got the capture.pcap file.

First, open capture.pcap in Wireshark. Then, go to Statistics > Conversations. Click the TCP tab. You’re looking for a conversation where a significant amount of data was transferred, and you might see a pattern that looks like a file transfer.

Once you’ve identified a potential conversation, you need to go deeper. Right-click on a packet within that TCP conversation and select Follow > TCP Stream. This reconstructs the raw data exchanged between the two endpoints for that specific connection.

Now, in the "Follow TCP Stream" window, you’ll see a raw dump of the data. If a file was transferred, it will be embedded within this stream. Wireshark has a built-in feature for this: File > Export Objects > HTTP.

This Export Objects dialog lists all the files that Wireshark could identify as HTTP objects. You’ll see a list of Type, Name, and Size. Look for entries with Type as PDF, JPEG, ZIP, etc., and a Name that looks like a filename.

Select the file you want to recover and click Save As.... Choose a directory, and Wireshark will write the raw bytes of that object to the specified file.

The mental model here is that Wireshark doesn’t "understand" files in the way a file system does. It sees a stream of bytes. When you "Export Objects," Wireshark is essentially parsing the captured packets, looking for patterns that indicate the start and end of known object types (like HTTP responses containing file data), and then extracting those contiguous byte sequences. It’s not magic; it’s pattern recognition on raw network data.

The key levers you control are:

  • Capture Filters: To narrow down the traffic you’re collecting in the first place. If you’re looking for a specific file type, filter for the relevant protocols (HTTP, FTP) or even specific server IPs.
  • Display Filters: To isolate the specific conversation or packets containing the file once the capture is loaded. This is crucial for sifting through large PCAPs.
  • Follow TCP/UDP Stream: To reconstruct the exact data flow, which is the raw material for file extraction.
  • Export Objects: The tool that does the heavy lifting of identifying and extracting file-like data.

Many people assume Export Objects works on any file transfer protocol. It’s primarily designed for HTTP. If you’re trying to extract a file transferred via FTP, SMB, or another protocol, you’ll often need to manually reconstruct the stream and save it, then potentially use other tools to parse the raw binary data. The Export Objects dialog will only show you what it recognizes as a standard HTTP object.

Once you’ve successfully extracted a file, the next challenge is often dealing with fragmented or corrupted files that weren’t captured completely or cleanly.

Want structured learning?

Take the full Wireshark course →