Byte Spill

By Aastha Gupta · 2 min read

A corrupted evidence image was recovered from a suspect's machine. It's full of noise. Somewhere in the static, a secret is hiding in plain sight - but not in the way you'd expect.

Byte Spill

The challenge

A corrupted evidence image was recovered from a suspect's machine. It's full of noise. Somewhere in the static, a secret is hiding in plain sight - but not in the way you'd expect.

Flag Format: CYBERHEIST{

First look

First I extracted the ZIP folder. It contained a bmp file going by evidence.bmp. Then I

Finding the way in

To know the contents of the file without extracting them, I used the command:

unzip -l byte-spill.zip

We did this first because sometimes a ZIP contains nested archives, passwords, or multiple pieces of evidence.

After that i extracted it.

i have descibed it fully in next section.

unzip byte-spill.zip

Now, i tried identifying the actual format of the file.

file evidence.bmp

The output was:

PC bitmap, Windows 3.x format,

3200 x 2400 x 24

Our file was genuinely a BMP. The first two bytes were 42 4D. We also learned the width, height, color depth and also that pixel data begins at byte 54.

Now i started looking for readable information:

strings evidence.bmp

When i ran it, i found:

GET /api/v2/admin HTTP/1.1

Authorization: Bearer ...

Set-Cookie: session=...

config.secret_key = ...

SELECT * FROM users WHERE id=12311

These resemble HTTP requests, authentication tokens, configuration values and database queries. This was the first major clue for me, the image contains readable text embedded among its binary pixel data.

I found many strings following the expected flag format after running a python script but they were not the real answer.

I tried extracting all LSB planes.

from PIL import Image

import numpy as np

img = np.array(Image.open("evidence.bmp"))

red = img[:, :, 0]

lsb = red & 1

Image.fromarray(lsb * 255).save("red_lsb.png")

extracting all bit planes:

for bit in range(8):

plane = (red >> bit) & 1

Image.fromarray(plane * 255).save(

f"red_bit{bit}.png"

)

there was no obvious evidence of a simple LSB message.

The flag

CYBERHEIST{...}

What I learned

Read this post on CyberHx →