CTF Arsenal
DFIR/Disk & Filesystem Forensics

Disk Image Triage with Autopsy & The Sleuth Kit

Concept

A disk image (raw/dd, E01, or similar) is a bit-for-bit copy of a storage device. Analysis must stay read-only against the original image; always work from a copy or mount read-only. The Sleuth Kit's command-line tools and Autopsy's GUI both parse partitions and filesystems without needing the native OS.

When to Use

  • Challenge provides a disk/partition image.
  • Need to recover deleted files or inspect filesystem metadata/timestamps.

Workflow

  1. 1
    Hash the image first

    Establish integrity baseline before any analysis.

  2. 2
    Identify partitions

    mmls to see the partition table layout.

  3. 3
    List files per partition, including deleted ones

    fls.

  4. 4
    Recover deleted content

    icat by inode, or Autopsy's recovery view.

  5. 5
    Review filesystem metadata/timestamps for a timeline

    MAC times via istat/fls -l.

Commands

sha256sum FILE_PATH
sha256sum disk.dd

Hashes the image to record its integrity before analysis — standard evidence-handling practice.

When to use: Always first, before mounting or running any tool against the image.

Expected output:

a1b2c3...  disk.dd

Look for: Record the hash in your notes; re-hash at the end to confirm nothing changed.

Next step: Proceed to partition identification.

mmls FILE_PATH
mmls disk.dd

Displays the partition table layout (offsets, sizes, types) of the image.

When to use: Before trying to read any filesystem — you need the partition's starting sector/offset.

Expected output:

000:  Meta       0000000000   0000000000   0000000001   Primary Table
002:  00:00      0000002048   0020971519   0020969472   NTFS

Look for: The start sector of the partition(s) you need to analyze.

Next step: Pass the offset (start sector × sector size, often 512) to fls/icat via -o.

fls -o OFFSET -r FILE_PATH
fls -o 2048 -r disk.dd

Lists files and directories within the specified partition, including deleted entries still present in the filesystem's metadata.

  • -o OFFSET — Sector offset of the partition (from mmls).
  • -r — Recurse into subdirectories.

When to use: Standard way to enumerate a filesystem's contents, including deleted files, from the command line.

Expected output:

r/r 1234-128-3:  secret.docx
r/r * 1235-128-3:  deleted_notes.txt

Look for: Entries marked with * (deleted but metadata/content may still be recoverable).

Next step: Note the inode number of any interesting deleted file, then use icat to recover its content.

icat -o OFFSET FILE_PATH INODE_NUMBER > OUTPUT_PATH
icat -o 2048 disk.dd 1235 > recovered_notes.txt

Extracts the content of a file by inode number, working even for deleted files whose data blocks haven't been overwritten.

  • -o OFFSET — Same partition offset as used with fls.

When to use: Once fls identifies a deleted file's inode you want to recover.

Expected output:

Recovered file content written to OUTPUT_PATH.

Look for: Whether the recovered content is intact (data blocks weren't reused) or partially overwritten.

Next step: Run 'file' on the recovered output, then continue with the file-forensics workflow if it's not already plain text.

istat -o OFFSET FILE_PATH INODE_NUMBER
istat -o 2048 disk.dd 1235

Shows detailed metadata (MAC times, size, allocation status) for a specific inode.

When to use: Building a timeline, or confirming when a deleted file was created/modified/accessed before deletion.

Expected output:

Modified:  2024-03-11 14:02:10
Accessed:  2024-03-11 14:05:33
Changed:   2024-03-11 14:05:40

Look for: Timestamps that correlate with other evidence (e.g. a log entry, or the incident window).

Next step: Add the timestamp to your overall incident timeline.

Tools

The Sleuth Kit (mmls, fls, icat, istat)

Command-line filesystem/partition analysis suite, scriptable and precise.

When to use: Default for CTF disk-image challenges, especially when scripting extraction.

sudo apt install sleuthkit
mmls FILE_PATH; fls -o OFFSET -r FILE_PATH; icat -o OFFSET FILE_PATH INODE

Example workflow: mmls for offset -> fls to enumerate (including deleted) -> icat to recover -> istat for timestamps.

Autopsy

GUI front-end to The Sleuth Kit: visual browsing, deleted-file recovery, keyword search, timeline view.

When to use: When a visual, case-managed workflow is preferable to raw CLI, or for a quick comprehensive overview.

sudo apt install autopsy
Create a new case, add the image as a data source, browse the resulting tree.

Example workflow: New case -> add image -> File/Directory view -> flag recovered/interesting files as evidence.

FTK Imager

Imaging and preview tool (Windows-native, but commonly referenced) for acquiring and verifying disk images.

When to use: When the challenge workflow is about verifying image acquisition integrity rather than deep filesystem parsing.

Open the image, verify its hash, browse the file tree in read-only preview mode.

Example workflow: Verify image hash matches the provided value before trusting analysis results.

Findings & Interpretation

Interesting

  • Deleted files recoverable intact via icat
  • File timestamps that don't match a stated alibi/narrative in the challenge

Suspicious

  • Mass-deleted files around a specific timestamp (anti-forensics/cover-up pattern)

False Positives

  • Not every deleted entry is recoverable — overwritten data blocks return garbage; confirm with 'file' after extraction

How to Validate

  • Confirm recovered file content with 'file' and manual inspection before treating it as a complete, trustworthy artifact

Next Step

  • Any recovered document/image/executable restarts the relevant forensics workflow (file, malware) on that artifact.

Troubleshooting

fls/icat report an invalid offset or fail to parse the filesystem.

Likely cause: Wrong sector offset calculation, or sector size isn't the assumed 512 bytes.

Verify: Re-check mmls output's 'Units' line — it states the actual sector size used for offset math.

Fix: Multiply the partition's start sector by the correct sector size if passing a byte offset elsewhere, or just pass the raw sector offset to -o as these tools expect.

Recovery: Re-run mmls and recompute the offset carefully.

Avoid repeating: Always read mmls's sector-size line rather than assuming 512 bytes.