Forensic Labs¶
links: DF TOC - Labs & Tools - Index
Document the filesystem (separate for each partition)
- How many blocks are allocated?
-
Use the
fsstat
command from Sleuth Kit to display filesystem statistics, including the number of allocated blocks.fsstat /path/to/image
-
How many normal files and directories?
-
Use the
fls
command to list files and directories, then count them.fls -r /path/to/image | grep 'r/' | wc -l # Count regular files fls -r /path/to/image | grep 'd/' | wc -l # Count directories
-
How many deleted files and directories?
- Again, use
fls
with the-d
option to list deleted files and directories.fls -r -d /path/to/image | wc -l
Sectors and blocks
- Choose a random sector number inside a partition
-
Use a hex editor like
xxd
to view a sector.xxd -s $((sector_number * 512)) -l 512 /path/to/image
-
View the sector with a hex editor
-
You can use
xxd
as shown above to view the sector data in hexadecimal. -
In what filesystem block is the sector?
-
Use
blkcat
from Sleuth Kit to map a sector to a filesystem block.blkcat -o partition_offset -b block_size /path/to/image sector_number
-
Is the block allocated?
-
Use
blkls
to list allocated blocks.blkls /path/to/image
-
If yes, what is the file name?
- Use
fls
andicat
to find the file name associated with the inode.fls -r /path/to/image | grep inode_number
Document the files in one filesystem
- Choose a filename (from fls -r)
-
Use
fls
to list files recursively.fls -r /path/to/image
-
What is the inode or MFT number?
-
The
fls
output includes the inode number. -
How many blocks does it use?
-
Use
istat
to get inode information, including the number of blocks used.istat /path/to/image inode_number
-
What is the logical file size?
-
The
istat
command output includes the logical file size. -
Extract the file
-
Use
icat
to extract the file.icat /path/to/image inode_number > output_file
-
Extract the file slack
-
Use
blkls
andicat
together to extract slack space.blkls -s /path/to/image | icat /path/to/image inode_number > file_slack
-
What are the timestamps?
istat
provides detailed timestamp information (access, modification, creation times).
Deleted files
- Find a deleted file (from fls -r)
-
Use
fls -r -d
to list deleted files.fls -r -d /path/to/image
-
Is it already overwritten?
-
Use
istat
to check if the inode or data blocks have been reused. -
Recover the file (if possible)
- Use
icat
to recover the deleted file if it has not been overwritten.icat /path/to/image inode_number > recovered_file
links: DF TOC - Labs & Tools - Index