performing-file-carving-with-foremost

Recover files from disk images and unallocated space using Foremost header-footer signature carving.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill performing-file-carving-with-foremost
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performing-file-carving-with-foremost
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/digital-forensics/performing-file-carving-with-foremost
Command: npx skills add https://github.com/xalgord/xalgorix --skill performing-file-carving-with-foremost

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Deleted or formatted files often remain recoverable in raw disk sectors even when file system metadata is gone, but extracting them requires precise signature-based carving and validation to avoid corrupt or false-positive evidence.

Core Features & Use Cases

  • Signature-Based Carving: Run Foremost or Scalpel against raw dd images or unallocated space extracted with blkls, using default or custom file signatures for formats like jpg, pdf, sqlite, pst, and evtx.
  • Validation and Cataloging: Verify carved files with the file command, hash them with SHA-256, filter against NSRL known-good sets, and build a CSV evidence catalog.
  • Evidence Examination: Extract EXIF metadata with ExifTool, keyword-search carved PDFs, and generate thumbnails for rapid review.
  • Use Case: During an investigation of a formatted USB drive, carve JPEG images from unallocated space, extract GPS coordinates from EXIF data, and produce a hashed, cataloged set of evidence files for the case report.

Quick Start

Use Foremost to carve jpg, pdf, and doc files from the disk image evidence.dd into an output directory, then validate and hash the recovered files.

Frequently Asked Questions about performing-file-carving-with-foremost

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover deleted files from a disk image with Foremost?

Run foremost with -t to specify file types, -i pointing to the raw dd image, and -o for the output directory. For deleted files specifically, first extract unallocated space with blkls from Sleuth Kit, then carve that smaller target for faster, cleaner results.

What is the difference between Foremost and Scalpel for file carving?

Scalpel is a high-performance rewrite of Foremost using the same header-footer signature approach, making it preferable for large images or time-critical carving. Both use similar configuration files where you uncomment or define file type signatures with headers, footers, and maximum sizes.

How do I carve file types not in the default foremost.conf?

Create a custom configuration file with lines defining extension, case sensitivity, max size, header bytes, and optional footer bytes, then pass it with foremost -c. The skill includes examples for docx, sqlite, pst, eml, and evtx signatures.

Why does file carving produce corrupt or invalid files?

Fragmentation is the main cause: header-footer carving assumes contiguous data, so files split across non-adjacent clusters recover truncated or stitched with unrelated sectors. Random data matching signatures also creates false positives, so always validate carved output with the file command and by actually opening files.

Can carved files be used as evidence without original filenames?

Carved files have no original names, paths, or filesystem timestamps, so you cannot assert when or where they existed from carving alone. Cross-correlate with $MFT metadata, hash against NSRL and known-bad sets, and reconcile with PhotoRec or bulk_extractor results to establish context.