CG
SkillsAnalyzing MFT for Deleted File Recovery
Start Free
Back to Skills Library
Digital Forensics🟡 Intermediate

Analyzing MFT for Deleted File Recovery

Analyze the NTFS Master File Table ($MFT) to recover metadata and content of deleted files by examining MFT record entries, $LogFile, $UsnJrnl, and MFT slack space using MFTECmd, analyzeMFT, and X-Ways Forensics.

4 min read6 code examples

Prerequisites

  • Forensic disk image (E01, raw/dd, VMDK, or VHDX format)
  • MFTECmd (Eric Zimmerman) or analyzeMFT (Python-based)
  • FTK Imager, Arsenal Image Mounter, or similar for image mounting
  • Timeline Explorer or Excel for CSV analysis
  • Python 3.8+ for custom analysis scripts
  • Understanding of NTFS file system internals

Analyzing MFT for Deleted File Recovery

Overview

The NTFS Master File Table ($MFT) is the central metadata repository for every file and directory on an NTFS volume. Each file is represented by at least one 1024-byte MFT record containing attributes such as $STANDARD_INFORMATION (timestamps, permissions), $FILE_NAME (name, parent directory, timestamps), and $DATA (file content or cluster run pointers). When a file is deleted, its MFT record is marked as inactive (InUse flag cleared) but the metadata remains until the entry is reallocated by a new file. This persistence makes MFT analysis a primary technique for recovering deleted file evidence, reconstructing file system timelines, and detecting anti-forensic activity such as timestomping.

Prerequisites

  • Forensic disk image (E01, raw/dd, VMDK, or VHDX format)
  • MFTECmd (Eric Zimmerman) or analyzeMFT (Python-based)
  • FTK Imager, Arsenal Image Mounter, or similar for image mounting
  • Timeline Explorer or Excel for CSV analysis
  • Python 3.8+ for custom analysis scripts
  • Understanding of NTFS file system internals

MFT Structure and Record Layout

MFT Record Header

Each MFT record begins with the signature "FILE" (0x46494C45) and contains:

OffsetSizeField
0x004 bytesSignature ("FILE")
0x042 bytesOffset to update sequence
0x062 bytesSize of update sequence
0x088 bytes$LogFile sequence number
0x102 bytesSequence number
0x122 bytesHard link count
0x142 bytesOffset to first attribute
0x162 bytesFlags (0x01 = InUse, 0x02 = Directory)
0x184 bytesUsed size of MFT record
0x1C4 bytesAllocated size of MFT record
0x208 bytesBase file record reference
0x282 bytesNext attribute ID

Key MFT Attributes

Type IDNameDescription
0x10$STANDARD_INFORMATIONTimestamps, flags, owner ID, security ID
0x30$FILE_NAMEFilename, parent MFT reference, timestamps
0x40$OBJECT_IDUnique GUID for the file
0x50$SECURITY_DESCRIPTORACL permissions
0x60$VOLUME_NAMEVolume label (volume metadata files only)
0x80$DATAFile content (resident if <700 bytes) or cluster run list
0x90$INDEX_ROOTB-tree index root for directories
0xA0$INDEX_ALLOCATIONB-tree index entries for large directories
0xB0$BITMAPAllocation bitmap for index or MFT

Deleted File Recovery Techniques

Technique 1: MFT Record Analysis with MFTECmd

# Extract $MFT from forensic image using KAPE or FTK Imager
# Parse the $MFT with MFTECmd
MFTECmd.exe -f "C:\Evidence\$MFT" --csv C:\Output --csvf mft_full.csv

# Filter for deleted files (InUse = FALSE) in Timeline Explorer
# Look for entries where InUse column is False

Identifying Deleted Files in CSV Output:

  • InUse = False indicates a deleted or reallocated record
  • ParentPath shows original file location before deletion
  • FileSize shows the original size (may still be recoverable)
  • Timestamps in $STANDARD_INFORMATION and $FILE_NAME attributes persist

Technique 2: USN Journal ($UsnJrnl:$J) Analysis

The USN Journal records all changes to files on an NTFS volume, including creation, deletion, rename, and data modification events.

# Parse USN Journal with MFTECmd
MFTECmd.exe -f "C:\Evidence\$J" --csv C:\Output --csvf usn_journal.csv

# Key USN reason codes for deletion evidence:
# USN_REASON_FILE_DELETE     = 0x00000200
# USN_REASON_CLOSE           = 0x80000000
# USN_REASON_RENAME_OLD_NAME = 0x00001000
# USN_REASON_RENAME_NEW_NAME = 0x00002000

Technique 3: $LogFile Transaction Analysis

The $LogFile stores NTFS transaction records that can reveal file operations even after the USN Journal has been cycled.

# Parse $LogFile with LogFileParser
LogFileParser.exe -l "C:\Evidence\$LogFile" -o C:\Output

# Look for REDO and UNDO operations indicating file deletion:
# - DeallocateFileRecordSegment
# - DeleteAttribute
# - UpdateResidentValue (clearing InUse flag)

Technique 4: MFT Slack Space Analysis

MFT slack space exists between the end of the used portion of an MFT record and the end of the allocated 1024 bytes. This area may contain remnants of previous file records.

import struct

def parse_mft_slack(mft_path: str, output_path: str):
    """Extract and analyze MFT slack space for deleted file remnants."""
    with open(mft_path, "rb") as f:
        record_size = 1024
        record_num = 0
        slack_findings = []

        while True:
            record = f.read(record_size)
            if len(record) < record_size:
                break

            # Verify FILE signature
            if record[:4] != b"FILE":
                record_num += 1
                continue

            # Get used size from offset 0x18
            used_size = struct.unpack("<I", record[0x18:0x1C])[0]

            if used_size < record_size:
                slack = record[used_size:]
                # Check if slack contains readable strings or attribute headers
                if any(c > 0x20 and c < 0x7F for c in slack[:50]):
                    slack_findings.append({
                        "record": record_num,
                        "used_size": used_size,
                        "slack_size": record_size - used_size,
                        "slack_preview": slack[:100].hex()
                    })

            record_num += 1

    return slack_findings

Correlation with Supporting Artifacts

Cross-Reference MFT with $Recycle.Bin

# Parse Recycle Bin with RBCmd
RBCmd.exe -d "C:\Evidence\$Recycle.Bin" --csv C:\Output --csvf recycle_bin.csv

# Correlate: $I files contain original path and deletion timestamp
# Match MFT entry numbers from $R files back to original MFT records

Cross-Reference MFT with Volume Shadow Copies

# List volume shadow copies
vssadmin list shadows

# Mount shadow copies and extract $MFT from each
# Compare MFT records across shadow copies to track file changes over time

Forensic Value

  • Deleted file metadata recovery: Original filename, path, size, and timestamps
  • Timeline reconstruction: File creation, modification, access, and deletion events
  • Timestomping detection: Comparing $SI vs $FN timestamps
  • Data carving guidance: MFT cluster runs point to file content on disk
  • Anti-forensic detection: Identifying wiped or manipulated MFT records

Verification Criteria

Confirm successful execution by validating:

  • [ ] All prerequisite tools and access requirements are satisfied
  • [ ] Each workflow step completed without errors
  • [ ] Output matches expected format and contains expected data
  • [ ] No security warnings or misconfigurations detected
  • [ ] Results are documented and evidence is preserved for audit

Compliance Framework Mapping

This skill supports compliance evidence collection across multiple frameworks:

  • SOC 2: CC7.3 (Incident Identification), CC7.4 (Incident Response)
  • ISO 27001: A.16.1 (Security Incident Management), A.12.4 (Logging)
  • NIST 800-53: AU-6 (Audit Review), IR-4 (Incident Handling), AU-9 (Audit Protection)
  • NIST CSF: RS.AN (Analysis), RS.RP (Response Planning)

Claw GRC Tip: When this skill is executed by a registered agent, compliance evidence is automatically captured and mapped to the relevant controls in your active frameworks.

Deploying This Skill with Claw GRC

Agent Execution

Register this skill with your Claw GRC agent for automated execution:

# Install via CLI
npx claw-grc skills add analyzing-mft-for-deleted-file-recovery

# Or load dynamically via MCP
grc.load_skill("analyzing-mft-for-deleted-file-recovery")

Audit Trail Integration

When executed through Claw GRC, every step of this skill generates tamper-evident audit records:

  • SHA-256 chain hashing ensures no step can be modified after execution
  • Evidence artifacts (configs, scan results, logs) are automatically attached to relevant controls
  • Trust score impact — successful execution increases your agent's trust score

Continuous Compliance

Schedule this skill for recurring execution to maintain continuous compliance posture. Claw GRC monitors for drift and alerts when re-execution is needed.

References

  • NTFS MFT Advanced Forensic Analysis: https://www.deaddisk.com/posts/ntfs-mft-advanced-forensic-analysis-guide/
  • MFT Slack Space Forensic Value: https://www.sygnia.co/blog/the-forensic-value-of-mft-slack-space/
  • MFTECmd Documentation: https://ericzimmerman.github.io/
  • SANS FOR500: Windows Forensic Analysis

Use with Claw GRC Agents

This skill is fully compatible with Claw GRC's autonomous agent system. Deploy it to any registered agent via MCP, and every execution will be logged in the tamper-evident audit trail.

// Load this skill in your agent
npx claw-grc skills add analyzing-mft-for-deleted-file-recovery
// Or via MCP
grc.load_skill("analyzing-mft-for-deleted-file-recovery")

Tags

mftntfsdeleted-filesfile-recoverymftecmdusn-journallogfilemft-slack-space

Related Skills

Digital Forensics

Analyzing Slack Space and File System Artifacts

8m·intermediate
Digital Forensics

Analyzing Disk Image with Autopsy

6m·intermediate
Digital Forensics

Performing Windows Artifact Analysis with Eric Zimmerman Tools

6m·intermediate
Digital Forensics

Recovering Deleted Files with Photorec

5m·intermediate
Digital Forensics

Acquiring Disk Image with dd and dcfldd

4m·intermediate
Digital Forensics

Analyzing Browser Forensics with Hindsight

3m·intermediate

Skill Details

Domain
Digital Forensics
Difficulty
intermediate
Read Time
4 min
Code Examples
6

On This Page

OverviewPrerequisitesMFT Structure and Record LayoutDeleted File Recovery TechniquesCorrelation with Supporting ArtifactsForensic ValueReferencesVerification CriteriaCompliance Framework MappingDeploying This Skill with Claw GRC

Deploy This Skill

Add this skill to your Claw GRC agent and start automating.

Get Started Free →