Skip to content

The Sleuth Kit

100 commands

Command-line tools for analysing disk images and file systems: list files, recover deleted ones and build timelines.

  • disk forensics
  • file systems
  • DFIR

Install The Sleuth Kit

sudo apt install sleuthkit

Basic Syntax & Help2

fls

Displays the basic usage syntax and available flags for the file listing tool.

mmls -h

Shows help documentation for the media management listing tool used for partition analysis.

Disk Image Identification3

img_stat image.dd

Displays details about the image format and size for a raw disk image.

Link
img_stat -i ewf image.E01

Identifies image details specifically for an Expert Witness Format (E01) file.

Link
img_cat image.E01

Outputs the raw content of an image file, useful for converting E01 to raw DD format.

Link

Partition Analysis8

mmls image.dd

Lists the partition table layout to identify starting sectors of volumes.

Link
mmls -t dos image.dd

Forces the interpretation of the partition table as a DOS MBR type.

Link
mmls -t gpt image.dd

Forces the interpretation of the partition table as a GPT type.

Link
mmls -B image.dd

Displays the partition table size values in bytes instead of sectors.

Link
mmstat image.dd

Displays statistics about the volume system and partition layout.

Link
mmcat -o 2048 image.dd

Extracts a specific partition starting at the given offset into a separate file.

Link
mmls -i raw image.dd

Specifies the image type as raw explicitly during partition analysis.

Link
mmls -i ewf image.E01

Specifies the image type as EWF explicitly during partition analysis.

Link

File System Detection3

fsstat -o 2048 image.dd

Displays general details of the file system located at the specified offset.

Link
fsstat -f ntfs -o 2048 image.dd

Forces the analysis of the file system as NTFS at the specified offset.

Link
fsstat -f fat32 -o 63 image.dd

Forces the analysis of the file system as FAT32 at the specified offset.

Link

File & Directory Analysis9

fls -o 2048 image.dd

Lists files and directories in the root directory of the file system.

Link
fls -r -o 2048 image.dd

Recursively lists all files and directories starting from the root.

Link
fls -d -o 2048 image.dd

Lists only deleted file entries from the file system.

Link
fls -u -o 2048 image.dd

Lists only undeleted (active) file entries.

Link
fls -p -o 2048 image.dd

Displays full paths for every file listed.

Link
fls -F -o 2048 image.dd

Lists only file entries, excluding directory entries.

Link
fls -D -o 2048 image.dd

Lists only directory entries, excluding file entries.

Link
ffind -o 2048 image.dd 12345

Finds the filename associated with a specific inode number.

Link
ffind -a -o 2048 image.dd 12345

Finds all occurrences of filenames pointing to a specific inode.

Link

Metadata & Inode Analysis4

istat -o 2048 image.dd 12345

Displays detailed metadata structures for a specific inode, including MAC times and block addresses.

Link
ils -o 2048 image.dd

Lists all inode entries in the file system.

Link
ils -e -o 2048 image.dd

Lists all inode entries including those in the simplified body file format.

Link
ifind -o 2048 -d 5000 image.dd

Finds the meta-data structure that has allocated a specific data unit (block).

Link

Content Extraction3

icat -o 2048 image.dd 12345

Extracts the content of a file based on its inode number.

Link
icat -r -o 2048 image.dd 12345

Attempts to recover the content of a deleted file by inode number.

Link
icat -s -o 2048 image.dd 12345

Displays the slack space (unused bytes at end of last block) for a specific inode.

Link

Block & Data Unit Analysis7

blkstat -o 2048 image.dd 5000

Displays the allocation status of a specific data block.

Link
blkcat -o 2048 image.dd 5000

Dumps the raw contents of a specific data block.

Link
blkcat -h -o 2048 image.dd 5000

Dumps the raw contents of a block in a human-readable hex dump format.

Link
blkls -o 2048 image.dd

Extracts all unallocated blocks to a single file for carving.

Link
blkls -s -o 2048 image.dd

Copies only the slack space of allocated files.

Link
blkcalc -o 2048 -u 5000 image.dd

Calculates the unallocated block address from a file system block address.

Link
blkcalc -o 2048 -d 1000 image.dd

Calculates the file system block address from an unallocated image block address.

Link

Timeline Generation7

fls -m / -r -o 2048 image.dd

Generates a body file required for timeline creation using recursion from root.

Link
tsk_gettimes -o 2048 image.dd

Collects MAC times from a file system image and outputs a body file (more robust than fls).

Link
mactime -b bodyfile.txt

Parses a body file to create a human-readable timeline of file activity.

Link
mactime -b bodyfile.txt -d

Parses a body file and outputs the timeline in comma-delimited (CSV) format.

Link
mactime -b bodyfile.txt -y

Outputs the timeline with timestamps in ISO 8601 format.

Link
mactime -b bodyfile.txt -z UTC

Specifies the timezone for the timeline output.

Link
mactime -b bodyfile.txt 2023-01-01

Filters the timeline to show only events occurring after a specific date.

Link

Journal Analysis4

jls -o 2048 image.dd

Lists the journal entries in a file system (e.g., Ext3/4 journal).

Link
jcat -o 2048 image.dd 100

Extracts the content of a specific journal block.

Link
jcat -f ext -o 2048 image.dd 100

Forces the interpretation of the journal as an Ext file system journal.

Link
jls -f ext -o 2048 image.dd

Lists journal entries forcing Ext file system context.

Link

Hash Analysis2

hfind -i nsrl hash.db 1234567890ABCDEF

Looks up a specific MD5/SHA1 hash in an NSRL formatted hash database.

Link
hfind -i md5sum hash.db 123456...

Looks up a hash in an md5sum formatted text file database.

Link

Automation & Workflow8

tsk_loaddb -d case.db image.dd

Parses the disk image and populates a SQLite database with the metadata.

Link
tsk_loaddb -i ewf -d case.db image.E01

Populates a SQLite database from an E01 image file.

Link
tsk_recover -o 2048 image.dd output_dir

Automatically recovers files from the image to a local directory.

Link
tsk_recover -a -o 2048 image.dd output_dir

Recovers only allocated files from the image to a directory.

Link
tsk_recover -o 2048 -i raw -d 12345 image.dd output_dir

Recovers files starting specifically from a given directory inode.

Link
tsk_comparedir -o 2048 image.dd local_dir

Compares the contents of a disk image directory with a local directory.

Link
tsk_comparedir -n 12345 -o 2048 image.dd local_dir

Compares a specific inode directory in the image with a local directory.

Link
tsk_imageinfo image.dd

Calculates and displays the SHA-1 and MD5 hashes of the entire image.

Link

Advanced Metadata3

istat -z UTC -o 2048 image.dd 12345

Displays inode stats with times converted to a specific timezone.

Link
ifind -p 12345 -o 2048 image.dd

Finds the unallocated inode that points to a specific data unit (orphan checking).

Link
ifind -n "file.txt" -o 2048 image.dd

Finds the inode number associated with a specific file name.

Link

Incident Response5

fls -r -o 2048 image.dd | grep ".exe"

Filters recursive file listing to identify all executable files for malware hunting.

Link
fls -r -d -o 2048 image.dd | grep "User"

Searches for deleted files specifically within User directories.

Link
icat -o 2048 image.dd 12345 | strings

Extracts file content and pipes to strings to find text indicators like URLs.

Link
blkls -o 2048 image.dd | strings -a

Extracts strings from all unallocated space to find evidence in deleted data.

Link
tsk_gettimes -o 2048 image.dd | grep "2023-10-15"

Extracts timeline data and filters immediately for a specific incident date.

Link

Blue Team Validation3

sorter -d case_logs -s -o 2048 image.dd

Sorts files in the image based on file type signatures and saves to a directory.

Link
sorter -h -o 2048 image.dd

Outputs the sorter results in HTML format for easier reporting.

Link
sorter -e -o 2048 image.dd

Performs an extension mismatch check during the sorting process.

Link

Advanced File Systems2

fsstat -f hfs -o 2048 image.dd

Analyzes HFS+ file system specific metadata.

Link
fsstat -f iso9660 -o 0 image.iso

Analyzes an ISO 9660 file system typically found on optical media.

Link

Complex Carving Prep2

blkls -A -o 2048 image.dd

Extracts all blocks (allocated and unallocated) primarily for verification purposes.

Link
blkls -l -o 2048 image.dd

Lists details about data units rather than dumping their contents.

Link

Forensic Scripting2

tsk_loaddb -k -d case.db image.dd

Creates the database but does not create tables for block data, saving space.

Link
mmstat -t dos image.dd

Displays stats specifically for a DOS partition table type.

Link

Reporting3

fls -l -r -o 2048 image.dd

Produces a long-format listing of files including permissions and size.

Link
mactime -b bodyfile.txt -ggroup

Uses a group definition file to map GIDs to group names in the timeline.

Link
mactime -b bodyfile.txt -ppasswd

Uses a password definition file to map UIDs to usernames in the timeline.

Link

Advanced Hashing1

hfind -q hash.db 12345...

Performs a 'quick' lookup in the hash database.

Link

Internal Debugging2

fsstat -v -o 2048 image.dd

Runs file system statistics in verbose mode for debugging parsing errors.

Link
mmls -v image.dd

Runs partition listing in verbose mode to diagnose table corruption.

Link

Volume System Analysis1

mmls -a image.dd

Lists all volumes including those that are unallocated in the partition table.

Link

File Name Analysis1

fls -o 2048 -f ntfs image.dd

Explicitly declares the file system type for listing files to avoid auto-detection errors.

Link

Inode Analysis1

istat -f ext4 -o 2048 image.dd 12345

Displays inode stats forcing Ext4 interpretation.

Link

Threat Hunting2

fls -o 2048 -r image.dd | grep -i "\.ps1quot;

Hunts for PowerShell scripts across the file system using recursive listing.

Link
fls -o 2048 -r image.dd | grep -i "temp"

Identifies files located in temporary directories often used for malware staging.

Link

Data Recovery1

tsk_recover -e -o 2048 image.dd output_dir

Recovers files and exports them, including unallocated (deleted) files if possible.

Link

Disk Geometry1

img_stat -v image.dd

Provides verbose image statistics including block size and count.

Link

Block Analysis1

blkcat -f ntfs -o 2048 image.dd 100

Dumps a block forcing NTFS interpretation.

Link

Timeline Analysis2

mactime -b bodyfile.txt -i day

Creates a timeline summary grouped by day.

Link
mactime -b bodyfile.txt -i hour

Creates a timeline summary grouped by hour for high-precision analysis.

Link

Data Unit Analysis1

blkcalc -f ntfs -o 2048 -u 1000 image.dd

Calculates unallocated address forcing NTFS context.

Link

Metadata Analysis2

ils -f ntfs -o 2048 image.dd

Lists inodes forcing NTFS interpretation.

Link
ils -m -o 2048 image.dd

Lists inodes in machine readable format.

Link

Signature Analysis1

sigfind -o 2048 -t 55AA image.dd

Searches for the boot signature (0x55AA) to find boot sectors manually.

Link

Cleanup1

rm bodyfile.txt timeline.csv

Removes temporary analysis files after the investigation is complete.

Link