Howto Recover Deleted Files With foremost in Freebsd

By | March 19, 2009

foremost adalah aplikasi forensics yang bisa merecover file berdasarkan pada headers, footers, dan struktur data internal. Foremost juga dapat merecover file image.

Foremost hanya bisa merecover file dengan type sebagai berikut :

* jpg
* gif
* png
* bmp
* avi
* exe
* mpg
* wav
* riff
* wmv
* mov
* pdf
* ole
* doc
* zip
* rar
* htm
* cpp


Anda bisa juga menambahkan type file lain dengan menambahkan di foremost.conf .

Install foremost melalui port dengan cara sebagai berikut :

#cd /usr/ports/sysutils/foremost/
#make install clean

pada tutorial ini contoh saya akan menghapus file jpg file:

# ls -l
total 324
-rw-r–r–   1 admin   wheel       8583 Sep 23 15:38 gambar1.jpg
#rm gambar1.jpg

Perintah untuk merecover :

# mount
/dev/da0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/da0s1e on /usr (ufs, local, soft-updates)
/dev/da0s1d on /var (ufs, local, soft-updates)

#foremost -t jpeg -i /dev/da0s1e

Setelah proses selesai maka akan dihasilkan folder output.

# ll
total 36
drwxr-xr–  3 root root 4096 2009-03-12 17:53 output

# ls -l output/
total 8
-rw-r–r– 1 root root  714 2009-03-12 18:02 audit.txt
drwxr-xr– 2 root root 4096 2009-03-12 17:57 jpg
#

File audit.txt berisi ringkasan apa yang foremost telah lakukan :

# cat output/audit.txt
Foremost version 1.5.4 by Jesse Kornblum, Kris Kendall, and Nick Mikus
Audit File

Foremost started at Thu Mar 12 17:53:48 2009
Invocation: foremost -t jpeg -i /dev/da0s1e
Output directory: /root/output
Configuration file: /etc/foremost.conf
——————————————————————
File: /dev/da0s1e
Start: Thu Mar 12 17:53:48 2009
Length: 28 GB (30836542464 bytes)

Num      Name (bs=512)         Size      File Offset     Comment

0:      gambar1.jpg         320 KB      5712642048
1:      gambar2.jpg         324 KB      15133057024
Finish: Thu Mar 12 18:02:10 2009

2 FILES EXTRACTED

jpg:= 2
——————————————————————

Foremost finished at Thu Mar 12 18:02:10 2009
#

Folder jpg berisi file jpg yang sudah di recover :

# ls -l output/jpg/
total 660
-rw-r–r– 1 root root 328479 2009-03-12 17:55 gambar1.jpg
-rw-r–r– 1 root root 332575 2009-03-12 17:57 gambar2.jpg
#

Sebelum anda akan merecover file lain terlebih dahulu anda perlu menghapus folder output, atau gunakan options -T agar hasil recover sebelumnya di hapus terlebih dahulu :

#foremost -t pdf -T -i /dev/da0s1e

selamat mencoba 🙂