Перейти к основному содержимому
Disk & Deleted-File Forensics with Autopsy & Sleuth Kit
Урок 4 из 12

Disk & Deleted-File Forensics with Autopsy & Sleuth Kit

Inspect partition layouts and file systems on forensic disk images, recover deleted files safely with Sleuth Kit commands, and triage evidence at scale using Autopsy.

Средний 30 мин Форензика и IR
Этого урока пока нет на выбранном языке — показана версия на другом языке. Перевод готовится.

Цели обучения

  • Explain why deleting a file leaves its data blocks intact until overwritten
  • Identify partition offsets and file system structures using mmls and fsstat
  • Recover deleted files from a read-only disk image using fls and icat
  • Triage a forensic image with Autopsy ingest modules and binwalk carving

Рекомендуется заранее: Digital Forensics Principles & Chain of CustodyEvidence Acquisition: Disk & RAM Imaging with FTK Imager

#Why this matters

After you acquire a verified disk image with FTK Imager and log its hash, investigation begins. Suspects and intruders rarely leave staging scripts or archives sitting in plain sight; they delete files or wipe directories before responders arrive. Because file systems optimize for speed rather than immediate erasure, deletion usually unlinks metadata while leaving raw bytes intact until overwritten.

#How deletion works on a file system

File systems separate metadata (name, size, timestamps, and block pointers) from file content (bytes stored in clusters or blocks). On NTFS, metadata lives in the Master File Table (MFT); on ext4, it lives in directory entries and inodes. Normal deletion marks the metadata record unallocated and returns data clusters to the free-space bitmap, leaving the bytes on disk until new writes claim those blocks.

State of deleted file Metadata available? Data intact? Recovery approach
Recently deleted, no heavy writes Yes (unallocated) Yes Sleuth Kit (fls, icat) or Autopsy
Metadata reused, clusters untouched Partial or none Yes Signature carving (binwalk)
Clusters overwritten Maybe No (partial) Fragment review or shadow copies

#Inspecting disk images with Sleuth Kit

The Sleuth Kit (TSK) parses raw (dd/img) and Expert Witness (E01) images without mounting them through the host OS, preventing accidental writes or metadata updates.

  1. Hash VerifyConfirm SHA-256 of working copy
  2. mmlsFind partition start sector offset
  3. fsstatCheck file system type and cluster size
  4. flsList allocated and deleted entries
  5. icatExtract target inode to lab output

Run mmls on a full-disk image to find each partition's Start sector (such as 2048 on 512-byte sectors), then pass -o <start_sector> to all volume-level commands. Use fsstat to verify the file system type and cluster size, and fls (-r recursive, -d deleted only, -p full path) to list entries. Deleted entries appear with an asterisk (*) before the inode or MFT address, which you pass to icat to extract the raw file bytes safely.

Inspecting a lab disk image with Sleuth Kit
$ sha256sum evidence.img
3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c183fa546268bce6c49b8  evidence.img
$ mmls evidence.img
DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors

      Slot      Start        End          Length       Description
000:  Meta      0000000000   0000000000   0000000001   Primary Table (#0)
001:  -------   0000000000   0000002047   0000002048   Unallocated
002:  000:000   0000002048   0000206847   0000204800   Linux (0x83)
$ fls -r -d -p -o 2048 evidence.img
r/r * 19:	Users/analyst/staging/notes.txt
r/r * 23:	Users/analyst/staging/payload.zip
$ icat -o 2048 evidence.img 19 > recovered_notes.txt
$ cat recovered_notes.txt
staging host: lab.local (10.10.10.25)

#Triaging cases at scale with Autopsy

For full workstations with hundreds of thousands of files, Autopsy puts a graphical workflow on top of The Sleuth Kit. After creating a case and adding an image data source, enable key Ingest Modules:

  • Hash Lookup: suppresses known-good OS files (NSRL) and flags known malicious hashes.
  • File Type Identification: inspects magic bytes instead of trusting filename extensions.
  • Recent Activity: extracts browser history, bookmarks, and USB history.
  • Keyword Search: indexes text across allocated files and unallocated space.

The Views > Deleted Files node groups deleted entries so you can sort by size, MIME type, or path without running manual fls commands across every directory.

#Carving unallocated space with binwalk

When directory entries are overwritten, file carving scans raw unallocated space for known file headers and footers. binwalk locates embedded archives, images, or executables inside unallocated slices (-e extracts recognized streams):

Scanning an unallocated image slice with binwalk
$ binwalk -e unallocated_slice.bin

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
16384         0x4000          Zip archive data, at least v2.0 to extract, compressed size: 412, uncompressed size: 680, name: key.txt

Because carvers ignore file system allocation tables, fragmented files may extract cleanly only up to their first cluster boundary. Always test carved archives and check extracted headers.

#Common mistakes

  • Omitting the partition offset (-o): Running fls or fsstat at sector 0 of a full-disk image hits the partition table instead of the file system and fails.
  • Mounting images read-write: Host OS mounts can replay journals or write .Trash folders, breaking hash verification.
  • Ignoring fragmentation: Carved files recovered solely from raw bytes can be corrupted if clusters were non-contiguous.
  • Skipping hash filtering: Analyzing a workstation without NSRL filtering wastes hours reviewing standard OS binaries.

#Summary

  • Deletion normally unlinks metadata and frees clusters without immediately erasing underlying bytes.
  • Run Sleuth Kit in sequence: mmls (offsets), fsstat (geometry), fls (deleted listings), and icat (safe extraction).
  • Use Autopsy ingest modules and Views > Deleted Files to triage large images efficiently.
  • Use binwalk carving when metadata is gone, keeping fragmentation and read-only evidence integrity in mind.

Проверка знаний

Войдите, чтобы проходить тест, завершать уроки и сохранять прогресс. Войти в систему

Практика: проверьте свои знания