CTF Arsenal
DFIR / Command Mistakes & Recovery

Foremost/binwalk: carved file won't open (unsupported/corrupt signature)

1. Error or symptom

A file carved from a disk image or binary blob fails to open in its expected viewer.

2. Likely cause

Wrong carve offset/boundary, or the embedded data is itself compressed/encrypted and needs another decoding step first.

3. How to verify

file CARVED_FILE_PATH to check what it actually is; compare its size against the expected file type's typical structure.

4. Correct command

dd if=ORIGINAL_PATH of=OUTPUT_PATH bs=1 skip=OFFSET count=LENGTH

5. Recovery procedure

Recompute the offset from binwalk's scan output and re-carve manually with dd for precision.

6. How to avoid repeating it

Verify every carved file with 'file' immediately — don't assume automatic extraction always gets boundaries right.