forsmost
forsmost is a Rust implementation of Foremost-style file carving. It scans an
input stream or disk image for configured file signatures, writes recovered
files into type-specific output directories, and records an audit.txt report.
The crate does not vendor or require the original Foremost source tree. Optional compatibility tests can compare against an external Foremost executable when one is provided by the developer.
Installation
Usage
Recover JPEG files from an input image:
Recover multiple built-in types:
Use a custom signature configuration file:
Read from standard input:
|
Common options:
-t <types> Built-in file selectors, comma-separated
-c <file> Configuration file, default is foremost.conf
-o <dir> Output directory, default is output
-i <file> Input file, default is stdin
-q Quick mode, check only block boundaries
-Q Quiet mode
-a Write a header dump when validation cannot determine a file end
-w Write only audit entries, not recovered files
-T Append a timestamp to the output directory name
Built-in selectors
The built-in selectors include common image, archive, office, executable, media, and registry formats:
avi, bmp, cpp, doc, docx, elf, exe, gif, gz, html, jpg, mov, mp4,
mpg, ole, pdf, png, ppt, pptx, rar, reg, rif, sxc, sxi, sxw, wav,
wmv, wpd, xls, xlsx, zip
Use all to enable the default Foremost-style selector set.
Features
Default features:
= ["gzip"]
Feature flags:
gzip Enables gzip stream validation and recovery through flate2.
Disable gzip support and the flate2 dependency:
Development
The ignored compare_foremost tests require FOREMOST_BIN or
FOREMOST_WSL_BIN to point at an original Foremost executable.
License
Licensed under either of:
- Apache License, Version 2.0
- MIT license
at your option.