<?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 lise on Medium]]></title>
        <description><![CDATA[Stories by lise on Medium]]></description>
        <link>https://medium.com/@tlspm12345?source=rss-b7967a560c2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aLMdBUec0-FYEkMN</url>
            <title>Stories by lise on Medium</title>
            <link>https://medium.com/@tlspm12345?source=rss-b7967a560c2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:17:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tlspm12345/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: RootMe Walkthrough]]></title>
            <link>https://medium.com/@tlspm12345/tryhackme-rootme-walkthrough-a7ac38c3214b?source=rss-b7967a560c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7ac38c3214b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[tryhackme-rootme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[lise]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 14:44:17 GMT</pubDate>
            <atom:updated>2026-10-28T14:44:17.435Z</atom:updated>
            <content:encoded><![CDATA[<p>A comprehensive, step-by-step guide to bypassing web filters and exploiting SUID misconfigurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*VImgtFIemrze3NOu.jpg" /></figure><blockquote>RootMe is a beginner-friendly activity on TryHackMe designed to build the foundational knowledge of a penetration test. It takes you through a realistic attack chain with guide: mapping the target, discovering a web vulnerability, establishing a foothold, and escalating privileges to root.</blockquote><h4>Prerequisites:</h4><ul><li>TryHackMe Account</li><li>Virtual Environment setup</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gbeK-teVSgfngX41TPh2mA.png" /><figcaption>Figure 1.1 Virtual Environment Setup</figcaption></figure><ul><li>Lab Machine | Target IP address: 10.49.174.82</li></ul><h3>Phase 1: Scanning the Target (Nmap)</h3><p>Before attacking, we need to understand our target’s attack surface. I started with a standard network scan using Nmap to identify open ports and the services running on them. Use:</p><pre>nmap -sC -sV &lt;TARGET_IP&gt;</pre><ul><li>-sC: Runs Nmap to look for common vulnerabilities.</li><li>-sV: Actively probes open ports to determine the exact service versions.</li></ul><p>What kind of ports can we see here?</p><ul><li><strong>Port 22 (SSH):</strong> Running OpenSSH. We do not yet possess the necessary credentials, so we will retain this information for future reference.</li><li><strong>Port 80 (HTTP):</strong> We are currently operating the Apache on <strong>version 2.4.41 (ubuntu)</strong>.<strong> </strong>This configuration serves as the primary entry point for our web applications, allowing us to efficiently manage and serve HTTP requests to our users.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*27VFHNQPRAPXxNgDnG6fqQ.png" /><figcaption>Figure 2.1 Reconnaissance (Part 1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*A1FTfOZI4Rn10mtPqqoRFA.png" /><figcaption>Figure 2.2 Reconnaissance (Part 2)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7tjVn2ozC_QbB8KqrPzyg.png" /><figcaption>Figure 2.3 Task 2: Reconnaissance Answers</figcaption></figure><h3>Phase 2: Digging Into the Web Server (Gobuster)</h3><p>Since SSH generally requires credentials to exploit, Port 80 is our most viable entry point. Navigating to the IP address in a web browser just shows a default landing page. To dig deeper, we need to uncover hidden directories using Gobuster.</p><pre>gobuster dir --random-agent -u [http://10.49.174.82/](http://10.49.174.82/) -w /usr/share/wordlists/dirb/common.txt -t 10</pre><p>This command throws a massive list of common directory names (the wordlist) at the web server to see what exists. The scan successfully uncovered two critical endpoints:</p><ul><li>/uploads — storing files</li><li>/panel — hidden web interface</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*Y7vzaUuPdgp5hq8NfBNN-w.png" /><figcaption>Figure 3.1 Gobuster (Part 1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*IgMnimkS-UNNpxsoyUqtYw.png" /><figcaption>Figure 3.2 hidden directory in Gobuster (Part 2)</figcaption></figure><h3>Phase 3: Getting a Foothold (File Upload Bypass)</h3><p>Navigating to the http://&lt;target_IP&gt;/panel directory revealed a file upload form. This immediately signals a potential <strong>Remote Code Execution (RCE)</strong> vector if we can upload a malicious script.</p><h4>The Payload:</h4><p>I opted for the classic PentestMonkey PHP Reverse Shell. To use this, you must edit the script to point back to your attack machine:</p><ul><li>Open the script and change the $ip variable to your TryHackMe VPN IP address.</li><li>Change the $port variable to a port of your choosing (for reference, I used <strong>7788</strong>).</li></ul><h4>Bypassing the Filter:</h4><p>When I attempted to upload the payload as shell.php, the server rejected it. The developers implemented a rudimentary extension filter to block .php files. However, Apache can be configured to execute PHP code under various extensions.</p><p>I renamed the file from shell.php to shell.phtml. The web application&#39;s filter didn&#39;t recognize .phtml as a threat and successfully allowed the upload. (❁´◡`❁)</p><h4>Catching the Shell:</h4><p>Before executing the payload, I set up a Netcat listener on my Kali machine to catch the incoming connection:</p><p>Set up a local Netcat listener on your machine to listen on port 7788:</p><pre>nc -lvnp 7788</pre><p>With the listener running, I navigated to the http://&lt;target_IP&gt;/uploads directory in my browser and clicked on my shell.phtml file. The web page hung, and my terminal instantly dropped into a shell. We now have access as the www-data user!</p><h4><strong>Capturing the First Flag:</strong></h4><p>To quickly find the user flag without manually digging through folders, I used the find command:</p><pre>find / -type f -name user.txt 2&gt;/dev/null</pre><blockquote><em>(Note: </em><em>2&gt;/dev/null hides all the &quot;Permission denied&quot; errors for a cleaner output).</em> Reading the file gave us our first flag: THM{y0u_g0t_a_sh3ll}.</blockquote><p>Then it will print out:</p><pre>cat /var/www/user.txt<br># Output: THM{y0u_g0t_a_sh3ll}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WevSdeCQdeVdFsHqHO4E5A.png" /><figcaption>Figure 4.1 Task 3: Getting a shell Answer</figcaption></figure><h3>Phase 4: Privilege Escalation</h3><p>We are in the system, but www-data is a low-privileged account. Our final goal is total system compromise (root access).</p><p>A common privilege escalation vector in Linux CTFs is exploiting misconfigured <strong>SUID (Set User ID)</strong> binaries. If a binary is owned by root and has the SUID bit set, any user who runs that binary executes it with root-level privileges.</p><h4><strong>Hunting for SUID Binaries:</strong></h4><p>I searched the entire file system for these specific files:Now that we are on the machine as www-data, we need to find a path to elevate to root. A good first step in Linux privilege escalation is looking for binary files with the SUID bit set (-perm -u=s).</p><p>Files with SUID set run with the privileges of the file’s owner (in this case, root), regardless of who runs them.</p><pre>find / -type f -user root -perm -u=s 2&gt;/dev/null</pre><blockquote>Scanning through the output, one binary immediately stood out as a massive security risk: /usr/bin/python. Python is a powerful interpreter; it should <em>never</em> have SUID root permissions natively.</blockquote><h4><strong>The Exploit:</strong></h4><p>Tell the privileged Python interpreter to spawn a new system shell. Because Python is running as root (due to the SUID bit), the shell it creates will also be root.</p><pre>python -c &#39;import os; os.execl(&quot;/bin/sh&quot;, &quot;sh&quot;, &quot;-p&quot;)&#39;</pre><p><em>The </em><em>-p flag is crucial here—it tells the new shell to preserve the elevated permissions it inherited, preventing the system from automatically dropping us back to a standard user.</em></p><h4><strong>whoami</strong></h4><p>I ran whoami to verify my identity:</p><pre>whoami<br># Output: root / trnmrls (my username)</pre><h3>Snagging root.txt</h3><p>To finish the room, I used the same find technique to locate the final flag:</p><pre>cat /root/root.txt<br># Output: THM{pr1v1l3g3_3sc4l4t10n}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_MkHx352sSyNgTfMTAqTw.png" /><figcaption>Figure 5.1 Task 4: Privilege escalation Answers</figcaption></figure><h3>Key Takeaways</h3><ol><li><strong>Extension Blacklisting is Flawed:</strong> Relying on simple blacklists (blocking just .php) is not enough. Secure file uploads require strict whitelisting, file renaming, and storing uploads outside the executable web root.</li><li><strong>SUID is Dangerous:</strong> Administrative tools and interpreters (like Python, Bash, or Vim) should never have SUID permissions enabled, as they can trivially be used to spawn root shells.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*RJY4RZVXd-dj0fps.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7ac38c3214b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>