Get a Pentest and security assessment of your IT network.

Cyber Security

HDD Data Recovery: Can Deleted Files be Traced?

TL;DR

Yes, data from cleaning and volume operations on a HDD can often be traced back, though the difficulty varies. Standard deletion doesn’t erase data; it just marks space as available. Forensic tools and techniques can recover this ‘deleted’ information. Secure wiping methods are needed to truly prevent recovery.

Understanding How Data is Stored

Before we look at tracing, let’s understand how HDDs work:

  • Files aren’t instantly gone: When you delete a file, the operating system doesn’t immediately erase the data. It removes the pointer to that data, making the space available for new files.
  • Fragmentation: Files are often stored in pieces across the disk (fragments). Deletion only affects pointers to these fragments.
  • Volume operations: Formatting or creating partitions doesn’t always overwrite all existing data either; it usually just creates a new file system structure on top of the old one.

Tracing Deleted Files and Volume Changes

Here’s how deleted files and volume changes can be traced:

1. Standard Deletion Recovery

  1. Data recovery software: Tools like Recuva, TestDisk, or PhotoRec scan the HDD for file signatures and reconstruct deleted files. These are effective if the data hasn’t been overwritten.
  2. File carving: This technique identifies file types based on their headers and footers, even without a file system structure.

Example using Recuva (simplified):

recuva /path/to/drive

2. Recovering Data After Formatting

  1. File System Analysis: Tools can analyse the remaining file system structures to identify previously existing files and directories.
  2. Raw Recovery: If the file system is severely damaged, raw recovery scans the entire disk for known file types. This takes longer but can find more data.

TestDisk can be used for partition table analysis:

testdisk /path/to/drive

3. Tracing Volume Operations (Partition Changes)

  1. Partition Table Analysis: The Master Boot Record (MBR) or GUID Partition Table (GPT) stores information about partitions. Forensic tools can examine these tables to see past partition layouts.
  2. Journaling File Systems: File systems like NTFS and ext4 keep logs of changes, including partition creation/deletion. These journals can be analysed for historical data.
  3. Disk Imaging: Creating a full disk image allows you to analyse the drive without modifying it. This is crucial for forensic investigations. Use tools like dd or FTK Imager.

Example using dd (Linux/macOS) to create a disk image:

dd if=/dev/sda of=disk_image.img bs=4096 conv=sync,noerror status=progress

4. Forensic Tools

  • FTK Imager: A powerful tool for creating disk images and analysing file systems.
  • EnCase: Another professional forensic suite with advanced analysis capabilities.
  • Autopsy: An open-source digital forensics platform based on The Sleuth Kit.

Preventing Data Recovery

If you need to securely wipe a drive, standard deletion or formatting isn’t enough:

1. Secure Erase

  1. Overwrite the entire disk: Use tools that overwrite every sector of the HDD multiple times with random data.
  2. DBAN (Darik’s Boot and Nuke): A free tool specifically designed for secure wiping.
  3. Operating System Tools: Some operating systems have built-in secure erase functions.

Example using DBAN:

  • Boot from the DBAN ISO image.
  • Select the drive to wipe.
  • Choose a wiping method (e.g., DoD 5220.22-M).

2. Physical Destruction

  1. Degaussing: Uses a strong magnetic field to erase data.
  2. Shredding/Physical Disassembly: The most secure method, but renders the drive unusable.

Important Considerations

  • SSD vs HDD: SSDs use different storage technology (flash memory) and require specific wiping methods due to wear levelling. Standard overwrite tools may not be effective on SSDs.
  • TRIM command: TRIM can make data recovery more difficult on SSDs by actively erasing unused blocks.
  • Encryption: Encrypting the drive before deletion adds an extra layer of security, as recovered data will be unreadable without the encryption key.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation