Join our Newsletter — 33% off our NHI Course
Home› Guides› D3-FC File Carving: Extracting Files From Network Traffic…
Guide SOC & Detection Engineering

D3-FC File Carving: Extracting Files From Network Traffic for Analysis

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 12 November 2026 9 min read
On this page

Files that cross the network without touching a mail gateway or a managed endpoint are invisible to file scanners, unless a sensor rebuilds them from the packets. MITRE D3FEND names this countermeasure File Carving (D3-FC) and defines it as "Identifying and extracting files from network application protocols through the use of network stream reassembly software." It sits under the Detect tactic as a child of Network Traffic Analysis (D3-NTA), and its one digital artefact is File Transfer Network Traffic. File carving does not decide whether a file is bad: it is the feed that hands files to hashing, rules and sandboxes. This card covers how carving works, what D3FEND relates it to, how two widely used open source sensors implement it, how to check it and where it breaks. It is for network detection engineers and SOC leads; packet capture basics are in the Network Monitoring and Packet Capture Guide.

Key takeaways

  • It is a feed, not a verdict. D3FEND says a carved file "is then processed with standard File Analysis Techniques", so value depends on what you do with each file next.
  • Reassembly is the hard part. D3FEND calls the process error prone: packets arrive out of order, fragmented, duplicated or retransmitted, and the software must rebuild a well formed file from that.
  • Encryption limits what you can carve. Files inside TLS are only reachable where traffic is decrypted or the sensor sees it in clear, so carving coverage follows your inspection points.
  • No direct ATT&CK mapping. D3FEND lists no hand-mapped technique for D3-FC; two inferred relations come through its artefact, T1071.002 File Transfer Protocols and T1570 Lateral Tool Transfer.
  • Depth limits silently truncate files. Sensors cap how much of each stream they reassemble, and Suricata's documentation warns that files reaching the limit may be truncated.

D3-FC at a glance

AttributeValue
D3FEND IDD3-FC (d3f:FileCarving)
TacticDetect
Parent techniqueNetwork Traffic Analysis (D3-NTA)
Digital artefactFile Transfer Network Traffic (D3FEND relation: analyzes)
Example protocols named by D3FENDHTTP, SMTP, FTP, HTTP/2, and TLS/HTTP/Dropbox
Files of interest named by D3FENDExecutable, archive and document file formats
D3FEND referenceFireEye patent US20130036472A1, Computer Worm Defense System and Method: network data copied by a tap, analysed by a heuristic module, and replayed to a virtual machine
Main limitationEncrypted traffic, imperfect packet capture and file type confusion

How it works

D3FEND describes three steps, and real sensors add a fourth.

  1. Stream reassembly: software rebuilds a directional byte stream from captured packets, either in real time or by writing packets to disk and processing them in bulk.
  2. Protocol parsing: an application protocol parser finds where file content begins and ends inside the stream: an HTTP response body, an SMTP MIME part, an SMB write.
  3. File identification: pattern matching decides whether the content is a file of interest by its type, which sensors detect from content rather than trusting the name.
  4. Hand-off: the file, or only its hash and metadata, goes to analysis: hash reputation, content rules, emulation or sandbox detonation.

The FireEye patent D3FEND cites shows the full pattern: a network tap copies traffic, a heuristic module flags suspicious data and the transmission is replayed into a virtual machine to see what it does. The downstream analysis techniques are covered in D3-DA Dynamic Analysis, D3-FH File Hashing and D3-FCR File Content Rules.

ATT&CK techniques D3FEND relates to D3-FC

Relationship type: inferred only. D3FEND has no direct ATT&CK mapping for D3-FC. Its site lists two relations it labels "inferred and experimental", derived because D3-FC analyses File Transfer Network Traffic and these techniques produce sub-types of it (D3FEND knowledge graph 1.6.0, checked November 2026; IDs checked against ATT&CK v20).

ATT&CK IDTechniqueD3FEND relation (inferred via artefact)What carving can surface
T1071.002File Transfer Protocolsproduces Outbound Internet File Transfer TrafficFiles moved over FTP, SMB or similar protocols used as a command and control channel
T1570Lateral Tool Transferproduces Intranet File Transfer TrafficTools copied between internal hosts, often over SMB, where an east-west sensor sees it

In NHI Mgmt Group's view, not D3FEND data, carving at the internet edge is also the main network-side control for files downloaded into the estate, which ATT&CK describes as T1105 Ingress Tool Transfer. Defensive detail is in MITRE ATT&CK T1570 Lateral Tool Transfer, MITRE ATT&CK T1071 Application Layer Protocol and T1105 Ingress Tool Transfer Defensive Guide.

Where it is implemented

Network detection and response products, network sandboxes and full packet capture platforms all carve files. Two open source sensors document the mechanics openly, so they are described here as examples, alphabetically.

AspectSuricataZeek
Protocols documented for file handlingHTTP, SMTP, FTP, NFS, SMB and HTTP2FTP, HTTP, IRC, Kerberos, MIME, RDP, SMTP and SSL/TLS/DTLS
How extraction is triggeredRules with the filestore keyword; matching by fileext, filemagic and checksum lists (filemd5, filesha1, filesha256)Script calls Files::add_analyzer with Files::ANALYZER_EXTRACT, usually from a file_new handler; policy/frameworks/files/extract-all-files.zeek is a starting point
Type identificationfilemagic matching on the detected typeZeek's own content signatures, reported in the file_sniff event
Metadata logEVE fileinfo records, with force-magic and force-hash optionsfiles.log with size, timing and MIME type for every file seen
StorageFile-store version 2: files named by SHA256 in subdirectories 00 to ff, deduplicatedFiles written under FileExtract::prefix, normally ./extract_files/
Depth settingfile-store.stream-depth (documented default 1 MB, 0 for unlimited) and HTTP body limitsExtraction analyzer options set in script

A full packet capture platform such as the one in the Arkime Full Packet Capture Guide lets you carve after the event from stored packets, which is the bulk processing mode D3FEND mentions. Product selection for commercial sensors is covered in the NDR Buyer's Guide.

Implementation steps

  1. Pick sensor positions. Place sensors where files cross in clear text or after decryption: behind the TLS inspection point at the internet edge, on mail relay segments, and east-west on server and file share segments where lateral transfer would pass.
  2. Decide what to carve. Start with executables, scripts, archives and Office and PDF documents, and with SMB to and from user segments. Carving every file type everywhere fills disks without adding detections.
  3. Set depth limits deliberately. Raise stream and body depth for the file types you care about, accept the CPU and memory cost, and record the limit so analysts know what a truncated file means.
  4. Log metadata for everything, store content selectively. Hash and log every file seen; store full content only for types of interest or files that match rules or hash lists. Treat stored files as hazardous and possibly sensitive data, with access control and a retention period.
  5. Wire the hand-off. Send hashes to reputation lookup and carved files to content rules, emulation or a sandbox, then send verdicts to the SIEM keyed to the connection so analysts can pivot to the hosts involved.
  6. Pilot and roll back. Enable carving on one sensor first, watch packet drop and CPU, and keep the previous configuration so you can revert if the sensor starts dropping traffic.

How to verify it works

  • Known-file test: from an approved test host, download a benign file of each type of interest (including the EICAR test file) over each monitored protocol and confirm the sensor logs the file, the hash matches the original and the downstream verdict arrives.
  • Truncation test: transfer a file larger than the configured depth and confirm how the sensor marks it, so analysts recognise partial files.
  • Health metrics: watch capture loss and reassembly errors; a sensor dropping packets carves broken files without saying so.
  • Coverage check: compare files seen by the sensor with files seen by the mail gateway or proxy for the same period to find blind segments.
MetricExample target (NHI Mgmt Group suggestion, not a standard)Why it matters
Test files carved with matching hash, per protocol100%Proves reassembly and parsing work end to end
Sensor capture lossNear zero at peakDropped packets mean corrupt or missing files
Carved files of interest sent to analysis100% of stored filesCarving without analysis detects nothing
Share of files truncated by depth limitsTracked per protocolShows whether limits hide large payloads
Segments with a sensor that can see clear textRising, gaps documentedCoverage of where files actually move

Limits, bypasses and failure patterns

  • Encrypted transport: HTTPS, SMB encryption and encrypted archives hide content. Carving coverage depends on decryption points; see M1020 SSL/TLS Inspection.
  • File type confusion: D3FEND notes file type identification is difficult and can be exploited by adversaries, for example by renaming, nesting or wrapping content.
  • Imperfect capture: out of order, fragmented and retransmitted packets, and capture loss on busy links, produce corrupt files that analysis rejects or misjudges.
  • Depth limits: payloads beyond the configured depth are truncated, and a truncated executable rarely detonates.
  • Sensitive data in storage: carved files include business documents and personal data, so an unmanaged carve directory becomes a data protection problem.
  • No downstream analysis: files stored and never analysed give evidence after an incident but no detection.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev 5SI-4 System MonitoringNetwork monitoring that carving extends to file content
NIST SP 800-53 Rev 5SI-3 Malicious Code ProtectionCarved files feed malicious code detection at the network level
NIST CSF 2.0DE.CM-01Networks and network services are monitored to find potentially adverse events
MITRE ATT&CK mitigationM1031 Network Intrusion PreventionInline sensors that act on carved file verdicts; see M1031 Network Intrusion Prevention
MITRE D3FENDD3-NTA, D3-FCParent and technique

Practitioner checklist

  • Place sensors where files are visible in clear text, including behind TLS inspection.
  • Carve executables, scripts, archives and documents first; log hashes for everything.
  • Set and record stream and body depth limits per protocol.
  • Send every stored file to hashing, rules or detonation, and verdicts to the SIEM.
  • Protect and expire the carved file store as sensitive data.
  • Monitor capture loss and reassembly errors on every sensor.
  • Run known-file tests per protocol on a schedule and compare hashes.

Standards and references

Related NHI Mgmt Group resources: Network Forensics Guide · NDR Guide · IDS and IPS Guide · MITRE D3FEND Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 12 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.