HackBlue

Labs / CTF warm-ups

A file with a damaged first byte

The file command calls this challenge plain data, but the bytes after the first one look familiar. Read the header with xxd, name the format, and find which byte was changed.

  • Terminal mission
  • Intermediate
  • 4 objectives
  • 0 of 4 solved

What you’re looking at

The file command calls this challenge plain data, but the bytes after the first one look familiar. Read the header with xxd, name the format, and find which byte was changed.

Your goal: Name the real file format from its header bytes and find the byte that was changed.

Briefing
the story: what happened and what evidence you were handed.
Terminal
the dark box. It is a pretend Linux shell that runs in your browser. Type a command and press Enter. Nothing you type touches a real system.
Walkthrough
the numbered path. Each step says what to type and what you should see. Hints open one at a time.
Answer boxes
under each question step. Type what you found and press Check.

Start with step 1 in the walkthrough. Every step says what to do and what you should see. The whole thing takes about 2 min to talk through.

Briefing

The challenge is ~/challenge/mystery.bin. The author says "one byte stands between you and the picture".

Formats start with fixed magic bytes. PNG starts with 89 50 4E 47 0D 0A 1A 0A, which is .PNG followed by line-ending bytes. If one of them is wrong, file no longer recognises it.

analyst@ctf-box

ctf-box · CTF warm-ups

Type help for the command list and objectives for your tasks. Everything runs in this browser.

Up and down arrows walk your history. Ctrl+L clears the screen. Try help, ls, and objectives.

The whole walkthrough

Every step in order, written to be read aloud: 277 words, about 2 min. It gives away every answer, so try the steps first.