← Back to Writeups
CUSTOMMediumSteganography

Glitched

XESXOR9/2/20262 min read
#steganography#custom#medium#video_frame_extraction#binary_pixel_encoding#2x2_pixel_scaling#linux

Glitched

Platform: TaipanByte CTF | Category: Steganography | Type: Challenge | Difficulty: Medium | OS: Linux | Author: XESXOR | Date: 2026-01-22 | Status: Solved Techniques: video_frame_extraction, binary_pixel_encoding, 2x2_pixel_scaling

Summary

Files: output.avi.zip (contains output.avi)

Glitched - TaipanByte CTF

Description

Научно-исследовательская корпорация "InFinicTech" разработала технологию, которая по их словам позволяет хранить неограниченное количество данных в ограниченном облачном хранилище. Это изобретение стало настоящим прорывом в области хранения информации. Но у нас есть подозрения, что их методы не совсем законны, помогите нам разобраться в этом.

Files: output.avi.zip (contains output.avi)

Analysis

  1. Video examination:

    • Short video (0.2 seconds, 10 fps)
    • Frame format: PNG
    • Resolution: 1280x720 pixels ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍
  2. Frame extraction:

    bash
    ffmpeg -i output.avi -vsync 0 frame_%03d.png

    Extracted 2 frames: frame_001.png and frame_002.png

  3. Suspicious indicators:

    • frame_002.png is significantly larger (30KB vs 4KB)
    • Top 268 rows contain "noise" of black and white pixels
    • Each pixel is strictly black (0,0,0) or white (255,255,255) — binary data!
  4. Key discovery:

    • Data is encoded with 2x2 scaling (each bit represented by a 2x2 pixel block)
    • This is characteristic of the Infinite-Storage-Glitch project ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

Solution

python
#!/usr/bin/env python3
"""
Decoding data from a video frame encoded in Infinite-Storage-Glitch style.
Each bit is represented by a 2x2 pixel block (white = 1, black = 0).
"""
from PIL import Image
import numpy as np

# Load the frame with data
img = np.array(Image.open('frame_002.png'))

# Data region - top 268 rows
data_region = img[:268]

# Sample every 2nd pixel (due to 2x2 scaling)
sampled = data_region[::2, ::2]

# Extract bits: white pixel = 1, black = 0
bits = []
for row in sampled:
    for pixel in row:
        bits.append(1 if pixel[0] > 128 else 0)
‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

# Convert bits to bytes (MSB first)
bytes_data = []
for i in range(0, len(bits) - 7, 8):
    byte = 0
    for j in range(8):
        byte = (byte << 1) | bits[i + j]
    bytes_data.append(byte)

# Decode as UTF-8 text
text = bytes(bytes_data).decode('utf-8', errors='ignore')
print(text)

Reference: Infinite-Storage-Glitch

Infinite-Storage-Glitch is a real project that allows encoding arbitrary data into video frames for storage on platforms like YouTube. It uses:

  • Binary encoding (black/white pixel = 0/1)
  • Pixel scaling (usually 2x2) for compression resistance
  • PNG frames inside AVI container to preserve quality ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

Alternative Solution (with ffmpeg)

bash
# Extract frames
ffmpeg -i output.avi -vsync 0 frame_%03d.png

# Analyze sizes
ls -la frame_*.png

# Then Python script for decoding

‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍