<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Easy on Alexander Roca</title><link>https://alexanderroca.dev/tags/easy/</link><description>Recent content in Easy on Alexander Roca</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 26 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://alexanderroca.dev/tags/easy/index.xml" rel="self" type="application/rss+xml"/><item><title>Pickle Rick Write-up</title><link>https://alexanderroca.dev/tactics/pickle-rick-write-up/</link><pubDate>Tue, 19 May 2026 00:00:00 +0000</pubDate><guid>https://alexanderroca.dev/tactics/pickle-rick-write-up/</guid><description>Web server to be exploited. The main objective is to guess the three ingredients to help Rick make his potion and transform himself back into a human from a pickle.</description><content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/picklerick">🔗 Room Link</a></p>
<p><strong>Difficulty:</strong> Easy<br>
<strong>Tags:</strong> Security, Engineer, CTF, Web Exploitation<br>
<strong>Target IP:</strong> <code>10.114.144.190</code></p>
<h1 id="objective">Objective</h1>
<p>Exploit a vulnerable web server to discover three specific ingredients required to help Rick transform back from a pickle into a human.</p>
<h1 id="reconnaissance--enumeration">Reconnaissance &amp; Enumeration</h1>
<h2 id="initial-access">Initial Access</h2>
<p>The challenge begins by accessing the web service via the target IP: <code>http://10.114.144.190</code>
<img alt="1" loading="lazy" src="/images/tactics/pickle_rick/1.png"></p>
<p>Upon visiting the homepage, inspecting the <strong>Page Source</strong> reveals a critical comment exposing a username.
<img alt="2" loading="lazy" src="/images/tactics/pickle_rick/2.png"></p>
<ul>
<li><strong>Username:</strong> <code>R1ckRul3s</code></li>
</ul>
<p>The source code also hints at a subdirectory (<code>assets/</code>). Navigating to <code>http://10.114.144.190/assets/</code> confirms the server environment.
<img alt="3" loading="lazy" src="/images/tactics/pickle_rick/3.png"></p>
<ul>
<li><strong>Server:</strong> Apache/2.4.41</li>
<li><strong>OS:</strong> Ubuntu</li>
<li><strong>Open Port:</strong> 80</li>
</ul>
<h2 id="directory-bruteforcing">Directory Bruteforcing</h2>
<p>Using <code>gobuster</code> with a standard wordlist to find hidden directories and files:</p>
<p><code>gobuster dir -u http://10.114.144.190 -x php,txt,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt</code></p>
<p><strong>Discovered Paths:</strong>
<img alt="4" loading="lazy" src="/images/tactics/pickle_rick/4.png"></p>
<ul>
<li><code>/login.php</code></li>
<li><code>/robots.txt</code></li>
<li><code>/clue.txt</code></li>
</ul>
<h1 id="exploitation">Exploitation</h1>
<h2 id="credential-discovery">Credential Discovery</h2>
<p>Reviewing the content of <code>/clue.txt</code> provides a hint regarding the ingredients.
<img alt="5" loading="lazy" src="/images/tactics/pickle_rick/7.png"></p>
<p>Based on the context of the content from <code>/robots.txt</code>, the password is likely the famous catchphrase: <code>Wubbalubbadubdub</code>.
<img alt="6" loading="lazy" src="/images/tactics/pickle_rick/6.png"></p>
<p>Attempting to log in at <code>/login.php</code> with the credentials:
<img alt="7" loading="lazy" src="/images/tactics/pickle_rick/5.png"></p>
<ul>
<li><strong>User:</strong> <code>R1ckRul3s</code></li>
<li><strong>Pass:</strong> <code>Wubbalubbadubdub</code></li>
</ul>
<p><strong>Result:</strong> Successful login.
<img alt="8" loading="lazy" src="/images/tactics/pickle_rick/8.png"></p>
<h2 id="command-execution--privilege-escalation">Command Execution &amp; Privilege Escalation</h2>
<p>Once logged in, the dashboard restricts access to most sections, leaving only the <strong>&ldquo;Commands&rdquo;</strong> tab available. This suggests a restricted shell or command injection vulnerability.
<img alt="9" loading="lazy" src="/images/tactics/pickle_rick/9.png"></p>
<h3 id="step-1-environment-check">Step 1: Environment Check</h3>
<p>Executing basic commands to understand the environment:</p>
<ul>
<li><code>whoami</code> → Returns current user.
<img alt="10" loading="lazy" src="/images/tactics/pickle_rick/10.png"></li>
<li><code>pwd</code> → Returns current working directory.
<img alt="11" loading="lazy" src="/images/tactics/pickle_rick/11.png"></li>
<li><code>ls</code> → Lists files in the current directory.
<img alt="12" loading="lazy" src="/images/tactics/pickle_rick/12.png"></li>
</ul>
<p>A file named <code>Sup3rS3cretPickl3Ingred.txt</code> is visible. Attempting to read it with <code>cat</code> fails because the command is disabled.
<img alt="13" loading="lazy" src="/images/tactics/pickle_rick/13.png"></p>
<h3 id="step-2-reading-files-bypassing-restrictions">Step 2: Reading Files (Bypassing Restrictions)</h3>
<p>Since <code>cat</code> is blocked, we try alternative commands like <code>tac</code> (which prints files in reverse line order, but still reads the content):</p>
<p><code>tac Sup3rS3cretPickl3Ingred.txt</code>
<img alt="14" loading="lazy" src="/images/tactics/pickle_rick/14.png"></p>
<p><strong>Output:</strong> <code>mr meeseek hair</code></p>
<blockquote>
<p><strong>Ingredient #1 Found:</strong> <code>mr meeseek hair</code></p>
</blockquote>
<h3 id="step-3-finding-the-second-ingredient">Step 3: Finding the Second Ingredient</h3>
<p>Next, we attempt to locate the user&rsquo;s home directory to find the next clue:</p>
<p><code>ls ../../../home ls ../../../home/rick</code>
<img alt="16" loading="lazy" src="/images/tactics/pickle_rick/16.png"></p>
<p>A file named <code>second ingredients</code> is found. Note the space in the filename, requiring proper quoting:</p>
<p><code>tac '../../../home/rick/second ingredients'</code>
<img alt="17" loading="lazy" src="/images/tactics/pickle_rick/17.png"></p>
<p><strong>Output:</strong> <code>1 jerry tear</code></p>
<blockquote>
<p><strong>Ingredient #2 Found:</strong> <code>1 jerry tear</code></p>
</blockquote>
<h3 id="step-4-finding-the-final-ingredient">Step 4: Finding the Final Ingredient</h3>
<p>The final flag is typically located in the root directory (<code>/root/</code>). We check if the current user has sudo privileges:</p>
<p><code>sudo ls /root/</code>
<img alt="18" loading="lazy" src="/images/tactics/pickle_rick/18.png"></p>
<p>Surprisingly, the user can execute <code>sudo</code> without a password (a common misconfiguration in easy-level CTFs). We can now read the final file:</p>
<p><code>sudo tac /root/3rd.txt</code>
<img alt="19" loading="lazy" src="/images/tactics/pickle_rick/19.png"></p>
<p><strong>Output:</strong> <code>fleeb juice</code></p>
<blockquote>
<p><strong>Ingredient #3 Found:</strong> <code>fleeb juice</code></p>
</blockquote>
<h1 id="conclusion">Conclusion</h1>
<p>By enumerating the web server, finding credentials via source code and clues, and exploiting a restricted shell with <code>sudo</code> privileges, we successfully retrieved all three ingredients.</p>
<h1 id="mitigations-and-remediations">Mitigations and Remediations</h1>
<p>To prevent these specific vulnerabilities in a production environment, the following measures should be implemented:</p>
<ol>
<li><strong>Secure Coding Practices</strong>: remove all hardcoded credentials and internal paths from source code comments before deployment. Use automated scanning tools to detect secrets in code repositories.</li>
<li><strong>Input Validation &amp; Sandboxing</strong>: never pass user input directly to system shell commands. if command execution is required, use a strict whitelist of allowed command and sanitize inputs to prevent injection attacks.</li>
<li><strong>Least Privilege Principle</strong>: the web server process should run with the minimum necessary permissions. Specifically, the user running the web application should <strong>not</strong> have <code>sudo</code> access, especially with <code>NOPASSWD</code> privileges.</li>
<li><strong>Hardened Configuration</strong>: disable unnecessary commands (like <code>tac</code>) in restricted shells and configure the web server to block access to sensitive files types (e.g., <code>.txt</code>, <code>.log</code>) in public directories.</li>
</ol>
<h2 id="final-answers">Final Answers</h2>
<ol>
<li><strong>First Ingredient:</strong> <code>mr meeseek hair</code></li>
<li><strong>Second Ingredient:</strong> <code>1 jerry tear</code></li>
<li><strong>Final Ingredient:</strong> <code>fleeb juice</code></li>
</ol>
]]></content:encoded></item><item><title>Brooklyn Nine Nine Write-up</title><link>https://alexanderroca.dev/tactics/brooklyn-nine-nine-write-up/</link><pubDate>Wed, 20 May 2026 00:00:00 +0000</pubDate><guid>https://alexanderroca.dev/tactics/brooklyn-nine-nine-write-up/</guid><description>Web server to be exploited. The main objective is to discover two flags, one from the user and the other from the root user.</description><content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/brooklynninenine">🔗 Room Link</a></p>
<p><strong>Difficulty:</strong> Easy<br>
<strong>Tags:</strong> CTF, Web Exploitation, Privilege Escalation, Steganography<br>
<strong>Target IP:</strong> <code>10.114.158.7</code></p>
<h1 id="objective">Objective</h1>
<p>Exploit a vulnerable web server to discover two flags, one from the user and the other from the root user.</p>
<h1 id="reconnaissance--enumeration">Reconnaissance &amp; Enumeration</h1>
<h2 id="initial-access">Initial Access</h2>
<p>The challenge begins by accessing the web service via the target IP: <code>http://10.114.158.7</code>
<img alt="1" loading="lazy" src="/images/tactics/brooklyn99/1.png"></p>
<p>Upon visiting the homepage, inspecting the <strong>Page Source</strong> reveals a critical comment exposing a relevant hint that mentions <em>steganography</em>.
<img alt="2" loading="lazy" src="/images/tactics/brooklyn99/2.png"></p>
<blockquote>
<p><strong>Steganography</strong>: the practice of representing information within another message or physical object, in such a manner that the presence of the concealed information would not be evident to an unsuspecting person&rsquo;s examination.</p>
</blockquote>
<p>There is a potential hidden content in the image from the main page.</p>
<h2 id="scanning-services">Scanning Services</h2>
<p>Making a quick scan of the web would be useful to get more context of our scenario and to verify which services are available using <code>nmap http://10.114.158.7</code></p>
<p><strong>Discovered services:</strong>
<img alt="3" loading="lazy" src="/images/tactics/brooklyn99/3.png"></p>
<ul>
<li><code>ftp</code></li>
<li><code>ssh</code></li>
<li><code>http</code></li>
</ul>
<h1 id="exploitation">Exploitation</h1>
<h2 id="credential-discovery">Credential Discovery</h2>
<p>Accessing through <code>ftp</code> service firstly verifying if the <code>anonymous</code> user is available to execute <code>ftp anonymous@10.114.158.7</code> where usually it does not require any password to login.
<img alt="4" loading="lazy" src="/images/tactics/brooklyn99/4.png"></p>
<p>The anonymous user is enabled. Exploring if there is any relevant file by executing <code>ls</code>, there is a relevant instance called <code>note_to_jake.txt</code>
<img alt="5" loading="lazy" src="/images/tactics/brooklyn99/5.png"></p>
<p>Getting the file into the local machine by using <code>get note_to_jake.txt</code>
<img alt="6" loading="lazy" src="/images/tactics/brooklyn99/6.png"></p>
<p>Following the command <code>cat note_to_jake.txt</code> in our local machine to read the content of the file.
<img alt="7" loading="lazy" src="/images/tactics/brooklyn99/7.png"></p>
<p>Looks like a potential user to log in within <code>ssh</code> service is <strong>jake</strong> and his password is weak, therefore a brute-force it might be quick to guess it.
Using <em>Hydra</em>, <code>hydra -V -l jake -P /usr/share/wordlists/rockyou.txt 10.114.158.7 ssh</code>
<img alt="8" loading="lazy" src="/images/tactics/brooklyn99/8.png"></p>
<p>Jake&rsquo;s password has been guessed (<strong>987654321</strong>). Let&rsquo;s proceed by impersonating Jake&rsquo;s <code>ssh</code> session, <code>ssh jake@10.114.158.7</code>
<img alt="9" loading="lazy" src="/images/tactics/brooklyn99/9.png"></p>
<h3 id="alternative-credential-discovery">Alternative Credential Discovery</h3>
<p>Downloading the suspicious image that in the page source mentions <em>steganography</em>.
Extracting detailed metadata from the image using the command <code>exiftool</code>.</p>
<p>There was nothing relevant. After a quick google search an interesting command <code>steghide</code> was found, <code>steghide extract -sf brooklyn99.jpg</code>
<img alt="17" loading="lazy" src="/images/tactics/brooklyn99/17.png"></p>
<p>It contains a passphrase. It could be brute forced, therefore, after another quick google search if there is a way to make a brute force attack into an image that hides information. Command<code>stegcracker</code> was found, <code>stegcracker brooklyn99.jpg /usr/share/wordlists/rockyou.txt</code>
<img alt="18" loading="lazy" src="/images/tactics/brooklyn99/18.png"></p>
<p>Image has been cracked and a new result file has created, <code>cat brooklyn99.jpg.out</code>
<img alt="19" loading="lazy" src="/images/tactics/brooklyn99/19.png"></p>
<p>In this path <strong>Holt</strong>&rsquo;s password (<strong>fluffydog12@ninenine</strong>) has been discovered instead of <strong>Jake</strong>. Logging as Holt, <code>ssh holt@10.114.158.7</code>
<img alt="20" loading="lazy" src="/images/tactics/brooklyn99/20.png"></p>
<h2 id="command-execution--privilege-escalation">Command Execution &amp; Privilege Escalation</h2>
<p>Once logged in as <code>jake</code>, the common corroboration of the following command brings more context of the session: <code>pwd</code> and <code>whoami</code></p>
<h3 id="step-1-environment-check-jake">Step 1: Environment Check (Jake)</h3>
<p>Executing basic commands to understand the environment:</p>
<ul>
<li><code>whoami</code> → Returns current user.</li>
<li><code>pwd</code> → Returns current working directory.
<img alt="10" loading="lazy" src="/images/tactics/brooklyn99/10.png">
<img alt="15" loading="lazy" src="/images/tactics/brooklyn99/15.png"></li>
</ul>
<h3 id="step-2-finding-the-user-flag">Step 2: Finding the User Flag</h3>
<p>After exploring within Jake&rsquo;s session there is an interesting file.
<img alt="11" loading="lazy" src="/images/tactics/brooklyn99/11.png"></p>
<p>Looks like it is a hash value (<strong>ee11cbb19052e40b07aac0ca060c23ee</strong>), could be <strong>Holt</strong>s hash password, but let&rsquo;s try if it is the user flag.</p>
<blockquote>
<p><strong>User flag</strong>: <code>ee11cbb19052e40b07aac0ca060c23ee</code></p>
</blockquote>
<h3 id="alternative-step-1-finding-the-user-flag-holt">Alternative Step 1: Finding the User Flag (Holt)</h3>
<p>Proceed by extracting the user flag, <code>ls</code> and <code>cat user.txt</code>
<img alt="21" loading="lazy" src="/images/tactics/brooklyn99/21.png"></p>
<p>We got the same user flag <code>ee11cbb19052e40b07aac0ca060c23ee</code></p>
<blockquote>
<p><strong>User flag</strong>: <code>ee11cbb19052e40b07aac0ca060c23ee</code></p>
</blockquote>
<h3 id="step-3-privilege-escalation">Step 3: Privilege Escalation</h3>
<p>After extracting the user flag, the remaining flag is the root user. Verifying the current session privileges using <code>sudo -l</code>
<img alt="12" loading="lazy" src="/images/tactics/brooklyn99/12.png"></p>
<p>After knowing that the command <code>less</code> can be executed with admin privileges it is time to explore exploits by looking into <a href="https://gtfobins.org/">GTFOBins</a> to accomplish the privilege escalation.
<img alt="13" loading="lazy" src="/images/tactics/brooklyn99/13.png"></p>
<p>Replicating the steps by executing first <code>sudo less /etc/hosts</code> followed afterwards <code>!/bin/sh</code> and verify that we are actually the <em>root</em> user.
<img alt="14" loading="lazy" src="/images/tactics/brooklyn99/14.png"></p>
<h3 id="step-4-finding-the-root-flag">Step 4: Finding the Root Flag</h3>
<p>Navigating into the <code>root</code> folder and reading the text file using <code>cat root.txt</code>
<img alt="15" loading="lazy" src="/images/tactics/brooklyn99/15.png"></p>
<blockquote>
<p><strong>Root flag</strong>: <code>63a9f0ea7bb98050796b649e85481845</code></p>
</blockquote>
<h1 id="conclusion">Conclusion</h1>
<p>By scanning the IP, finding credentials via <code>ftp</code> service and steganography techniques, and exploiting a vulnerable shell with <code>sudo</code> privileges for a specific command to escalate privileges to become the root user, we successfully retrieved both flags.</p>
<h1 id="mitigations-and-remediations">Mitigations and Remediations</h1>
<p>To prevent these specific vulnerabilities in a production environment, the following measures should be implemented:</p>
<ol>
<li><strong>Secure Coding Practices</strong>: remove all hardcoded credentials and internal paths from source code comments before deployment. Use automated scanning tools to detect secrets in code repositories.</li>
<li><strong>Least Privilege Principles</strong>: the <code>ssh</code> service should run with the minimum necessary permissions. Specifically, the user running in the service should <strong>not</strong> have <code>sudo</code> access, especially with <code>NOPASSWD</code> privileges.</li>
<li><strong>Hardened Password Policy</strong>: enforce the usage of complex password to avoid a feasible brute force attack and restrict the amount of attempts to log in.</li>
</ol>
<h2 id="final-answers">Final Answers</h2>
<ol>
<li><strong>User flag</strong>: <code>ee11cbb19052e40b07aac0ca060c23ee</code></li>
<li><strong>Root flag</strong>: <code>63a9f0ea7bb98050796b649e85481845</code></li>
</ol>
]]></content:encoded></item><item><title>Brains Write-up</title><link>https://alexanderroca.dev/tactics/brains-write-up/</link><pubDate>Fri, 22 May 2026 00:00:00 +0000</pubDate><guid>https://alexanderroca.dev/tactics/brains-write-up/</guid><description>The main objective is to find how an attacker exploited the server and afterwards make a forensic examination of the host to identify the attacker&amp;#39;s footprints at the post-exploitation stage.</description><content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/brains">🔗 Room Link</a></p>
<p><strong>Difficulty:</strong> Easy<br>
<strong>Tags:</strong> CTF, Remote Code Execution, Forensic, Splunk<br>
<strong>Target IP:</strong> <code>10.113.190.140</code></p>
<h1 id="objective">Objective</h1>
<p>The main objective is to determine how an attacker exploited the server and subsequently perform a forensic examination of the host to identify the attacker&rsquo;s footprints during the post-exploitation stage.</p>
<h1 id="exploiting-the-server">Exploiting the Server</h1>
<h2 id="reconnaissance--enumeration">Reconnaissance &amp; Enumeration</h2>
<h3 id="scanning-services">Scanning Services</h3>
<p>Making a quick scan of the target would be useful to get more context of our scenario and to verify which services are available using <code>nmap 10.113.190.140</code></p>
<p><strong>Discovered services:</strong>
<img alt="1" loading="lazy" src="/images/tactics/brains/1.png"></p>
<ul>
<li><code>ssh</code></li>
<li><code>http</code></li>
<li><code>ibm-db2</code></li>
</ul>
<blockquote>
<p><code>ibm-db2</code> is a family of relational database products from <strong>IBM</strong> for storing, managing, and analyzing structured data.</p>
</blockquote>
<p>Using <code>nmap -p 50000 --script db2-das-info -sV 10.113.190.140</code> confirms the DB2 listener details to identify what host, port, and features are used to authenticate with a DB2 Client.</p>
<p><img alt="2" loading="lazy" src="/images/tactics/brains/4.png"></p>
<p>Looking at the output, we can extract the port <em>50000</em> is speaking <strong>HTTP</strong> and identifies a path to login manually to <code>/login.html</code> page.</p>
<h3 id="initial-access">Initial Access</h3>
<p>Examining the <code>http</code> service using a web browser to gather more information: <code>http://10.113.190.140</code>
<img alt="3" loading="lazy" src="/images/tactics/brains/2.png"></p>
<p>Upon visiting the homepage and inspecting the <strong>Page Source</strong>, anything relevant was found.</p>
<p>Examining the <code>ibm-db2</code> service (which is actually running a web interface) using the web browser: <code>http://10.113.190.140:50000/login.html</code>
<img alt="4" loading="lazy" src="/images/tactics/brains/5.png"></p>
<p>The service is operating an old version <code>2023.11.3 (build 147512)</code></p>
<h3 id="directory-bruteforcing">Directory Bruteforcing</h3>
<h4 id="http-service">HTTP Service</h4>
<p>Using <code>gobuster</code> with a standard wordlist to find hidden directories and files:
<code>gobuster dir -u http://10.113.190.140 -x php,txt,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt</code></p>
<p><strong>Discovered Paths:</strong>
<img alt="5" loading="lazy" src="/images/tactics/brains/3.png"></p>
<p>Nothing significant was revealed.</p>
<h4 id="ibm-db2-service">IBM-DB2 Service</h4>
<p>Using <code>gobuster</code> with a standard wordlist to find hidden directories and files on the specific port:
<code>gobuster dir -u http://10.113.190.140:50000 -x php,txt,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt</code></p>
<p><strong>Discovered Paths</strong>:
<img alt="6" loading="lazy" src="/images/tactics/brains/6.png"></p>
<ul>
<li><code>login.html</code></li>
<li><code>400.html</code></li>
<li><code>forgotPassword.html</code></li>
<li><code>resetPassword.html</code></li>
</ul>
<h3 id="vulnerability-research">Vulnerability Research</h3>
<p>Searching for a vulnerability for the specific version <code>2023.11.3</code> in <strong>JetBrains</strong> products.
<img alt="7" loading="lazy" src="/images/tactics/brains/7.png"></p>
<p>There is an identified critical authentication bypass vulnerability tracked as <a href="https://nvd.nist.gov/vuln/detail/cve-2024-27198">CVE-2024-27198</a> an allows performing admin actions.</p>
<h2 id="exploitation">Exploitation</h2>
<h3 id="command-execution--remote-code-execution">Command Execution &amp; Remote Code Execution</h3>
<p>Knowing there is a specific vulnerability to perform admin actions implies we will be able to execute code remotely. To make the exploitation process quick, <code>Metasploit</code> will help to automate the entire process. Launch <code>msfconsole</code></p>
<h4 id="step-1-select-exploit-module">Step 1: Select Exploit module</h4>
<p>Searching for the specific exploit module, <code>search cve:2024-27198</code>
<img alt="8" loading="lazy" src="/images/tactics/brains/8.png"></p>
<p>Select the exploit,<code>exploit/multi/http/jetbrains_teamcity_rce_cve_2024_27198</code>
<img alt="9" loading="lazy" src="/images/tactics/brains/9.png"></p>
<h4 id="step-2-execute-the-payload">Step 2: Execute the payload</h4>
<p>Firstly, examining the required options to be filled in, <code>show options</code>
<img alt="10" loading="lazy" src="/images/tactics/brains/10.png"></p>
<p>The required options in this scenario are:</p>
<ul>
<li><code>RHOSTS</code></li>
<li><code>RPORT</code></li>
</ul>
<p>Insert the needed values use <code>set RHOSTS 10.113.170.99</code> and <code>set RPORT 50000</code> and verify that are correctly selected using <code>show options</code> again.
<img alt="11" loading="lazy" src="/images/tactics/brains/11.png"></p>
<p>Verify if the target is vulnerable after setting the options using <code>check</code>, then run the exploit with <code>run</code>
<img alt="12" loading="lazy" src="/images/tactics/brains/12.png"></p>
<h4 id="step-3-environment-check">Step 3: Environment Check</h4>
<p>Execute basic commands to understand the environment:</p>
<ul>
<li><code>whoami</code></li>
<li><code>pwd</code></li>
<li><code>ls</code>
<img alt="13" loading="lazy" src="/images/tactics/brains/13.png"></li>
</ul>
<p>The flag is mentioned to be in the home flag. Therefore, navigate to the specific folder using <code>cd /home</code> and <code>ls ubuntu</code>
<img alt="14" loading="lazy" src="/images/tactics/brains/14.png"></p>
<p>Read the content of the file <code>flag.txt</code> using <code>cat ubuntu/flag.txt</code>
<img alt="15" loading="lazy" src="/images/tactics/brains/15.png"></p>
<p><strong>Output:</strong><code>THM{faa9bac345709b6620a6200b484c7594}</code></p>
<blockquote>
<p><strong>Home folder flag Found:</strong><code>THM{faa9bac345709b6620a6200b484c7594}</code></p>
</blockquote>
<h1 id="investigation">Investigation</h1>
<p>The IT department has provided the compromised server. The goal is to identify the attacker&rsquo;s footprints in the post-exploitation stage. <strong>Splunk</strong> will be the first place to delve into the scenario.</p>
<ul>
<li>Username: <code>splunk</code></li>
<li>Password: <code>analyst123</code></li>
</ul>
<h2 id="splunk-examination">Splunk Examination</h2>
<h3 id="malicious-user">Malicious User</h3>
<p>Access Splunk using the following URL, <code>http://10.114.181.179:8000</code>
<img alt="16" loading="lazy" src="/images/tactics/brains/16.png"></p>
<p>It is required to explore the <code>Search &amp; Reporting</code> app to investigate the logs from the <code>brains</code> service. Select the option <code>Data Summary</code> to extract all the entrances classified by specific criteria.
<img alt="17" loading="lazy" src="/images/tactics/brains/17.png"></p>
<p>Since the attacker has been authorized as a <code>root</code> all the authentication logs are stored in <code>auth.log</code>
<img alt="18" loading="lazy" src="/images/tactics/brains/18.png"></p>
<p>Display all records captured from <code>auth.log</code> by selecting the time frame as <code>All time</code>
<img alt="19" loading="lazy" src="/images/tactics/brains/19.png"></p>
<p>Since the next flag mentions <strong>user</strong>, looking at the section called <code>INTERESTING FIELDS</code> does not mention anything about <code>name</code> or <code>user</code> initially, but there is an option to select <code>more fields</code>
<img alt="20" loading="lazy" src="/images/tactics/brains/20.png"></p>
<p>In the <code>Field</code> column there is an instance called <code>name</code>. By displaying the field, there is an interesting line that mentions the user.
<img alt="21" loading="lazy" src="/images/tactics/brains/21.png"></p>
<blockquote>
<p><strong>Name of the backdoor user which was created on the server after exploitation:</strong> <code>eviluser</code></p>
</blockquote>
<p>By including the filter of the known malicious user, we can identify the day of the attack.
<img alt="22" loading="lazy" src="/images/tactics/brains/22.png"></p>
<p>It is vital to inspect <code>7/14/24</code></p>
<h3 id="malicious-package">Malicious Package</h3>
<p>Within the <code>Data Summary</code>, the <code>Sourcetypes</code> section mentions <code>packages</code>. Therefore, the next step is to review its content. Before anything, apply an advisable filter to reduce the entrances by selecting <code>Date &amp; Time Range</code> and specifying the date <code>07/14/2024</code>
<img alt="23" loading="lazy" src="/images/tactics/brains/23.png"></p>
<p>Now there are all the instances with the source type <code>packages</code> that were registered in the system before <code>7/24/24</code>
<img alt="24" loading="lazy" src="/images/tactics/brains/24.png"></p>
<p>The first instance contains a suspicious name called <code>datacollector</code></p>
<blockquote>
<p><strong>Name of the malicious-looking package installed on the server</strong>: <code>datacollector</code></p>
</blockquote>
<h3 id="plugin-installed">Plugin Installed</h3>
<p>To look for the malicious plugin, it is mandatory to first review the service that was attacked. It is called <code>teamcity</code>. Therefore, look in the <code>Data Summary</code> within the <code>Sources</code> section where  <code>teamcity-activities.log</code>.</p>
<p>Repeating the same temporal criteria as for the malicious package and apply an additional filter <code>*plugin*</code>. The entries generated by Splunk will be the most relevant to inspect based on the scenario.
<img alt="25" loading="lazy" src="/images/tactics/brains/25.png"></p>
<p>Looking at the first instance it reveals a bizarre name <code>AyzzbuXY</code> and it is a <code>zip</code> file. This is the plugin.</p>
<blockquote>
<p><strong>Name of the plugin installed on the server after successful exploitation:</strong> <code>AyzzbuXY.zip</code></p>
</blockquote>
<h1 id="conclusion">Conclusion</h1>
<p>By scanning the IP, identifying the service on port <code>50000</code> as a <strong>JetBrains TeamCity</strong> instance, and exploiting a known vulnerability (<strong>CVE-2024-27198</strong>) that allows a remote code execution as the root user, we successfully retrieved the initial flag.</p>
<p>By accessing Splunk to review <code>Data Summary</code> where was registered the authentication and TeamCity service activities were registered as logs, we successfully retrieved the forensic flags.</p>
<h1 id="mitigations-and-remediations">Mitigations and Remediations</h1>
<p>To prevent these specific vulnerabilities in a production environment, the following measures should be implemented:</p>
<ol>
<li><strong>Patch Management</strong>: immediately update JetBrains TeamCity to the latest version to mitigate known CVEs like CVE-2024-27198.</li>
<li><strong>Network Segmentation</strong>: restrict access to administrative interfaces (like TeamCity login page) to trusted IP ranges only, rather than exposing them publicly.</li>
<li><strong>Log Monitoring &amp; SIEM</strong>: implement robust logging and real-time monitoring (like Splunk) to detect anomalous user creation, suspicious package installations, and unauthorized plugin activity.</li>
<li><strong>Principle of Least Privilege</strong>: ensure that services do not run with unnecessary root privileges and that user accounts are strictly controlled.</li>
</ol>
<h2 id="final-answers">Final Answers</h2>
<ol>
<li><strong>Home folder flag:</strong> <code>THM{faa9bac345709b6620a6200b484c7594}</code></li>
<li><strong>Name of the backdoor user which was created on the server after exploitation:</strong> <code>eviluser</code></li>
<li><strong>Name of the malicious-looking package installed on the server</strong>: <code>datacollector</code></li>
<li><strong>Name of the plugin installed on the server after successful exploitation:</strong> <code>AyzzbuXY.zip</code></li>
</ol>
]]></content:encoded></item><item><title>Traverse Write-up</title><link>https://alexanderroca.dev/tactics/traverse/</link><pubDate>Tue, 26 May 2026 00:00:00 +0000</pubDate><guid>https://alexanderroca.dev/tactics/traverse/</guid><description>You are Bob, a security engineer working with the DevOps team on a tourism web application. After moving the site to production, the team noticed it was being hacked. The objective is to identify the exploited vulnerabilities, retrieve the flags, and restore the website.</description><content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/traverse">🔗 Room Link</a></p>
<p><strong>Difficulty:</strong> Easy<br>
<strong>Tags:</strong> CTF, Web Exploitation, Privilege Escalation<br>
<strong>Target IP:</strong> <code>10.113.133.17</code></p>
<h1 id="objective">Objective</h1>
<p>Act as Bob, a security engineer, to identify the vulnerabilities exploited on the tourism website in the production environment, retrieve the hidden flags, and restore the website to its original state.</p>
<h1 id="reconnaissance--enumeration">Reconnaissance &amp; Enumeration</h1>
<p>The challenge begins by accessing the web service via the target IP: <code>http://10.113.133.17</code>
<img alt="1" loading="lazy" src="/images/tactics/traverse/1.png"></p>
<blockquote>
<p><strong>Minified Javascript</strong>: the process of removing unnecessary characters from JavaScript code, such as whitespace, comments, and line breaks, without changing its functionality.</p>
</blockquote>
<p>By mentioning &ldquo;minified&rdquo; it means that the JavaScript code was modified. Inspecting the <strong>Page Source</strong> reveals several critical clues:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-html" data-lang="html"><span style="display:flex;"><span><span style="color:#75715e">&lt;!-- Rest PHP code and html content --&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">&lt;!DOCTYPE html&gt;</span>
</span></span><span style="display:flex;"><span>&lt;<span style="color:#f92672">html</span> <span style="color:#a6e22e">lang</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;en&#34;</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>&lt;<span style="color:#f92672">head</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">meta</span> <span style="color:#a6e22e">charset</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;UTF-8&#34;</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">meta</span> <span style="color:#a6e22e">name</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;viewport&#34;</span> <span style="color:#a6e22e">content</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;width=device-width, initial-scale=1.0&#34;</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">title</span>&gt;Tourism Website&lt;/<span style="color:#f92672">title</span>&gt;
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span>    &lt;<span style="color:#f92672">script</span> <span style="color:#a6e22e">src</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#39;/tailwind.min.js&#39;</span>&gt;&lt;/<span style="color:#f92672">script</span>&gt; <span style="color:#75715e">&lt;!-- THIS IS OFFICIAL FILE - DO NOT CHANGE IT --&gt;</span>
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">script</span> <span style="color:#a6e22e">src</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#39;custom.min.js&#39;</span>&gt;&lt;/<span style="color:#f92672">script</span>&gt; <span style="color:#75715e">&lt;!-- THIS IS CUSTOM JS FILE--&gt;</span>
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">link</span> <span style="color:#a6e22e">rel</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;stylesheet&#34;</span> <span style="color:#a6e22e">href</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;/style.css&#34;</span>&gt;
</span></span><span style="display:flex;"><span>&lt;/<span style="color:#f92672">head</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>&lt;<span style="color:#f92672">body</span>&gt;
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">&lt;!-- Navigation Bar --&gt;</span>
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">nav</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;bg-gray-900 text-white p-6&#34;</span>&gt;
</span></span><span style="display:flex;"><span>    &lt;<span style="color:#f92672">div</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;flex justify-between items-center&#34;</span>&gt;
</span></span><span style="display:flex;"><span>      &lt;<span style="color:#f92672">a</span> <span style="color:#a6e22e">href</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;/&#34;</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;text-lg font-bold&#34;</span>&gt;Tourism MHT &lt;/<span style="color:#f92672">a</span>&gt;
</span></span><span style="display:flex;"><span>      &lt;<span style="color:#f92672">ul</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;flex items-center gap-5&#34;</span>&gt;
</span></span><span style="display:flex;"><span>	  <span style="color:#75715e">&lt;!--  &lt;li&gt;&lt;a href=&#34;https://alexanderroca.dev/img&#34; class=&#34;hover:text-gray-300&#34;&gt;Logs&lt;/a&gt;&lt;/li&gt;  Please keep all images in this folder --&gt;</span>
</span></span><span style="display:flex;"><span>      <span style="color:#75715e">&lt;!--  &lt;li&gt;&lt;a href=&#34;./logs&#34; class=&#34;hover:text-gray-300&#34;&gt;Logs&lt;/a&gt;&lt;/li&gt;  DevOps team to check and remove it later on --&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        
</span></span><span style="display:flex;"><span>              
</span></span><span style="display:flex;"><span>      &lt;/<span style="color:#f92672">ul</span>&gt;
</span></span><span style="display:flex;"><span>    &lt;/<span style="color:#f92672">div</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;/<span style="color:#f92672">nav</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">&lt;!-- Main Content --&gt;</span>
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">main</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34; mx-auto py-8  h-[80vh] flex items-center justify-center&#34;</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    &lt;<span style="color:#f92672">div</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;rounded overflow-hidden shadow-lg bg-white  p-8 flex &#34;</span>&gt;
</span></span><span style="display:flex;"><span>		        &lt;<span style="color:#f92672">h2</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;text-gray-700 text-3xl py-6&#34;</span>&gt; FINALLY HACKED !!! I HATE MINIFIED JAVASCRIPT&lt;/<span style="color:#f92672">h2</span>&gt;
</span></span><span style="display:flex;"><span>	    &lt;/<span style="color:#f92672">div</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  &lt;/<span style="color:#f92672">main</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">&lt;!-- Footer --&gt;</span>
</span></span><span style="display:flex;"><span>  &lt;<span style="color:#f92672">footer</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;bg-gray-900 text-white flex items-center justify-center&#34;</span>&gt;
</span></span><span style="display:flex;"><span>    &lt;<span style="color:#f92672">div</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;text-center p-4&#34;</span>&gt;
</span></span><span style="display:flex;"><span>      &lt;<span style="color:#f92672">p</span>&gt;&amp;copy; 2023 Tourism.mht. All rights reserved.&lt;/<span style="color:#f92672">p</span>&gt;
</span></span><span style="display:flex;"><span>    &lt;/<span style="color:#f92672">div</span>&gt;
</span></span><span style="display:flex;"><span>  &lt;/<span style="color:#f92672">footer</span>&gt;&lt;/<span style="color:#f92672">body</span>&gt;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>&lt;/<span style="color:#f92672">html</span>&gt;
</span></span></code></pre></div><p>It mentions <strong>PHP</strong> at the top of the source code.
Moreover, there are relevant comments:</p>
<ul>
<li><code>custom.min.js</code>: Custom JS file</li>
<li><code>/img</code>: Keeps all the images</li>
<li><code>./logs</code>: To check logs and remove later for DevOps</li>
</ul>
<h2 id="service-analysis">Service Analysis</h2>
<p>Inspecting the <em>Network</em> tab in browser development tools reveals a <code>GET</code> request to <code>custom.min.js</code>
<img alt="2" loading="lazy" src="/images/tactics/traverse/10.png"></p>
<p>Downloading and examining the file reveals the content is encoded in <code>Hexadecimal</code> (<strong>hex</strong>)
<img alt="3" loading="lazy" src="/images/tactics/traverse/11.png"></p>
<blockquote>
<p><strong>What type of encoding is used by the hackers to obfuscate the JavaScript file?</strong> <code>hex</code></p>
</blockquote>
<p>Using <strong>CyberChef</strong> to decode the hex string reveals the hidden message <code>DIRECTORY LISTING IS THE ONLY WAY</code>
<img alt="4.png" loading="lazy" src="/images/tactics/traverse/12.png"></p>
<blockquote>
<p><strong>What is the flag value after deobfuscating the file?</strong> <code>DIRECTORY LISTING IS THE ONLY WAY</code></p>
</blockquote>
<h2 id="directory-enumeration">Directory Enumeration</h2>
<p>Following the hints from the source code comments:</p>
<h3 id="1-image-directory-img">1. Image Directory (<code>/img</code>)</h3>
<p>Visiting <code>http://10.113.133.17/img</code> reveals an <strong>Apache server</strong> running on <strong>Ubuntu</strong>. No immediate flags are found in the images.
<img alt="5.png" loading="lazy" src="/images/tactics/traverse/2.png"></p>
<h3 id="2-logs-directory-logs">2. Logs Directory (<code>/logs</code>)</h3>
<p>Visiting <code>http://10.113.133.17/logs</code> reveals a file named <code>email_dump.txt</code>
<img alt="6.png" loading="lazy" src="/images/tactics/traverse/3.png"></p>
<blockquote>
<p><strong>What is the name of the file containing email dumps?</strong> <code>email_dump.txt</code></p>
</blockquote>
<p>Reading the content of <code>email_dump.txt</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>From: Bob &lt;bob@tourism.mht&gt;
</span></span><span style="display:flex;"><span>To: Mark &lt;mark@tourism.mht&gt;
</span></span><span style="display:flex;"><span>Subject: API Credentials
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Hey Mark,
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Sorry I had to rush earlier for the holidays, but I have created the directory for you with all the required information for the API.
</span></span><span style="display:flex;"><span>You loved SSDLC so much, I named the API folder under the name of the first phase of SSDLC.
</span></span><span style="display:flex;"><span>This page is password protected and can only be opened through the key. THM{100100111}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>See ya after the holidays
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Bob.
</span></span></code></pre></div><p>The email mentions the API folder is named after the <strong>first phase of SSDLC</strong>. The first phase is <strong>Planning</strong>.</p>
<blockquote>
<p><strong>The logs folder contains email logs and has a message for the software team lead. What is the name of the directory that Bob has created?</strong> <code>Planning</code></p>
</blockquote>
<p>The email also provides the password/key: <code>THM{100100111}</code></p>
<blockquote>
<p><strong>What is the key file for opening the directory that Bob has created for Mark?</strong> <code>THM{100100111}</code></p>
</blockquote>
<h1 id="exploitation">Exploitation</h1>
<h2 id="credential-discovery--api-abuse">Credential Discovery &amp; API Abuse</h2>
<h3 id="step-1-accessing-the-planning-directory">Step 1: Accessing the Planning Directory</h3>
<p>Visiting <code>http://10.113.133.17/planning</code> requires a password. Entering the key <code>THM{100100111}</code> grants access.
<img alt="7.png" loading="lazy" src="/images/tactics/traverse/4.png"></p>
<h3 id="step-2-enumerating-users">Step 2: Enumerating Users</h3>
<p>Inside, we find instructions for an API endpoint: <code>GET http://MACHINE_IP/api/?customer_id=1</code></p>
<p>The objective is to find specific user details via the API.
<img alt="8.png" loading="lazy" src="/images/tactics/traverse/5.png"></p>
<p><strong>Finding User ID 5</strong>: Calling <code>http://10.113.133.17/api/?customer_id=5</code> returns information for a client:
<img alt="9.png" loading="lazy" src="/images/tactics/traverse/6.png"></p>
<p>There is an information from the customer <strong>id=5</strong>, where the email is <a href="mailto:john@traverse.com">john@traverse.com</a> and it is a <strong>client</strong> user.</p>
<blockquote>
<p><strong>What is the email address for ID 5 using the leaked API endpoint?</strong> <code>john@traverse.com</code></p>
</blockquote>
<p><strong>Finding the Admin User</strong>: Iterating through IDs reveals that <code>id=3</code> belongs to an administrator. Calling: <code>http://10.113.133.17/api/?customer_id=3</code> reveals:
<img alt="10.png" loading="lazy" src="/images/tactics/traverse/7.png"></p>
<blockquote>
<p><strong>What is the ID for the user with admin privileges?</strong> <code>3</code></p>
</blockquote>
<p>It displays the <strong>endpoint</strong> to get access <code>/realadmin</code> and it reveals an email <code>realadmin@traverse.com</code>, name <code>admin</code> and password <code>admin_key!!!</code></p>
<blockquote>
<p><strong>What is the endpoint for logging in as the <code>admin</code>? Mention the last endpoint instead of the URL.</strong> <code>/realadmin</code></p>
</blockquote>
<h3 id="step-3-gaining-admin-access">Step 3: Gaining Admin Access</h3>
<p>Navigating to <code>http://10.113.133.17/realadmin</code>:
<img alt="11.png" loading="lazy" src="/images/tactics/traverse/8.png"></p>
<p>Logging in with the credentials found (<code>realadmin@traverse.com / admin_key!!!</code>) grants access to the admin panel.
<img alt="12.png" loading="lazy" src="/images/tactics/traverse/9.png"></p>
<h3 id="step-4-environment-check">Step 4: Environment Check</h3>
<p>The admin panel offers options to execute system commands.</p>
<ul>
<li><code>System Owner</code>: output <code>www-data</code> (equivalent to <code>whoami</code>)</li>
<li><code>Current Directory</code> output <code>/var/www/html/realadmin</code> (equivalent to <code>pwd</code>)</li>
</ul>
<p>Using the browser&rsquo;s <strong>Network</strong> tab to intercept the <code>POST</code> request, we can modify the payload to execute arbitrary commands.
<img alt="13.png" loading="lazy" src="/images/tactics/traverse/13.png"></p>
<p>Sending <code>commands=ls -lsa</code> reveals the directory contents.
<img alt="14.png" loading="lazy" src="/images/tactics/traverse/14.png"></p>
<p>Two critical files are identified:</p>
<ul>
<li><code>thm_shell.php</code>: likely the web shell used by the attacker.</li>
</ul>
<blockquote>
<p><strong>Can you find the name of the web shell that the attacker has uploaded?</strong> <code>thm_shell.php</code></p>
</blockquote>
<ul>
<li><code>renamed_file_manager.php</code>: a renamed file manager tool</li>
</ul>
<blockquote>
<p><strong>What is the name of the file renamed by the attacker for managing the web server?</strong> <code>renamed_file_manager.php</code></p>
</blockquote>
<p>A password for the file manager is also displayed in the output:<code>THM{10101}</code></p>
<h3 id="step-5-restoring-the-website">Step 5: Restoring the Website</h3>
<p>Accessing <code>http://10.113.133.17/realadmin/renamed_file_manager.php</code> with the password<code>THM{10101}</code> opens the file manager.
<img alt="15.png" loading="lazy" src="/images/tactics/traverse/15.png"></p>
<p>Locating the <code>index.php</code>, we observe it has been modified to display <strong>&ldquo;FINALLY HACKED&rdquo;</strong> message.
<img alt="16.png" loading="lazy" src="/images/tactics/traverse/16.png"></p>
<p>Editing the file to remove the malicious message restores the site.
<img alt="17.png" loading="lazy" src="/images/tactics/traverse/17.png"></p>
<p>The final flag of this room is in the file: <code>THM{WEBSITE_RESTORED}</code></p>
<blockquote>
<p><strong>Can you use the file manager to restore the original website by removing the &ldquo;<code>FINALLY HACKED</code>&rdquo; message? What is the flag value after restoring the main website?</strong> <code>THM{WEBSITE_RESTORED}</code></p>
</blockquote>
<h1 id="conclusion">Conclusion</h1>
<p>By analyzing the source code for hidden comments and obfuscated JavaScript, we identified the encoding method and a hint for directory listing. Leveraging directory enumeration, we found an email dump that revealed the naming convention for a protected directory and the password to access it. Inside, we discovered an insecure API endpoint that allowed us to enumerate users and harvest admin credentials. Finally, using the admin panel to execute commands, we identified the attacker&rsquo;s web shells, accessed the file manager, and restored the compromised website.</p>
<h1 id="mitigations-and-remediations">Mitigations and Remediations</h1>
<p>To prevent these specific vulnerabilities in a production environment, the following measures should be implemented:</p>
<ol>
<li><strong>Code Review &amp; Sanitization</strong>: remove all hardcoded credentials, internal paths, and debug messages from source code before deployment. Avoid leaving comments that hint at hidden directories.</li>
<li><strong>Disable Directory Listing</strong>: configure the web server (Apache/Nginx) to disable directory listing (<code>Options -Indexes</code>) to prevent attackers from browsing file structures.</li>
<li><strong>Secure API Endpoints</strong>: implement proper authentication and authorization checks on all API endpoints. Do not expose sensitive user data (emails, passwords) via unauthenticated or poorly secured GET requests.</li>
<li><strong>Input Validation &amp; Sandboxing</strong>: restrict the ability of web applications to execute system commands. If command execution is necessary, ensure strict input validation and sandboxing to prevent arbitrary code execution.</li>
</ol>
<h2 id="final-answers">Final Answers</h2>
<ol>
<li><strong>What type of encoding is used by the hackers to obfuscate the JavaScript file?</strong> <code>hex</code></li>
<li><strong>What is the flag value after deobfuscating the file?</strong> <code>DIRECTORY LISTING IS THE ONLY WAY</code></li>
<li><strong>What is the name of the file containing email dumps?</strong> <code>email_dump.txt</code></li>
<li><strong>What is the name of the directory that Bob has created?</strong> <code>Planning</code></li>
<li><strong>What is the key file for opening the directory that Bob has created for Mark?</strong> <code>THM{100100111}</code></li>
<li><strong>What is the email address for ID 5 using the leaked API endpoint?</strong> <code>john@traverse.com</code></li>
<li><strong>What is the ID for the user with admin privileges?</strong> <code>3</code></li>
<li><strong>What is the endpoint for logging in as the <code>admin</code>? Mention the last endpoint instead of the URL.</strong> <code>/realadmin</code></li>
<li><strong>Can you find the name of the web shell that the attacker has uploaded?</strong> <code>thm_shell.php</code></li>
<li><strong>What is the name of the file renamed by the attacker for managing the web server?</strong> <code>renamed_file_manager.php</code></li>
<li><strong>Can you use the file manager to restore the original website by removing the &ldquo;<code>FINALLY HACKED</code>&rdquo; message? What is the flag value after restoring the main website?</strong> <code>THM{WEBSITE_RESTORED}</code></li>
</ol>
]]></content:encoded></item></channel></rss>