analyzing-mft-for-deleted-file-recovery

mukul975/Anthropic-Cybersecurity-Skills · updated May 25, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/analyzing-mft-for-deleted-file-recovery
0 commentsdiscussion
summary

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.

skill.md
name
analyzing-mft-for-deleted-file-recovery
description
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.
domain
cybersecurity
subdomain
digital-forensics
tags
- mft - ntfs - deleted-files - file-recovery - mftecmd - usn-journal - logfile - mft-slack-space - file-system-forensics - dfir
version
'1.0'
author
mahipal
license
Apache-2.0
nist_csf
- RS.AN-01 - RS.AN-03 - DE.AE-02 - RS.MA-01

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.

When to Use

  • When investigating security incidents that require analyzing mft for deleted file recovery
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

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

References

Example Output

$ MFTECmd.exe -f "C:\Evidence\$MFT" --csv /analysis/mft_output

MFTECmd v1.2.2 - MFT Parser
==============================
Input: C:\Evidence\$MFT (Size: 384 MB)
Total MFT Entries: 395,264

Parsing MFT entries... Done (12.4 seconds)

--- Deleted File Recovery Summary ---
Total Entries:          395,264
Active Files:           245,832
Deleted Files:          149,432
  Recoverable:          87,234 (resident data or clusters not reallocated)
  Partially Recoverable: 31,456 (some clusters overwritten)
  Unrecoverable:        30,742 (all clusters reallocated)

--- Recently Deleted Files (Incident Window: 2024-01-15 to 2024-01-18) ---
MFT Entry | Filename                          | Path                               | Size      | Deleted (UTC)         | Recoverable
----------|-----------------------------------|------------------------------------|-----------|-----------------------|------------
148923    | exfil_tool.exe                    | C:\ProgramData\Updates\            | 1,258,496 | 2024-01-17 02:45:12   | YES
148924    | exfil_tool.log                    | C:\ProgramData\Updates\            | 45,312    | 2024-01-17 02:45:14   | YES
149001    | passwords.txt                     | C:\Users\jsmith\Desktop\           | 2,048     | 2024-01-17 02:50:33   | YES
149150    | scan_results.csv                  | C:\Users\jsmith\AppData\Local\Temp | 892,416   | 2024-01-17 03:00:01   | PARTIAL
149200    | mimikatz.exe                      | C:\Windows\Temp\                   | 1,250,816 | 2024-01-18 01:15:22   | YES
149201    | sekurlsa.log                      | C:\Windows\Temp\                   | 32,768    | 2024-01-18 01:15:25   | YES
149302    | .bash_history                     | C:\Users\jsmith\                   | 4,096     | 2024-01-18 03:00:00   | NO
149400    | ClearEventLogs.ps1                | C:\Windows\Temp\                   | 1,536     | 2024-01-18 03:01:12   | YES

--- $STANDARD_INFORMATION vs $FILE_NAME Timestamp Analysis (Timestomping Detection) ---
MFT Entry | Filename            | $SI Created          | $FN Created          | Delta     | Verdict
----------|---------------------|----------------------|----------------------|-----------|----------
148923    | exfil_tool.exe      | 2023-06-15 10:00:00  | 2024-01-15 14:34:02  | -214 days | TIMESTOMPED
149200    | mimikatz.exe        | 2022-01-01 00:00:00  | 2024-01-16 02:30:15  | -745 days | TIMESTOMPED

Recovered files exported to: /analysis/mft_output/recovered/
Full CSV report: /analysis/mft_output/mft_analysis.csv (395,264 rows)
Timeline CSV: /analysis/mft_output/mft_timeline.csv
how to use analyzing-mft-for-deleted-file-recovery

How to use analyzing-mft-for-deleted-file-recovery on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add analyzing-mft-for-deleted-file-recovery
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/analyzing-mft-for-deleted-file-recovery

The skills CLI fetches analyzing-mft-for-deleted-file-recovery from GitHub repository mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/analyzing-mft-for-deleted-file-recovery

Reload or restart Cursor to activate analyzing-mft-for-deleted-file-recovery. Access the skill through slash commands (e.g., /analyzing-mft-for-deleted-file-recovery) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.730 reviews
  • Dhruvi Jain· Dec 16, 2024

    analyzing-mft-for-deleted-file-recovery has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Anaya Choi· Dec 4, 2024

    We added analyzing-mft-for-deleted-file-recovery from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Anaya Menon· Nov 23, 2024

    analyzing-mft-for-deleted-file-recovery fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Oshnikdeep· Nov 7, 2024

    analyzing-mft-for-deleted-file-recovery reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Ganesh Mohane· Oct 26, 2024

    We added analyzing-mft-for-deleted-file-recovery from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Meera Desai· Oct 14, 2024

    analyzing-mft-for-deleted-file-recovery has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Maya Sanchez· Sep 21, 2024

    Solid pick for teams standardizing on skills: analyzing-mft-for-deleted-file-recovery is focused, and the summary matches what you get after install.

  • Chinedu Ndlovu· Sep 1, 2024

    I recommend analyzing-mft-for-deleted-file-recovery for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Michael Rahman· Aug 20, 2024

    Keeps context tight: analyzing-mft-for-deleted-file-recovery is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Benjamin Sanchez· Aug 12, 2024

    analyzing-mft-for-deleted-file-recovery is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

showing 1-10 of 30

1 / 3