Analyze the NTFS Master File Table ($MFT) with MFTECmd, analyzeMFT, and X-Ways Forensics to recover metadata and content of deleted files by examining MFT record entries, $LogFile, $UsnJrnl, and MFT slack space. Use when recovering evidence of deleted files, reconstructing NTFS file-system timelines, or detecting anti-forensic timestomping during a Windows forensic examination.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Analyze the NTFS Master File Table ($MFT) with MFTECmd, analyzeMFT, and X-Ways Forensics to recover metadata and content of deleted files by examining MFT record entries, $LogFile, $UsnJrnl, and MFT slack space. Use when recovering evidence of deleted files, reconstructing NTFS file-system timelines, or detecting anti-forensic timestomping during a Windows forensic examination.
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:
Offset
Size
Field
0x00
4 bytes
Signature ("FILE")
0x04
2 bytes
Offset to update sequence
0x06
2 bytes
Size of update sequence
0x08
8 bytes
$LogFile sequence number
0x10
2 bytes
Sequence number
0x12
2 bytes
Hard link count
0x14
2 bytes
Offset to first attribute
0x16
2 bytes
Flags (0x01 = InUse, 0x02 = Directory)
0x18
4 bytes
Used size of MFT record
0x1C
4 bytes
Allocated size of MFT record
0x20
8 bytes
Base file record reference
0x28
2 bytes
Next attribute ID
Key MFT Attributes
Type ID
Name
Description
0x10
$STANDARD_INFORMATION
Timestamps, flags, owner ID, security ID
0x30
$FILE_NAME
Filename, parent MFT reference, timestamps
0x40
$OBJECT_ID
Unique GUID for the file
0x50
$SECURITY_DESCRIPTOR
ACL permissions
0x60
$VOLUME_NAME
Volume label (volume metadata files only)
0x80
$DATA
File content (resident if <700 bytes) or cluster run list
0x90
$INDEX_ROOT
B-tree index root for directories
0xA0
$INDEX_ALLOCATION
B-tree index entries for large directories
0xB0
$BITMAP
Allocation 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.
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
defparse_mft_slack(mft_path: str, output_path: str):
"""Extract and analyze MFT slack space for deleted file remnants."""withopen(mft_path, "rb") as f:
record_size = 1024
record_num = 0
slack_findings = []
whileTrue:
record = f.read(record_size)
iflen(record) < record_size:
break# Verify FILE signatureif record[:4] != b"FILE":
record_num += 1continue# 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 headersifany(c > 0x20and c < 0x7Ffor 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 += 1return 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