❌

Reading view

There are new articles available, click to refresh the page.

Digital Forensics: Repairing a Damaged Hard Drive and Extracting the Data

Welcome back, aspiring digital forensic analysts!

There are times when our work requires repairing damaged disks to perform a proper forensic analysis. Attackers use a range of techniques to cover their tracks. These can be corrupting the boot sector, overwriting metadata, physically damaging a drive, or exposing hardware to high heat. That’s what they did in Mr.Robot.Β 

mr robot burning the hardware

Physical damage often destroys data beyond practical recovery, but a much more common tactic is logical sabotage. Attackers wipe partitions, corrupt the Master Boot Record, or otherwise tamper with the file system to slow or confuse investigators. Most real-world incidents that require disk-level recovery come from remote activity rather than physical tampering, unless the case involves an insider with physical access to servers or workstations.

Inexperienced administrators sometimes assume that data becomes irrecoverable after tampering, or that simply deleting files destroys their content and structure. That is not true. In this article we will examine how disks can be repaired and how deleted files can still be discovered and analysed.

In our previous article, PowerShell for Hackers: Mayhem Edition, we showed how an attacker can overwrite the MBR and render Windows unbootable. Today we will examine an image with a deliberately damaged boot sector. The machine that produced the image was used for data exfiltration. An insider opened an important PDF that contained a canary token and that token notified the owner that the document had been opened. It also showed the host that was used to access the file. Everything else is unknown and we will work through the evidence together.

Fixing the Drive

Corrupting the disk boot sector is straightforward in principle. You alter the data the system expects to find there so the OS cannot load the disk in the normal way. File formats, executables, archives, images and other files have internal headers and structures that tell software how to interpret their contents. Changing a file extension does not change those internal headers, so renaming alone is a poor method of concealment. Tools that inspect file headers and signatures will still identify the real file type. Users sometimes try to hide VeraCrypt containers by renaming them to appear as ordinary executables. Forensic tools and signature scanners will still flag such anomalies. Windows also leaves numerous artefacts that can indicate which files were opened. Among them are MRU lists, Jump Lists, Recent Items and other traces created by common applications, including simple editors.

Before we continue, let’s see what evidence we were given.

given evidence

Above is a forensic image and below is a text file with metadata about that image. As a forensic analyst you should verify the integrity of the evidence by comparing the computed hash of the image with the hash recorded in the metadata file.

evidence info

If the hash matches, work only on a duplicate and keep the original evidence sealed. Create a verified working copy for all further analysis.

Opening a disk image with a corrupted boot sector in Autopsy or FTK Imager will not succeed, as many of these tools expect a valid partition table and a readable boot sector. In such cases you will need to repair the image manually with a hex editor such as HxD so other tools can parse the structure.

damaged boot sector

The first 512 bytes of a disk image contain the MBR (Master Boot Record) on traditional MBR-partitioned media. In this image the final two bytes of that sector were modified. A valid MBR should end with the boot signature 0x55 0xAA. Those two bytes tell the firmware and many tools that the sector contains a valid boot record. Without the signature the image may be unreadable, so restoring the correct 0x55AA signature is the first step we need to do.Β 

fixed boot sector

When editing the MBR in a hex editor, do not delete bytes with backspace, you need to overwrite them. Place the cursor before the bytes to be changed and type the new hex values. The editor will replace the existing bytes without shifting the file.

Partitions

This image contains two partitions. In a hex view you can see the partition table entries that describe those partitions. In forensic viewers such as FTK Imager and Autopsy those partitions will be displayed graphically once the MBR and partition table are valid.

partitions

Both of them are in the black frame. The partition table entries also encode the partition size and starting sector in little-endian form, which requires byte-order interpretation and calculation to convert to human-readable sizes. For example, if you see an entry that corresponds to 63,401,984 sectors and each sector is 512 bytes, the size calculation is:

63,401,984 sectors Γ— 512 bytes = 32,461,815,808 bytes, which is 32.46 GB (decimal) or β‰ˆ 30.23 GiB

partition size

FTK Imager

Now let’s use FTK Imager to view the contents of our evidence file. In FTK Imager choose File, then Add Evidence Item, select Image File, and point the application to the verified copy of the image.

ftk imager

Once the MBR has been repaired and the image loaded, FTK Imager will display the partitions and expose their file systems. While Autopsy and other automated tools can handle a large portion of the analysis and save time, manual inspection gives you a deeper understanding of how Windows stores metadata and how to validate automated results. In this article we will show how to manually get the results and put the results together using Zimmer’s forensic utilities.

$MFT

Our next goal is to analyse the $MFT (Master File Table). The $MFT is a special system file on NTFS volumes that acts as an index for every file and directory on the file system. It contains records with metadata about filenames, timestamps, attributes, and, in many cases, pointers to file data. The $MFT is hidden in File Explorer, but it is always present on NTFS volumes (for example, C:$MFT)

$mft file found

Export the $MFT from the mounted or imaged volume. Right-click the $MFT entry in your forensic viewer and choose Export Files

exporting the $mft file for analysis

To parse and extract readable output from the $MFT you can use MFTECmd.exe, a tool included in Eric Zimmerman’s EZTools collection. From a command shell run the extractor, for example:

PS> MFTECmd.exe -f ..\Evidence$MFT --csv ..\Evidence\ --csvf MFT.csv

parsing the $mft file

The command above creates a CSV file you can use for keyword searches and timeline work. If needed, rename the exported files to make it easier to work with them in PowerShell.

keyword search in $mft file

When a CSV file is opened, you can use basic keyword search or pick an extension to see what files existed on the drive.Β 

Understanding and working with $MFT records is important. If a suspect deleted a file, the $MFT may still contain its last known filename, path, timestamps and sometimes even data pointers. That information lets investigators target data recovery and build a timeline of the suspect’s activity.

Suspicious Files

During inspection of the second partition we located several suspicious entries. Many were marked as deleted but can still be exported and examined.

suspicious files found

The evidence shows the perpetrator had a utility named DiskWipe.exe, which suggests an attempt to remove traces. We also found references to sensitive corporate documents, which together indicates data exfiltration. At this stage we can confirm the machine was used to access sensitive files. If we decide to analyze further, we can use registry and disk data to see whether the wiping utility was actually executed and what user executed it. This is outside of our scope today.

$USNJRNL

The $USNJRNL (Update Sequence Number Journal) is another hidden NTFS system file that records changes to files and directories. It logs actions such as creation, modification and deletion before those actions are committed to disk. Because it records a history of file-system operations, $UsnJrnl ($J) can be invaluable in cases involving mass file deletion or tampering.Β 

To extract the journal, first go to root, then $Extend and double-click $UsnJrnl. You need a $J file.

$j file in $usnjrnl

You can then parse it with MFTECmd in the same way:

PS> MFTECmd.exe -f ..\Evidence$J --csv ..\Evidence\ --csvf J.csv

parsing the $j file

Since the second partition had the wiper, we can assume the perpetrator deleted files to cover traces. Let’s open the CSV in Timeline Explorer and set the Update Reason to FileDelete to view deleted files.

filtering the results based on Update Reason
data exfil directory found

Among the deleted entries we found a folder named β€œdata Exfil.” In many insider exfiltration cases the perpetrator will compress those folders before transfer, so we searched $MFT and $J for archive extensions. Multiple entries for files named β€œNew Compressed (zipped) Folder.zip” were present.

new zip file found with update reason RenameNewName

The journal shows the zip was created and files were appended to it. The final operation was a rename (RenameOldName). Using the Parent Entry Number exposed in $J we can correlate entries and recover the original folder name.

found the first name of the archive

As you can see, using the Parent Entry Number we found that the original folder name was β€œdata Exfil” which was later deleted by the suspect.

Timeline

From the assembled artifacts we can conclude that the machine was used to access and exfiltrate sensitive material. We found Excel sheets, PDFs, text documents and zip archives with sensitive data. The insider created a folder called β€œdata Exfil,” packed its contents into an archive, and then attempted to cover tracks using a wiper. DiskWipe.exe and the deleted file entries support our hypothesis. To confirm execution and attribute actions to a user, we can examine registry entries, prefetch files, Windows event logs, shellbags and user profile activity that may show us process execution and the account responsible for it. The corrupted MBR suggests the perpetrator also intentionally damaged the boot sector to complicate inspection.

Summary

Digital forensics is a fascinating field. It exposes how much information an operating system preserves about user actions and how those artifacts can be used to reconstruct events. Many Windows features were designed to improve reliability and user experience, but those same features give us useful forensic traces. Although automated tools can speed up analysis, skilled analysts must validate tool output by understanding the underlying data structures and by performing manual checks when necessary. As you gain experience with the $MFT, $UsnJrnl and low-level disk structures, you will become more effective at recovering evidence and validating your hypotheses. See you soon!

Windows 11 Supports ReFS And How To Install Windows 11 on ReFS

Windows 11 is the latest version of the popular operating system from Microsoft. One of the key new features in this release is support for ReFS, or Resilient File System. This advanced file system is designed to provide improved performance, reliability, and data integrity for large-scale storage solutions.

What Is ReFS?

Resilient File System (ReFS) is a file system developed by Microsoft that was first introduced in Windows Server 2012. It is designed to be a replacement for the older NTFS file system and offers a number of advanced features that make it more suitable for certain types of storage solutions. ReFS uses advanced algorithms to detect and correct data corruption in real time, and it also supports large files and volumes, data deduplication, data mirroring, and virtualization. Additionally, ReFS allows for the creation of storage spaces, which are virtual disks that can be used to combine multiple physical storage devices into a single logical storage pool. It is designed to improve the performance, reliability, and data integrity of storage systems.

Why ReFS Is An Optimal File System?

ReFS provides support for large files and volumes. NTFS has a maximum file size of 16 TB and a maximum volume size of 256 TB. ReFS, on the other hand, supports files up to 16 exabytes and volumes up to 1 yottabyte. That’s huge, right?

This makes it ideal for use in large-scale storage solutions such as data centers and cloud storage. ReFS has built-in support for data deduplication, which can help to reduce the amount of storage space required. This feature works by identifying and removing duplicate data, which can help to save space on storage devices.

ReFS supports virtualization as well. This allows for multiple virtual machines to share the same storage space, which can help to reduce the amount of storage space required. These virtual disks can be used to combine multiple physical storage devices into a single logical storage pool. This makes it easy to create large, highly available storage solutions.

NTFS vs ReFS: Head-To-Head Comparison

NTFS (New Technology File System) and ReFS (Resilient File System) are two of the most popular options available on the Windows operating system. Both file systems have their own unique features and advantages, making it difficult to determine which one is the better option. Let’s compare NTFS and ReFS and discuss their key features, benefits, and use cases to help you decide which file system is best for your needs.

  • NTFS is the default file system for Windows operating systems and has been in use for over two decades. While ReFS was first introduced in Windows Server 2012.
  • NTFS supports file sizes up to 16 TB and volume sizes up to 256 TB. On the other hand, ReFS supports file sizes up to 16 exabytes and volume sizes up to 1 yottabyte.
  • NTFS does not have any built-in data corruption detection and correction capabilities. Meanwhile, ReFS uses advanced algorithms to detect and correct data corruption in real time.
  • NTFS offers robust features such as file and folder permissions, encryption, and compression. ReFS, however, offers advanced features such as data deduplication, data mirroring, and virtualization support.
  • NTFS is supported by most third-party software and tools. Contradictory, ReFS is a newer file system that may not be as widely supported by third-party software and tools.
  • NTFS is a mature and stable file system that is ideal for most storage needs. Meanwhile, ReFS is ideal for large-scale storage solutions where data integrity is of the utmost importance.
  • NTFS does not support features like space-efficient snapshots. However, ReFS supports features like space-efficient snapshots.
  • NTFS does not support features like data tiering. But ReFS does support features like data tiering.
  • NTFS does not support features like online data scrubbing. When it comes to ReFS, it supports features like online data scrubbing
  • NTFS does not support features like storage pools. While ReFS supports features like storage pools.

ReFS Compatibility In Windows 11

Windows 11 operating system will include support for ReFS as a new option, but it may only be available in certain editions such as Enterprise, Education, and Workstation. However, it has been reported that a Pro version of Windows 11 also has this support. Additionally, it is likely that ReFS can only be chosen during initial setup and not while the system is running due to the lack of direct NTFS to ReFS conversion. Windows 11 administrators can enable ReFS on Insider builds using ViVeTool and ID 42189933, but it is recommended to create a full system backup before installing Windows 11 on ReFS.

How To Install Windows 11 on ReFS

Microsoft is in the process of developing the ability to format a drive to ReFS during the Windows 11 setup process. This allows the operating system to run on the latest file system. The feature is currently under development and not publicly available. However, some tech enthusiasts have found a way to activate it and have successfully installed Windows 11 on a ReFS partition. Let’s examine the process of installing Windows 11 on a ReFS partition.

With the release of the Windows 10 Fall Creators Update, Microsoft eliminated the option to format drives to ReFS for consumer versions. This limited it to only β€œworkstation pro” and Enterprise editions. However, Windows 11 Build 25281 has included support for ReFS as a target file system for the system drive. Although it is currently hidden and not officially listed in the release notes.

Enabling velocity ID 42189933 in the component store allowed Twitter users @XenoPanther and @PhantomOfEarth to install Windows 11 on ReFS directly. The screenshots are attached below:

Install Windows 11 on ReFS
Twitter User Showed ReFS Disk Partition
Windows 11 Support for ReFS

They stated that the installation process was smooth, but they encountered a green screen of death.

However, here’s how to enable support for ReFS during the Windows Setup process.

  1. Download ViveTool from GitHub.
  2. Extract the app to the β€œc:\vivetool” folder.
  3. Open the Terminal as an Administrator by pressing Win + X and selecting β€œTerminal (Admin)β€œ.
  4. Type in the command: c:\vivetool\vivetool /enable /id 42189933.
  5. Restart Windows 11.
  6. Double-click the ISO file of your Windows 11 (build 25281 or above). If you don’t have one, you can download here.
  7. In the File Explorer window that opens, double-click setup.exe file and proceed with the installation. Make sure to select the ReFS partition as the target drive for the operating system.

You’re all set!

Conclusion

At present, ReFS support is not available in the official version of Windows 11 and it is primarily intended for specific use cases. NTFS will remain the primary file system and it is unlikely that it will be replaced by ReFS in the near future. However, having the option to use ReFS can provide additional choices for users and organizations. If you like living on the edge you may give it a go and share your experience.

The post Windows 11 Supports ReFS And How To Install Windows 11 on ReFS first appeared on Internet Security Blog - Hackology.

❌