Commands / Detection and audit

Detection and audit

fls / icat

Also the sleuth kit, tsk, mmls, deleted file recovery, disk image

The Sleuth Kit: list a disk image's files, deleted ones included, and read one back by its address, without mounting it.

The Sleuth Kit reads a file system straight from a disk image, so nothing is mounted and nothing on the evidence changes. mmls prints the partition table, and each partition's start sector is the -o the other tools take. fls lists the entries; -d shows only the deleted ones, marked *, each with its address (an inode, or a FAT directory entry number). icat prints the content at an address, so a deleted file comes back as long as its clusters were not reused. It reads FAT, NTFS, ext2/3/4 and more.

fls / icat command usage

mmls IMAGE
fls [-r] [-d] -o SECTOR IMAGE
icat -o SECTOR IMAGE ADDRESS

Options

-o SECTOR
where the partition starts, in sectors (from mmls)
-r
list every folder, not only the top one
-d
deleted entries only

fls / icat examples

mmls usb-stick.img
Prints the partition table: each partition's start sector, length and type.
fls -r -d -o 2048 usb-stick.img
Lists every deleted entry in the partition that starts at sector 2048.
icat -o 2048 usb-stick.img 648
Prints the content of entry 648, the deleted file.

Pitfalls

  • Without the right -o the tools look for a file system at sector 0, find the partition table instead and fail: run mmls first.
  • A deleted file whose clusters were reused comes back as someone else's bytes: check what icat printed (file, a hash) before you trust it.

Run it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab