Course contentsShow
← Security
Lesson 2402 of 3,05246. Incident ResponseFree lesson

File Carving and Deleted File Recovery

Recover deleted or partially overwritten files using header/footer signatures, file carving tools, and slack space analysis.

File Carving and Deleted File Recovery

What you'll learn: How to recover deleted or partially overwritten files by identifying file signatures and analyzing unallocated disk space.

The Challenge of Deleted Files

When a file is "deleted," the operating system typically doesn't erase the actual data immediately—it just marks that disk space as available for reuse and removes the file's directory entry. The original content remains intact in unallocated space until overwritten. File carving exploits this by searching raw disk sectors for recognizable patterns, even when file system metadata is gone.

Core Concepts

Header and Footer Signatures

Every file type has distinctive byte patterns called magic numbers or file signatures. For example:

  • JPEG files start with FF D8 FF
  • PDF files begin with %PDF-
  • PNG files have 89 50 4E 47

File carving tools scan unallocated space looking for these headers, then extract data until they find the matching footer signature or reach a logical file boundary.

Slack Space Analysis

Slack space is the unused portion between a file's actual end and the end of its allocated cluster. If a 900-byte file occupies a 4KB cluster, the remaining ~3KB might contain fragments of previously deleted files—a goldmine for forensic recovery.

The Recovery Process

  1. Identify unallocated clusters using file system analysis tools
  2. Scan for known file signatures using carving tools
  3. Extract complete or fragmented files based on headers/footers
  4. Validate recovered files for integrity and relevance
  5. Document recovery methods and chain of custody

Fragmented files (split across non-contiguous clusters) pose special challenges, requiring intelligent reconstruction algorithms.

Key Takeaway: File carving recovers deleted evidence by searching unallocated disk space for file signatures and reconstructing data from slack space, often revealing critical incident artifacts even after deletion attempts.