foremost
Foremost is a forensic program to recover lost files based on their headers, footers, and internal data structures. It works on image files or directly on drives using built-in file types or configuration files.
Description
Foremost is designed for recovering lost files in forensic investigations. It analyzes disk images generated by tools like dd, Safeback, or Encase, or operates directly on drives. By examining headers, footers, and internal data structures, it identifies and extracts files even when file system metadata is damaged or deleted.
Common use cases include data recovery after accidental deletion, analysis of disk images in incident response, and forensic examinations where files need to be carved from unallocated space. The tool supports built-in file types for reliable and fast recovery, with options to specify custom types via command line or configuration files.
It produces an audit file detailing the recovery process and outputs recovered files to a specified directory, making it suitable for both quick triage and thorough forensic workflows.
How It Works
Foremost scans input files or drives for file signatures using headers, footers, and internal data structures of various formats. Built-in types enable detection based on file format specifics for reliable recovery. It supports indirect block detection for UNIX file systems, quick mode on 512-byte boundaries, and options for no error detection to handle corrupted files. Configuration files allow custom header/footer definitions.
Installation
sudo apt install foremostFlags
Examples
foremost -t doc,jpg,pdf,xls -i image.ddforemost -hforemost -v -i image.ddforemost -t pdf -i disk.img -o recoveredforemost -q -i image.ddforemost -w -i image.ddforemost -a -t jpg -i image.dd