Raw
Raw
Platform: spbctf | Category: Misc | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-03-09 | Status: Solved Techniques: autocorrelation_width_detection, image_transformation, raw_image_dimensions_detection
Summary
Task: View a raw24 image file without headers. Solution: Used autocorrelation to detect image width (736x1038), then rotated and flipped the image to read the flag.
Raw - Forensics Kids 2.0
Description
"Кто быстрее посмотрит картинку?" (Who will view the image faster?)
Given file image.raw24.zip containing image.raw24 (2,291,904 bytes).
Analysis
The file is a raw 24-bit RGB image without headers:
- File size: 2,291,904 bytes
- 3 bytes per pixel (RGB) = 763,968 pixels
- Need to determine the correct image dimensions
Autocorrelation was used to determine the image width - a method that finds periodicity in data. The correct width gives maximum correlation between adjacent rows.
Solution
Step 1: Determining dimensions via autocorrelation
python read-only • copy allowed#!/usr/bin/env python3 from PIL import Image import numpy as np # Read raw data with open('image.raw24', 'rb') as f: data = f.read() # 2,291,904 bytes / 3 = 763,968 pixels total_pixels = len(data) // 3 print(f"Total pixels: {total_pixels}") # Factorization to find possible dimensions # 763968 = 2^7 * 3 * 1993 = 736 * 1038 # Autocorrelation showed width 736 width = 736 height = total_pixels // width # 1038
Step 2: Opening and transforming the image
python read-only • copy allowed#!/usr/bin/env python3 from PIL import Image import numpy as np # Read raw data with open('image.raw24', 'rb') as f: data = f.read() width, height = 736, 1038 # Create image from raw RGB data img = Image.frombytes('RGB', (width, height), data) # Image shows an anime character, but text is upside down and mirrored # Rotate 180 degrees and flip horizontally img_fixed = img.rotate(180).transpose(Image.FLIP_LEFT_RIGHT) img_fixed.save('image_fixed.png')
Step 3: Reading the flag
After transformation, the text at the top of the image becomes readable:
spbctf{REDACTED}
The flag hints at tools for viewing raw images:
- GBS - raw image viewer
- GIMP - can open raw data via Import Raw Image Data