Skip to content
imattas
Go back

DISKO 4

Edit page

Challenge Description

Can you find the flag in this disk image? This time I deleted the file! Let see you get it now!

Approach

This is the fourth challenge in the picoCTF DISKO forensics series. The progression of the series is:

Vulnerability / Technique

When a file is “deleted” from a filesystem, the data is not immediately erased. Instead, the filesystem metadata (directory entries, inode references) is updated to mark the space as available. The actual file content remains on disk until overwritten by new data.

Recovery Tools

Several tools can recover deleted files from disk images:

  1. SleuthKit (fls + icat): fls lists all files including deleted ones (marked with *), and icat extracts file content by inode number
  2. tsk_recover: Automatically recovers all unallocated/deleted files from a disk image
  3. extundelete: Specifically for ext3/ext4 filesystems
  4. photorec/scalpel: Carve files based on file signatures regardless of filesystem state
  5. Autopsy/FTK Imager: GUI-based forensic tools

Filesystem Analysis

Based on the DISKO series pattern, the disk image is likely:

Solution

Step 1: Decompress the disk image

gunzip disko-4.dd.gz

Step 2: Identify the filesystem

file disko-4.dd
fdisk -l disko-4.dd

Step 3: List all files including deleted ones

# Using SleuthKit fls (shows deleted files with * prefix)
fls -r -o 2048 disko-4.dd

Step 4: Recover deleted files

# Method 1: Using tsk_recover to recover all deleted files
tsk_recover -o 2048 disko-4.dd output_dir/

# Method 2: If you identify the specific inode with fls
icat -o 2048 disko-4.dd <inode_number> > recovered_flag.txt

# Method 3: Using extundelete (for ext filesystems)
extundelete disko-4.dd --restore-all

# Method 4: Simple string search (may still work if data not overwritten)
strings disko-4.dd | grep -i picoCTF

Step 5: Read the recovered flag

cat output_dir/flag.txt
# or
cat recovered_flag.txt

Solution Script

python3 solve.py

Flag

picoCTF{...}  (placeholder - actual flag varies per instance)

Edit page
Share this post on:

Previous Post
cryptomaze
Next Post
Echo Escape 1