01DEADFACE CTF Writeup

Reverse Engineering · Linux x86 · Flag recovered

Back to the lineup
Flag recovered Reverse Engineering Linux x86 SHA-1 Custom Base64 RC4

CerealKiller 01

Reverse-engineer the supplied binary to recover its password, reproduce the custom Base64 and RC4 transformations, decrypt the embedded URL, and retrieve the flag hidden in an image.

01 · Verify

SHA-256

Confirm the Linux artifact before analysis begins.

02 · Recover

SHA-1

Locate the digest comparison and identify the password.

03 · Transform

B64 + RC4

Reproduce the binary’s custom decoding and decryption chain.

04 · Retrieve

PNG

Follow the decrypted URL to the second-stage image.

02Walkthrough

From binary to buried flag

01

Challenge overview

The challenge provides a compiled executable that checks a password. Once the correct password is supplied, the program reveals information about the Insectoids’ favorite cereal.

Instead of guessing passwords repeatedly, the solution is to analyze the binary’s password-validation and decryption routines.

The successful analysis identified three important components:

Component A

SHA-1 hashing

Used for password verification, allowing the binary to compare a digest instead of storing the password in plaintext.

Component B

Custom Base64

A modified alphabet decodes the embedded data, so an ordinary Base64 decoder is not enough on its own.

Component C

RC4 decryption

The decoded bytes are decrypted with RC4 to recover the hidden image URL.

Recovered password
cookiecrisp
02

Download and verify the binary

The challenge offered Windows x86 and Linux x86 versions. We analyzed the Linux x86 binary.

Download URL

Challenge artifact
https://tinyurl.com/3vsh7stb

Recorded SHA-256

Expected SHA-256
dd407021703d9e0a5592ff1d92bee5a03a4f4b6e489b055cc896949fcbb380e5

Verify the downloaded file:

Terminal · Verify
$ sha256sum re01-lin-x86.bin

Compare the result with the hash above to ensure you’re analyzing the expected artifact.

Inspect the file

Terminal · Triage
$ file re01-lin-x86.bin
$ strings re01-lin-x86.bin

file identifies the executable format, while strings can reveal readable text — although encrypted or encoded strings may not be visible in plaintext.

Safe handling

Treat challenge binaries as untrusted

Verify the hash first and perform execution or dynamic analysis only in an isolated VM or sandbox. The recovery path documented here centers on inspecting the validation and payload routines.

03

Reverse-engineer the password check

The binary’s password-validation logic uses a SHA-1 digest comparison. The supplied password is hashed, and the resulting digest is compared with a value embedded in the executable.

The important observation is that the binary does not need to store the password itself in plaintext. It can store only its hash.

Candidate password→SHA-1→160-bit digest→Embedded value→Accept / reject
Correct password for this binary
cookiecrisp

The earlier candidate booberry was from a different version of the challenge and was not the correct password for this binary.

Why this works

Find the comparison, then satisfy it

SHA-1 produces a 160-bit digest and is not meant to be “decrypted.” By locating the hash comparison in the program and testing candidate inputs against it, the expected password can be identified. In other words, the work is to understand the check — then find an input whose digest matches.

04

Decode and decrypt the embedded data

After recovering the password, the next step was to analyze the program’s embedded payload.

The binary used two transformations:

  • Custom Base64 decoding: the program used a modified alphabet, so ordinary Base64 decoding alone was insufficient.
  • RC4 decryption: the decoded data was then decrypted using RC4.

The correct approach was to inspect the alphabet mapping and the RC4 key-handling logic, reproduce those transformations, and examine the resulting plaintext.

Embedded data→Custom alphabet→Base64 decode→RC4 decrypt→Image URL

Analyst note

Reproduce the binary’s exact transforms

When a payload will not decode cleanly, compare the implementation character-for-character. A shuffled Base64 alphabet changes every lookup, and the RC4 stage will only produce meaningful plaintext when the decoded bytes and key handling are both reproduced correctly.

Decrypted payload

https://cerealkiller.lyttonlabs.org/unwanted-guests/ick.png
Open Image ↗
05

Retrieve the image and find the flag

Open the recovered URL in a browser or retrieve the image for local inspection.

The image contained the challenge’s final flag. The flag recovered during our analysis was:

Flag found in image
deadface{You-Vill-Eat-Ze-Bugz-Und-You-Vill-Be-Happy!!!}
06

Final answer

Cereal Killer 01 — Flag

Submit this flag

deadface{You-Vill-Eat-Ze-Bugz-Und-You-Vill-Be-Happy!!!}

Reproducibility note

What was retained — and what was not

The password, Linux binary hash, decryption techniques, image URL, and recovered flag are preserved in the source notes. The exact hash constant, custom alphabet, RC4 key derivation, and original terminal commands were not retained, so this writeup does not fabricate a full executable decryption script.

03Takeaways

Skills used in this solve

What this challenge teaches.

A compact reverse-engineering chain: verify the artifact, understand the password check, mirror the payload transforms, then follow the second-stage clue.

01

Analyze password checks

How to analyze password checks in compiled binaries instead of relying on blind guessing.

02

Work around hash comparisons

How SHA-1 comparisons can be reverse-engineered by locating the check and testing candidates against it.

03

Respect custom alphabets

Why custom Base64 alphabets can defeat standard decoders until the exact mapping is recovered.

04

Unwrap encrypted payloads

How RC4-based payload encryption can conceal something as simple — and valuable — as a URL.

05

Follow second stages

How reverse engineering can lead to a second-stage artifact containing the final flag.

06

Document honestly

Preserve hashes, passwords, constants, and commands during the solve so the result remains reproducible.

Flag recovered · Methodology first

Keep reversing.

More CTF writeups, TryHackMe walkthroughs, and practical guides are waiting in the Remote Coders lineup.