RR

Field
Value

Category

Forensics

Difficulty

Medium

Challenge Overview

The challenge title “Reusing All of Internal Disks (RAID)” strongly hints at RAID through the acronym. The description mentions that one of the drives failed and asks for help recovering the files.

We are given three disk images:

1.img
2.img
3.img

Inspection shows:

1.img  ~537 MB
2.img  0 bytes
3.img  ~537 MB

Since one disk is missing/empty, the setup perfectly matches RAID5, which:

  • requires at least 3 disks

  • Three disks with one failed: The challenge provides 3 disk images, and one is empty (failed). RAID5 is designed to tolerate exactly one disk failure with a minimum of three disks.

Note: Parity is a redundancy value calculated from data (usually using XOR) that is stored so the system can reconstruct missing data if one disk fails.

RAID5 parity rule:

Parity = Data1 XOR Data2

Therefore if one disk is missing:


Exploitation

Because 2.img was empty, the missing disk could be reconstructed by XOR-ing the other two disks.

I used a small Python script was used to rebuild the missing image block by block:

This produced:

However, RAID5 rotates parity across stripes, meaning that a simple XOR reconstruction will only produce partially correct data. Some stripes are reconstructed correctly, while others become corrupted. As a result, the filesystem inside the reconstructed image cannot be mounted properly.

Running binwalk on the reconstructed image revealed embedded file signatures:

Among the results was a JPEG header:

Because the filesystem was corrupted, file carving was used to recover files directly from raw data. Searching specifically for common formats:

After identifying the JPEG offset, the image was manually extracted using dd:

Even though some RAID stripes were corrupted, JPEG is tolerant to partial corruption, allowing the image to be displayed.

Opening the extracted file revealed a partially corrupted image containing the flag. If the RAID had been reconstructed properly, we would've obtained the entire image.

made by k0d

Last updated