Cct2019 Tryhackme -

{{ self.__class__.__mro__[2].__subclasses__() }} From the list of subclasses, search for file or subprocess.Popen . With careful chaining, we achieve remote code execution.

User chester may run the following commands on cct2019: (ALL : ALL) NOPASSWD: /usr/bin/python3 /opt/backup.py The /opt/backup.py script contains a system backup routine. However, because we have write access to the directory, we can modify the script. When chester executes it via sudo , our malicious code runs as root. cct2019 tryhackme

For those searching for , you are likely looking for a detailed walkthrough, hints for the infamous user.txt and root.txt flags, or an understanding of why this room is a rite of passage for aspiring penetration testers. This article will serve as a complete guide—covering the room’s premise, reconnaissance, exploitation, privilege escalation, and key takeaways. What is the CCT2019 TryHackMe Room? CCT2019 (short for CyberChess Tournament 2019 ) is a medium-difficulty room on TryHackMe created by a renowned community member. Unlike simple boot-to-root machines, this room simulates a realistic corporate environment with a twist—you are investigating an employee’s compromised machine to uncover evidence of a data breach. {{ self

After gaining a basic shell (e.g., via a reverse shell payload injected into the template), we navigate to /home/chester or /home/user to find user.txt . Content of user.txt: A 32-character hash (typical for TryHackMe rooms). Step 3: Lateral Movement and System Enumeration The shell we obtain is low-privileged (usually www-data or a similar service account). To move toward root.txt , we must enumerate the system thoroughly. Key Enumeration Commands: whoami id uname -a sudo -l cat /etc/crontab find / -perm -4000 2>/dev/null # SUID binaries Interesting Discovery: Running sudo -l reveals that the chester user (or a similar low-priv user) can run a specific binary as root without a password: However, because we have write access to the

Always check robots.txt , /backup , and /admin directories on both ports. Use gobuster or dirb for deeper enumeration. Step 2: Web Exploitation – Finding the First Foothold Navigating to port 80 reveals a chess-themed website—likely a tribute to the "CyberChess Tournament." There are no obvious login forms, but the URL parameters hint at template usage (e.g., ?page=index ). Discovering SSTI (Server-Side Template Injection) After testing parameters with payloads like {{7*7}} , we notice that the server returns 49 . This confirms a Jinja2 (Python) template injection vulnerability. Exploiting SSTI: We can escalate the injection to read system files. A common payload:

echo 'import os; os.system("/bin/bash")' >> /opt/backup.py sudo /usr/bin/python3 /opt/backup.py This spawns a root shell. With root access, navigate to the /root directory:

If you are navigating the vast ocean of cybersecurity training platforms, you have likely encountered TryHackMe —a gamified e-learning platform that has become a gold standard for hands-on penetration testing practice. Among its treasure trove of rooms (challenges), one particular CTF (Capture The Flag) stands out for its blend of realism, difficulty, and forensic intrigue: CCT2019 .