<?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>Steganography on Alexander Roca</title><link>https://alexanderroca.dev/tags/steganography/</link><description>Recent content in Steganography on Alexander Roca</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 20 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://alexanderroca.dev/tags/steganography/index.xml" rel="self" type="application/rss+xml"/><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></channel></rss>