The Coroner’s Toolkit–How The FBI Recovers Deleted Files Using Free Software

Free Privacy Scan

The FBI recovers deleted files to help with investigations and prosecution. Bad guys will never stop trying to cover their tracks by deleting files–so the good guys developed a suite of free tools that let anyone recover deleted files. The tools presented in this article were used in FBI investigations that processed 1,756 terrabytes of data as part of over 4,500 cases in 2009, the most recent year for which data is available.

Recovering Deleted Files Basics: What Happens When A File Gets Deleted

For whatever reason, you decide to delete the file foo.docx from your computer. You open Windows Explorer, go to the directory holding foo.docx, highlight the file, and press the delete key on your keyboard. Sometime later–maybe minutes later, maybe weeks later–you clear out your Trash folder. As far as Windows is concerned, this means you want to permanently delete foo.docx, so Windows gets to work:Recover Deleted Files The Same Way The FBI Does

  1. Windows checks to see if the file appears in multiple directories, a feature borrowed from Unix and Linux called hard links. If the file exists in multiple locations, Windows doesn’t delete the file–it just removes its entry from your Trash directory.
  2. Windows puts a note in its journal that foo.docx should be deleted. It may sound silly for an operating system to have a journal, but the journal ensures that the computer can quickly recover if there’s a sudden crash or power loss.
  3. Windows opens up the Master File Table (MFT), finds foo.docx, and removes its entry. Note: this does not delete the file, it just makes it impossible for Windows to find it anymore.
  4. Windows removes the note it put in its journal earlier. Windows is done deleting foo.docx.

After the file is deleted, all of its data still exist on your disk drive. There’s just no record of where the file is on your disk drive, so standard programs can’t find it. I use a Super Data Rescue Package to recover clients files and save time but there are free options available.

The Four Secrets To Recovering Deleted Files

Secret One: The sooner you try to recover a file after its been deleted, the greater your chance of success. That’s because Windows will write new files on top of old, deleted files. Once a new file gets written on top of the deleted file, there’s no way to recover the whole deleted file.

If you just deleted a file that you really need, you can almost guarantee it won’t be overwritten by immediately unplugging your computer from the wall. Of course, this means none of the other open files on your computer will be saved.

Secret Two: Smaller files are easier to recover than bigger files. That’s because the Window’s filesystem (NTFS) uses fragmentation to maximize the amount of space you can use on your disk drive. Smaller files have fewer fragments, making it easier to find all the parts of the file. The ideal number of fragments is one.

A useful corollary is that you’ll have better success retrieving deleted files if you regularly defragment your drive. After defragmenting, almost every file will have only one fragment.

Secret Three: You need to know the type of file in order to recover it. The only place the filename is stored on Windows is the Master File Table (MFT), so you can’t search for files by filename after the file is removed from the MFT. You need to know what type of file it is in order to find it–in our example, we assume foo.docx was a Microsoft Word 2007 or 2010 file.

Secret Four: You need to ensure the disk drive runs as read-only before you attempt to recover files. This is to prevent Windows from overwriting the file you want to recover. Many USB drives and some USB disk drive enclosures have a read-only switch–this works great: safely remove the drive or unplug the USB cord like usual, toggle the switch, and reinsert the drive or cord.

Some internal disk drives have a read-only switch, although you may need to mess with electric jumpers to toggle it. Unfortunately most internal disks don’t have a read-only switch and, what’s worse, Windows doesn’t like to boot from a read-only disk. We’ll deal with this problem in the next section.

How the FBI Recovers Deleted Files

The original set of programs for low-level file recovery is called The Coroner’s Toolkit (TCT). TCT was incorporated into other more advanced toolkits which will be described here called The Sleuth Kit (TSK) and Autopsy.

FBI Recovers Deleted Files

Despite their morbid names, TSK and Autopsy are vibrant tools capable of assorted tasks. They don’t run on Windows directly–you need to run them from a Linux live DVD or virtualization program like VMWare. This won’t remove or damage your Windows installation and it can lets you access your drive in read-only mode.

Free Privacy Scan
Although there are many Linux live DVDs and virtual environments that contain TSK and Autopsy, we suggest BackTrack Linux available at backtrack-linux.org. Unless you’re familiar with VMWare, you should download the DVD ISO image and burn it to a DVD. Then place the DVD in the computer with the deleted file and reboot.

After BackTrack finishes loading, you’ll find a stylized K where the Start menu usually appears in Windows. Click the K, go to the BackTrack menu, Go do the Digital Forensics menu, and choose Launch Autopsy. Then open the Web Browser (a globe icon next to the K icon) and browse to http://localhost:9999/autopsy.

Autopsy is an easy-to-use HTML-based frontend to the dozens of commands in TSK. On the main screen of Autopsy, you want to create a New Case, then follow the menus. When you get to the File Analysis screen, choose “Show All Deleted Files”. It will take a long time for all of the files to appear–TSK must scan every unused bit of your disk drive to see if it contains a deleted file. You can expect the process to take about 1 minute for every 10 GBs on your disk drive.

After TSK finds all the deleted files, you can sort through them to find the file you need. Then all you need to do to recover the deleted file is click on its link and save it.

To use these tools, sometimes you need to fix failed hard disks before proceeding to get your files back like the FBI recovers deleted files.

 

This post was written by...

– who has written 79 posts on Computer Tips.

David A. Harding is a Linux Professional Institute certified system administrator and freelance writer with over 10 years experience working with Linux. He’s been published in over a dozen magazines and has given over 50 presentations about Linux–including two Software Freedom Day keynotes. Dave always loves to hear from readers and can be reached at dave@dtrt.org.

{ 14 comments… read them below or add one }

Wayne November 14, 2012 at 5:46 am

I use an app called “wipe”. Once used you cannpt ever UN-Delete any file.

Reply

Dennis June 20, 2012 at 9:14 pm

David,
Many people still think once files are deleted from the recycle bin its over. That explains why there are so many businesses in the neighborhoods offering data recovery services, but really anyone can recover their data with the right tools and knowledge which you have generously shared here :)
Dennis recently posted..Safaricom Huawei Ascend Y100 Features and Price in Kenya

Reply

Mika Castro May 14, 2012 at 5:20 am

This is very extravagant. I would definitely try this software to make y work more easier.
Mika Castro recently posted..הרב לייטמן

Reply

zolar1 March 23, 2012 at 5:38 am

This is quite nice IF you are looking at simple WIndows stuff.

The best way is to encrypt the hard drive under Linux, encrypt any files via double encryption, and use a RAMDRIVE if at all possible.

You *could* use an encrypted Linux file system, run VMWARE with XP installed and then encrypt both that virtual hard drive and the file.

If necessary, you can use PAQ8 to compress the file further. File compression can make things hard to extract information.

Just remember, the more encryption you have the SLOWER it will be to both encrypt and decrypt the information.

Win7 has bitlocker and from what I read it is a highly encrypted system.

But you *could* look here as well:
htp://albanianwizard.org/gnupg-create-keys-over-4096-bit-stronger-encryption.albanianwizard

Reply

zolar1 March 23, 2012 at 5:47 am

PS I forgot you can use a program like evidence eliminator for regular hard drives. it uses magnetic underwriting technology to ensure permanent and unrecoverable erasure.

It takes *FOREVER* to wipe a whole hard drive. Best is to put sensitive things on a flash drive and if things turn sour, you could always burn it on the stove…

Also, I do not know if this works on flash memory or not.

Reply

Danny December 21, 2011 at 7:28 am

Another great article about file recovery.
But what if you use a program to really delete files?
I assume all the program does is delete the file and then overwrite the space with something blank.
Then the fbi can’t recover the files? Or do I have to disolve the hdd in acid to be sure?
Not that I have anything to hide from the fbi of course, it is just hypothetical. :) *whistles innocently*
Danny recently posted..Husqvarna 327P5X Pole pruner 25cc 12 inch bar

Reply

Mitz December 21, 2011 at 12:23 pm

Pretty much writing over the space where the file was does the job. Especially a few times over. There is no need to soak it in acid.

Reply

Cherry December 6, 2011 at 12:43 pm

this happens to me :( i mean sometimes i accidentally delete important files, and i don’t know how to recover it. but i’m glad to know that it could still be recovered. i MUST have this software.
Cherry recently posted..Get your ex back

Reply

Erica December 2, 2011 at 1:46 am

Thanks for the explanation! I didn’t know that deleted files can still be recovered.. But what if the disk has been formatted? Would there still be chance to recover files?
Erica recently posted..dog training

Reply

Matt December 1, 2011 at 2:03 pm

The safest way to permanently delete a file is to use third party software like Tune-Up utilities and choosing permanent delete. I hope I never have problems with authorities, but you never know how and when this could happen. Anyway, they won’t find anything on my PC :)
Matt recently posted..Acer H9500BD Full HD 3D Projector

Reply

Stephen November 28, 2011 at 11:53 am

I am really careful about what files I delete and I always double to check to see if it’s something important.
However I know many users that are new to operating a computer are likely to delete an important file. Unfortunately they have no idea if or how they can recover these files.
Stephen.
Stephen recently posted..7 Advices for Drawing a Portrait

Reply

Mahesh November 28, 2011 at 10:11 am

This is a great article I have ever read. But, I have a confusion that, some of the file recovery programs do not ask for the file extensions, so do I really need to remember the file extensions, e.g., .docx ?
Mahesh recently posted..Automate Repetitive Tasks on Windows with WinParrot

Reply

Mika Castro May 15, 2012 at 7:30 am

I agree Mahesh! Some of the files on system recovery are not very crucial to find file extensions. Great comment Bro!
Mika Castro recently posted..מיכאל לייטמן

Reply

Scott November 27, 2011 at 4:12 am

The TSK is awesome! Great article and very well written David. That is a great application for our toolkit.

Have a great one!
Scott
Scott recently posted..Want to change your default search provider in Google Chrome?

Reply

Leave a Comment

Previous post:

Next post: