Foremost

File Carving Tool

🔍 Foremost क्या है?

Foremost एक fast file carving tool है जो disk image या raw data से deleted files recover कर सकता है। यह file signatures के based पर files को ढूंढता है, चाहे file system corrupt हो या delete हुआ हो।

👉 Data recovery, digital forensics, और incident response में यह simple और effective tool है।

🎯 Foremost क्या-क्या कर सकता है

Image Recovery

JPG, PNG, GIF, BMP images

Video Recovery

AVI, MPG, MOV videos

Archive Recovery

ZIP, RAR, GZ archives

Document Recovery

PDF, DOC, DOCX files

Audio Recovery

WAV, MP3, OGG audio

Raw Data Scan

Disk image full scan

⚙️ Installation (Kali Linux / Termux)

aptInstallation Commands

System Update

apt update

Install Foremost

apt install foremost

Verify Installation

foremost -V

💻 Basic Commands (Use)

👉 Disk image या raw file पर file carving करो:

Basic File Recovery (All Types)

foremost -i image.dd -o output/

Recover Specific File Type (JPG only)

foremost -t jpg -i image.dd -o output/

Recover Multiple Types (JPG, PDF, ZIP)

foremost -t jpg,pdf,zip -i image.dd -o output/

Verbose Mode (Detailed Output)

foremost -v -i image.dd -o output/

Quick Scan (Without De-duplication)

foremost -Q -i image.dd -o output/

🌐 Real Example (Practical समझ)

Scenario🎯 Case Study: Recover Deleted Photos

👉 Scenario: Camera की SD card से accidentally सभी photos delete हो गई हैं। Recover करनी हैं।

1

Create Disk Image (First Step)

dd if=/dev/sdb of=sdcard.img bs=4k

SD card की raw image बनाओ (sdb से sdcard.img में)

2

Run Foremost on Image

foremost -i sdcard.img -o recovered_photos/

Image पर file carving चलाओ

3

Check Recovered Files

ls -lh recovered_photos/jpg/

Recover किए गए photos check करो

📊 Output समझो

Foremost output में दिखेगा:

[*] Processing: sdcard.img
[*] Image header 0xFFD8FF found at offset 1024
[*] Image header 0xFFD8FF found at offset 524288
[*] Image header 0xFFD8FF found at offset 1048576
[*] Scan complete
[*] 15 files recovered

🧠 इसका मतलब:

Header

JPG Signature Found

0xFFD8FF = JPG file signature detected

Offset

File Location in Disk

Offset tells where file starts in raw data

Recovered

15 Files Extracted

Successfully carved 15 deleted files

👉 Output directory structure:

recovered_photos/
├── audit.txt
└── jpg/
├── 00000000.jpg
├── 00000001.jpg
└── 00000002.jpg

🔥 Advanced Example (Specific File Types)

Recover Only Specific Formats (PDF + DOCX + ZIP)

foremost -t pdf,doc,zip -i disk_image.dd -o documents/

👉 Supported file types:

jpg
gif
png
bmp
pdf
doc
zip
exe

👉 Custom configuration:

/etc/foremost.conf
file में new file signatures add कर सकते हो

⚠️ Important Warning

File recovery में proper approach बहुत ज़रूरी है

⚠️ याद रखो:

  • पहले disk image बनाओ, directly scan मत करो
  • • Recovery पर write-protected mode use करो
  • • Recover करने के बाद files verify करो
  • • Authorized devices पर ही test करो

👉 Practice के लिए: Virtual machine में test files delete करो और recover करने की कोशिश करो

🧩 Related Tools

Autopsy

Digital forensics platform

Volatility

Memory forensics framework

Sleuth Kit

File system forensics

Scalpel

File carving alternative

💡 Simple समझ

Foremost = "Deleted Files ka Dukandaar"

जैसे dustbin से deleted items निकालते हैं, वैसे ही Foremost disk के raw data से deleted photos, videos, documents सब बाहर निकाल देता है। बस file का signature चाहिए!