<?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 Nikhil Bhandari on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Bhandari on Medium]]></description>
        <link>https://medium.com/@nikhilbwr34?source=rss-8ccea3eaaa68------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*33DqgnXHJVZY6Hdki7Okhw.jpeg</url>
            <title>Stories by Nikhil Bhandari on Medium</title>
            <link>https://medium.com/@nikhilbwr34?source=rss-8ccea3eaaa68------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 30 May 2026 17:34:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhilbwr34/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[PortSwigger Lab: Information disclosure in version control history]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-information-disclosure-in-version-control-history-8c69ddf0cfca?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c69ddf0cfca</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 08:24:41 GMT</pubDate>
            <atom:updated>2026-04-10T08:24:41.801Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*5jot5nWrfcfbvYSmmGVFTQ.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>Authentication bypass via information disclosure.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-in-version-control-history">Lab: Information disclosure in version control history | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*5jot5nWrfcfbvYSmmGVFTQ.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PrlwS1_tBLNwr27DtSYMIw.png" /></figure><p>Next, configure FoxyProxy to redirect the lab’s traffic to Burp Suite. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><p><strong>Step 3: Discover Content</strong></p><p>Open Burp Suite, go to the <strong>Target</strong> tab, and then click on <strong>Site map</strong>. There, you can see the lab’s URL. Right-click on it, select <strong>Engagement tools</strong>, and then choose <strong>Discover content</strong>. A new window will pop up; select <strong>Session is not running</strong>. It will start crawling the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Spp9a22zeXAaeTsxvjZb5g.png" /></figure><p>It will take some time to complete the crawling process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nr0MsThajFprgu7gs-pt0Q.png" /></figure><p>As this lab is related to version control, we’ll look for <strong>git</strong> or <strong>.git</strong>-related paths.</p><p><strong>Step 4: Exploring /.git content</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*37hG5JiG6uzujqmMWsEibw.png" /></figure><p>Once the crawling is completed, you will see a path named <strong>.git</strong>. We’ll explore that directory. Go to the address bar, add /.git, and press Enter.</p><p>You will see some files related to Git.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9PSUdYGw0a_6pJKglleQEA.png" /></figure><p>To analyze these files, we need to download a copy of the entire directory using the following command:</p><pre>wget -r https://0aef00d6038cfdc382dd38d3007d002e.web-security-academy.net/.git</pre><p>This will start downloading the entire content of .git to your Kali Linux system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBAX3ls8mLSZus1tGOUKBA.png" /></figure><p><em>Note: The URL may change due to inactivity, so you might need to start a new session. However, the steps remain the same.</em></p><p>Once the download is completed, navigate to the downloaded directory (e.g., &quot;0a8900ac0499438880ce7b2b001a00ae.web-security-academy.net&quot;) using the cd command.</p><p>Once you’re inside this directory, use:</p><pre>ls -al</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*88qBu4wfPZvciN7RpC7v0Q.png" /></figure><p>Once you’re inside this directory use “ls -al” to display the hidden files and folders. Once command is executed you’ll se .git folder. Navigate to that folder and once again execute “ls -al” command, you’ll see the following files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*xSo0CjS9BHuH0QZsJxmVfQ.png" /></figure><p>to display hidden files and folders. After executing the command, you will see the .git folder. Navigate to that folder and run ls -al again to view its contents.</p><p>Now, to read the contents of the config file you need to use an application called <a href="https://git-cola.github.io/">git-cola</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*GmEtog-fdDnpLcs6nquFJQ.png" /></figure><p>In the terminal, type:</p><pre>git-cola</pre><p>A window will pop up. Here, you will see two files: admin.conf and admin_panel.php. When you select admin.conf, you will see a line at the bottom containing &quot;ADMIN_PASSWORD&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CxUK4p2a5HP-J3mElnRYfA.png" /></figure><p>To view the previous commit of that file, go to <strong>Commit</strong> in the toolbar and click on <strong>Amend Last Commit</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*yOYS3IzRdGYWiEs05cGTKA.png" /></figure><p>You will see a previous version of admin.conf, which contains the admin password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*C6aQH7L70K4pWOsl1uQteA.png" /></figure><p>This is how we found the administrator password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*krDIUkasc0A-q14OAPRqVQ.png" /></figure><p>Using the found password, log in to the administrator account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0wQTOLVs7PdsLJexDMOx1g.png" /></figure><p>Once logged in, click on the <strong>Admin Panel</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gx91_LbthBdla1tnD-zrvg.png" /></figure><p>You will be redirected to the <strong>Users</strong> page, where you can see two users: <em>Weiner</em> and <em>Carlos</em>. To complete the lab, you need to delete <em>Carlos</em>.</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Sy2sEnYLVKxMvVR_54Gjw.png" /></figure><p>Once you delete <em>Carlos</em>, check your browser, and you will see the message:<br> <strong>“Congratulations, you have solved the lab.”</strong></p><p>That’s it! You’ve successfully solved the <strong>Information disclosure in version control history</strong> lab.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c69ddf0cfca" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-information-disclosure-in-version-control-history-8c69ddf0cfca">PortSwigger Lab: Information disclosure in version control history</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DNS Explained: The Backbone of How the Internet Communicates]]></title>
            <link>https://medium.com/@nikhilbwr34/dns-explained-the-backbone-of-how-the-internet-communicates-a783af40afe3?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/a783af40afe3</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 14:11:29 GMT</pubDate>
            <atom:updated>2026-03-15T14:11:29.414Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7ksiR0AyiEuHmd5Z5lWgw.png" /></figure><p>The <strong>Domain Name System (DNS)</strong> is a fundamental component of the internet that translates human-readable domain names into machine-readable IP addresses. When a user enters a website address such as example.com in a browser, the computer cannot directly understand the domain name. Instead, it must obtain the corresponding IP address of the server hosting that website. DNS performs this translation process, allowing users to access websites and services using easy-to-remember names instead of numerical IP addresses.</p><p>DNS works through a hierarchical and distributed system of servers. When a domain lookup is requested, the query typically passes through multiple layers of DNS infrastructure, including the root servers, top-level domain (TLD) servers, and authoritative name servers. Each layer helps guide the request toward the server that holds the correct record for the domain. Once the authoritative server returns the IP address, the resolver caches the result for a certain duration defined by the TTL (Time To Live) value, allowing future requests to be resolved more quickly.</p><p>Now lets learn more about the DNS Record</p><p>DNS servers store information in the form of <strong>DNS records</strong>, which define how a domain behaves on the internet. Each record contains specific instructions such as mapping a domain to an IP address, directing email servers, or creating domain aliases.</p><h3>Common DNS Record Types and its importance:</h3><h4>A Record (Address Record)</h4><p>The <strong>A record</strong> maps a domain name to an <strong>IPv4 address</strong>. When a user requests a domain, the DNS resolver uses the A record to find the corresponding server IP.</p><pre>example.com   3600   IN   A   192.0.2.1</pre><p>Key Components and Management</p><ul><li><strong>Time to Live (TTL):</strong> This value determines how long the record remains cached in the DNS table before it must be refreshed. For example, a TTL of 3600 indicates the record will stay active for 3600 seconds, or one hour.</li><li><strong>Migration Best Practices:</strong> When migrating an application or database server, a common issue is that the A record still points to the old IP address because the TTL has not yet expired. To avoid this, it is recommended to <strong>lower the TTL value</strong> to a few minutes or even 60 seconds before the migration. This allows for faster testing and ensures users are routed to the new IP address more quickly.</li></ul><p>Troubleshooting</p><p>If a website is completely unreachable or results in a <strong>“connection failed”</strong> error, it is often a sign of an <strong>A record issue</strong> or a problem with the underlying IP address. In scenarios where a change is “working for some people but not for others,” it may be that the TTL is too high, preventing the latest record from populating across the internet quickly.</p><h4>AAAA Record (IPv6 Address Record)</h4><p>The <strong>AAAA record</strong> performs the same function as an A record but maps the domain to an <strong>IPv6 address</strong> instead of IPv4.</p><pre>example.com   3600   IN   AAAA   2001:db8::1</pre><p>The relationship and key details regarding AAAA records include:</p><ul><li><strong>Transition to IPv6:</strong> As the availability of IPv4 addresses has become limited, the industry is gradually moving toward IPv6, making AAAA records increasingly prominent in DNS settings.</li><li><strong>Optional Status:</strong> Currently, the AAAA record is often considered optional, and you will find it less frequently than A records in many existing setups.</li><li><strong>Dual-Stack Environments:</strong> In environments using “dual stack” (supporting both IPv4 and IPv6), the system may be configured to prioritize IPv6. In this case, a request will first attempt to connect via the AAAA record before prioritizing the IPv4 A record.</li><li><strong>Performance and Latency:</strong> You must be careful when configuring these records. If a dual-stack environment is looking for an IPv6 address but the AAAA record is missing, the system will experience a “fallback” to IPv4. This search and subsequent fallback can add <strong>latency</strong> and cause performance slowness in user requests. So you have to decide whether you need to have IPv6 or not.</li></ul><h4>CNAME Record (Canonical Name Record)</h4><p>A <strong>CNAME record</strong> creates an <strong>alias for a domain</strong>, pointing one domain name to another domain name instead of an IP address.</p><pre>www.example.com   3600   IN   CNAME   example.com</pre><p>Key characteristics include:</p><ul><li><strong>Forwarding Requests:</strong> It effectively routes requests from one of your domains to another destination domain.</li><li><strong>Cloud Integration:</strong> It is used <strong>heavily in cloud environments</strong> for managing <strong>Content Delivery Networks (CDNs)</strong> and <strong>load balancers</strong>.</li><li><strong>Subdomain Requirement:</strong> A critical technical limitation is that you <strong>cannot use a root domain</strong> (e.g., example.com) as a CNAME record; it must be applied to a <strong>subdomain</strong> (e.g., <a href="http://www.example.com).">www.example.com).</a></li></ul><p>Troubleshooting</p><p>If CNAME records are <strong>messed up</strong> or <strong>mis-configured</strong>, it can lead to <strong>“domain not found”</strong> errors. This often happens if the mapping to backend load balancers is incorrect or has been changed without updating the DNS table. When troubleshooting these errors, it is vital to verify that all load balancers are correctly mapped to their respective CNAMEs.</p><h4>NS Record (Name Server Record)</h4><p>The <strong>NS record</strong> identifies the <strong>authoritative DNS servers</strong> responsible for handling DNS queries for a domain.</p><pre>example.com   3600   IN   NS   ns1.exampledns.com<br>example.com   3600   IN   NS   ns2.exampledns.com</pre><p>These servers contain the official DNS records for the domain.</p><p>Basically it tells Root Domain And Top Level Domain(TLD) where to go to find the IP Address.</p><p>The DNS system operates in a hierarchy, and the NS record is a critical link in this chain:</p><ul><li><strong>Routing Requests:</strong> When you type a URL, the request first hits a <strong>root domain</strong>. That root domain directs the request to a <strong>Top-Level Domain (TLD)</strong> (like .com or .org), which then uses the <strong>NS records</strong> to point the request toward the specific <strong>authorization server</strong> (also called a name server) that holds the domain’s IP address.</li><li><strong>Authoritative Servers:</strong> These servers are typically managed by providers like <strong>GoDaddy</strong> or <strong>AWS Route 53.</strong></li><li>TTL is usually high as you rarely change your NS record. Its updated when you migrate from one domain provider to another domain provider. During this period you have to wait around 48 hours or so.</li></ul><h4>SOA Record (Start of Authority)</h4><p>The <strong>SOA record</strong> contains administrative information about the DNS zone, including the primary name server, administrator contact, and zone update settings.</p><pre>example.com   3600   IN   SOA   ns1.exampledns.com admin.example.com (<br>                    2026031101 ; serial<br>                    7200       ; refresh<br>                    3600       ; retry<br>                    1209600    ; expire<br>                    3600 )     ; minimum TTL</pre><p>It helps DNS servers manage <strong>zone synchronization and updates</strong>.</p><p><strong>Key Data within a SOA Record</strong></p><ul><li><strong>Administrative Information:</strong> It includes the <strong>primary name server</strong> for the zone and the <strong>email address of the administrator</strong> (e.g., admin@example.com).</li><li><strong>Serial Number:</strong> This value acts as a <strong>version number</strong> for the DNS setup, helping to manage and track changes.</li><li><strong>Refresh and Retry Settings:</strong> These settings command how frequently the DNS table should be refreshed or retried if a refresh fails.</li><li><strong>Negative TTL:</strong> This specific feature determines how long the internet should “remember” that a record does not exist. For instance, if you are currently building a new subdomain (like new.example.com) that isn&#39;t live yet, a negative TTL of 24 hours tells the internet to stop looking for it for that duration before checking again.</li></ul><h4>TXT Record (Text Record)</h4><p>The <strong>TXT record</strong> stores text information associated with a domain. It is commonly used for <strong>verification and security mechanisms</strong> such as SPF, DKIM, and domain ownership verification.</p><pre>example.com   3600   IN   TXT   &quot;v=spf1 include:_spf.example.com ~all&quot;</pre><p>TXT records are widely used in email authentication and service validation.</p><p>Key Functions and Use Cases</p><ul><li><strong>Domain Verification:</strong> TXT records are frequently used to “legitimise” the use of third-party services on your domain. For example, if you want to integrate tools like <strong>Notion or Slack</strong>, these platforms will provide specific text entries for you to add to your DNS records to prove you own the domain.</li><li><strong>Email Authentication:</strong> This is one of the most critical uses for TXT records. By adding specific lines (such as <strong>SPF</strong> or <strong>DKIM</strong> records), you can authorize specific servers — like Google or Gmail servers — to send emails on your domain’s behalf.</li><li><strong>Security and Spam Prevention:</strong> These authentication records help prevent cyber threats and ensure your emails are recognized as legitimate rather than fraudulent.</li></ul><p>Troubleshooting</p><p>If you find that emails sent from your domain are consistently landing in <strong>spam folders</strong>, it is a primary sign that your TXT records are not configured correctly. In this scenario, you would need to check your DNS table to ensure you have mentioned the correct authorized servers to legitimize your outgoing mail.</p><h4>MX Record (Mail Exchange Record)</h4><p>The <strong>MX record</strong> specifies the <strong>mail server responsible for receiving emails</strong> for a domain.</p><pre>example.com   3600   IN   MX   10 mail.example.com</pre><p>The number <strong>10</strong> represents the <strong>priority</strong> of the mail server.</p><p>The most distinct feature of an MX record is its <strong>priority field</strong>. This integer value determines the order in which mail servers are used:</p><ul><li><strong>Lowest Priority First:</strong> Email is always sent to the server with the <strong>smallest numerical priority value</strong> (e.g., a priority of 1 is tried before a priority of 10).</li><li><strong>Redundancy and Backup:</strong> If the primary server (the one with the lowest priority) is offline or overwhelmed, the system automatically moves to the next highest priority server. This backup server may either deliver the mail directly or queue it until the primary server returns.</li><li><strong>Load Balancing:</strong> If multiple MX records are assigned the <strong>same priority</strong>, the email traffic is distributed evenly between those servers in a load-balanced fashion.</li><li><strong>Relative Values:</strong> Priority values are relative; for example, setting three servers at priorities 10, 20, and 30 functions exactly the same as setting them at 1, 2, and 3.</li></ul><h4>PTR Record (Pointer Record)</h4><p>A <strong>PTR (Pointer) record</strong> is used in <strong>reverse DNS lookups</strong>, where an IP address is mapped back to a domain name. While most DNS queries resolve a domain name to an IP address (using an <strong>A or AAAA record</strong>), PTR records perform the opposite function by resolving an IP address to its associated hostname.</p><pre>1.0.1.103.in-addr.arpa   3600   IN   PTR   www.example.com</pre><p><strong>Key features include:</strong></p><ul><li><strong>Reverse DNS Resolution</strong> — Converts an IP address into its corresponding domain name.</li><li><strong>Stored in Reverse Zones</strong> — Located under special domains like in-addr.arpa (IPv4) and ip6.arpa (IPv6).</li><li><strong>Email Server Verification</strong> — Commonly used by mail servers to verify the legitimacy of sending servers.</li><li><strong>Network Troubleshooting</strong> — Helps administrators identify hostnames from IP addresses in logs and monitoring systems.</li><li><strong>Managed by IP Owner</strong> — Typically configured by the ISP or the organization that owns the IP address block.</li></ul><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a783af40afe3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: Authentication bypass via information disclosure]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-authentication-bypass-via-information-disclosure-07cf62617c0a?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/07cf62617c0a</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 09:48:28 GMT</pubDate>
            <atom:updated>2025-04-04T09:48:28.112Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*d-J9XuMqdXVkIli9loJNBg.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>Authentication bypass via information disclosure.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-authentication-bypass">Lab: Authentication bypass via information disclosure</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*d-J9XuMqdXVkIli9loJNBg.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wlUoWMzPNTKw3mWMKXMYdg.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-6ZZe1TtX_fEtaZ-2bqxA.png" /></figure><p>Now open one of the product from the home page and capture its traffic</p><p><strong>Step 3: Sending Vulnerable Parameter to Repeater</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6ERtksyylT3a3CrGmLIaA.png" /></figure><p>Select the request and send it to the Repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aquS41fOWJPfmFsPhYcdCg.png" /></figure><p>Forward/Send the request sent to Repeater, we can see its gives Status Code of <strong>200 OK.</strong></p><p><strong>Step 4: Manipulating the Parameter</strong></p><p>Since we know there’s a <strong>custom HTTP header</strong>, the response reveals that the <strong>admin panel</strong> is accessible only if logged in as an administrator or if the request originates from a local IP.</p><p>Send the request again, but this time using the <strong>TRACE</strong> method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QvJEdJF-vIBR3AAr8aFgiA.png" /></figure><ul><li><strong>TRACE</strong> is a debugging method that <strong>should not be enabled in a production environment</strong>.</li><li>Notice that the <strong>X-Custom-IP-Authorization</strong> header (containing your IP) is automatically appended to the request. <em>(I’ve obfuscated my IP here for security reasons.)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnbZHyyI0arP8rXuROrL6Q.png" /></figure><p>Notice that the X-Custom-IP-Authorization header, containing your IP address, was automatically appended to your request. Thus i have obfuscated my IP here.</p><p>Now, send the <strong>TRACE request</strong> to <strong>Repeater</strong> again.</p><ul><li>Change <strong>TRACE</strong> to <strong>GET</strong>.</li><li>Copy the <strong>X-Custom-IP-Authorization</strong> header from the TRACE response.</li><li>Paste it in the <strong>GET request</strong> and set its value to <strong>127.0.0.1</strong> (loopback address).</li><li>Send the request, and you should now have <strong>admin access</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2PwlVapVFdYvnOUJUk1lg.png" /></figure><p>To confirm admin access, search for <strong>“admin”</strong> in the response tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5MXO-AmJ49BgsAsSu7rUQ.png" /></figure><p>As we have admin access we can visit admin panel by adding <strong>/admin</strong> in the GET request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0NyCgnNbL7NTJRdMnx6ow.png" /></figure><p>We get 200 OK Status with access to admin panel. So to delete the user carlos, lets first search for carlos in the response tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tIfm5FZTIDr-l5Wuc0e-g.png" /></figure><p>As we can see there’s a user named carlos. Now lets copy <strong>/admin/delete?username=carlos </strong>and paste it in the GET request to perform deletion.</p><p><strong>Step 5: Completing the Lab</strong></p><p>Now lets copy <strong>/admin/delete?username=carlos </strong>and paste it in the GET request and send the request to perform deletion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zR4Wk80cGHs7bkDBBQeHHw.png" /></figure><p>You’ll get <strong>302 Found</strong> status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkWnMZsTMyOFOCQrWqSMoQ.png" /></figure><p>Check your browser, and you’ll see the message:<br> <strong>“Congratulations, you have solved the lab.”</strong></p><p>That’s it! You’ve successfully solved the <strong>Authentication bypass via information disclosure</strong> lab.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07cf62617c0a" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-authentication-bypass-via-information-disclosure-07cf62617c0a">PortSwigger Lab: Authentication bypass via information disclosure</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: Source code disclosure via backup files]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-source-code-disclosure-via-backup-files-e2bf5949483a?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2bf5949483a</guid>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 09:46:31 GMT</pubDate>
            <atom:updated>2025-04-04T09:46:31.886Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7o1r7-z1mvwRaxba_RJjjA.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>Source Code disclosure via backup files.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-via-backup-files">Lab: Source code disclosure via backup files | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7o1r7-z1mvwRaxba_RJjjA.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nrv_xNg7jbYnjRJ8OP2FaA.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><p><strong>Step 3: Capturing and Crawling the website</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*b9H-aAvU6L6DdZrAKXLHnw.png" /></figure><p>If you have Burp Suite Pro, navigate to the <strong>Target</strong> tab, click on <strong>Site Map</strong>, locate the lab’s URL, right-click on it, select <strong>Engagement Tools</strong>, and then choose <strong>Discover Content</strong>. This will perform an in-depth crawl of the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*BGciObBynAZZHWmZYkB5Hw.png" /></figure><p>Click on <strong>Session is not running</strong>, and click <strong>Yes</strong> when a pop up appears which says , <em>“This url is outside current target scope. Are you sure you want to discover content?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*v5QshNRJBO8WGfFjkMCDmA.png" /></figure><p><strong>Step 4: Exploring the files</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*sa1RX-BLVtPohQyyItN7Aw.png" /></figure><p>As we can see, there’s a path named <strong>/backup</strong>, which seems relevant to our current lab. Let’s copy this path into the browser and explore it further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5jDG0zCIYB1fBJ9bm_PSg.png" /></figure><p>Here, we find a backup file containing Java source code. Let’s open it and examine its contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nt2OKW-AB0agrpH7QDpAvg.png" /></figure><p>Upon analyzing the source code, we discover a <strong>hard-coded password</strong> for a <strong>Postgres database</strong>.</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E12r1PRsbC143H_y8dXKLw.png" /></figure><p>Now, we’ll <strong>copy the </strong>hard-coded password from the ProductTemplate.java.bak.</p><ol><li>Go back to your lab’s homepage.</li><li>Click on <strong>“Submit Solution”</strong>.</li><li>Paste the copied hard-coded password.</li><li>Click <strong>OK</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFiH7e2qCA9Ge0kGOtIayQ.png" /></figure><p>Check your browser, and you’ll see the message:<br> <strong>“Congratulations, you have solved the lab.”</strong></p><p>That’s it! You’ve successfully solved the <strong>Source Code disclosure via backup files</strong> lab.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2bf5949483a" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-source-code-disclosure-via-backup-files-e2bf5949483a">PortSwigger Lab: Source code disclosure via backup files</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: Information disclosure on debug page]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-information-disclosure-on-debug-page-283feb79c5f5?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/283feb79c5f5</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 14:49:22 GMT</pubDate>
            <atom:updated>2025-03-28T17:25:29.198Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*eGHRHwT79jghVnLqqQ7eGA.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>Information disclosure on debug page.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-on-debug-page">Lab: Information disclosure on debug page | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*eGHRHwT79jghVnLqqQ7eGA.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZWTVSvZlUD3s3VNTe4J0YA.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*njwI8PokG8H6up5k.png" /></figure><p>In <strong>Burp Suite</strong>, navigate to the <strong>Proxy</strong> tab and select <strong>HTTP History</strong>. Click on <strong>Filter Settings</strong> and enable <strong>Images</strong> as shown above.</p><p><strong>Step 3: Capturing and Crawling the website</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJCeSyNo6_k1wcgQDfTlBw.png" /></figure><p>Once you access the lab, browse through a few pages while Burp Suite captures the requests and crawls the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*xaiR1ewNSiBhqb_klCPIEw.png" /></figure><p>If you have Burp Suite Pro, navigate to the <strong>Target</strong> tab, click on <strong>Site Map</strong>, locate the lab’s URL, right-click on it, select <strong>Engagement Tools</strong>, and then choose <strong>Discover Content</strong>. This will perform an in-depth crawl of the website. However, in this case, it won’t be necessary.</p><p><strong>Step 4: Exploring the Files</strong></p><p>On the left-hand side (LHS) of Burp Suite, you’ll see a list of files that were crawled. The <strong>cgi-bin</strong> directory looks interesting — let’s check it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*V5lM_696jy4AhcEqr_dzuQ.png" /></figure><p>Inside this folder, there’s a file named <strong>phpinfo.php</strong>, which could reveal valuable information. Right-click on it, select <strong>Copy URL</strong>, then paste the URL into your browser. This will display detailed information about the PHP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkMjPCRsrdvmkW78q6ufTg.png" /></figure><p>Now, press <strong>CTRL + F</strong> and search for “ <strong>SECRET_KEY ”</strong> to locate any sensitive information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypWcKRmRPU3fj55-pKnrhQ.png" /></figure><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgG9r6Eq5-MtMP0FWLZQLQ.png" /></figure><p>Now, we’ll <strong>copy the </strong>SECRET KEY from the phpinfo page.</p><ol><li>Go to the browser tab where the lab is open.</li><li>Click on <strong>“Submit Solution”</strong>.</li><li>Paste the copied SECRET KEY.</li><li>Click <strong>OK</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mm-DBItC17NCeQy9JlPMLw.png" /></figure><p>Check your browser, and you’ll see the message:<br> <strong>“Congratulations, you have solved the lab.”</strong></p><p>That’s it! You’ve successfully solved the <strong>Information Disclosure on Debug Page</strong> lab.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=283feb79c5f5" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-information-disclosure-on-debug-page-283feb79c5f5">PortSwigger Lab: Information disclosure on debug page</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: Information disclosure in error messages]]></title>
            <link>https://infosecwriteups.com/portswigger-lab-information-disclosure-in-error-messages-12b63dc64e07?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/12b63dc64e07</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[burpsuite]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Thu, 13 Mar 2025 12:20:59 GMT</pubDate>
            <atom:updated>2025-03-27T05:28:48.644Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*gLeU84M-D4GsX8CefVHjWA.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>Information disclosure in error messages.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-in-error-messages">Lab: Information disclosure in error messages | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*gLeU84M-D4GsX8CefVHjWA.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ro6XsN4ldYBigQKklL2aJg.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Aw4rpcUq9GTF0eZW.png" /></figure><p>In <strong>Burp Suite</strong>, navigate to the <strong>Proxy</strong> tab and select <strong>HTTP History</strong>. Click on <strong>Filter Settings</strong> and enable <strong>Images</strong> as shown above.</p><p><strong>Step 3: Sending Vulnerable Parameter to Repeater</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4KKPsLI9tTbyvnGROf_fA.png" /></figure><p>Observing the requests, we can see that /image?filename= is used to fetch images from the server directory. We&#39;ll manipulate this parameter by sending it to <strong>Burp Suite’s Repeater</strong>.</p><p><strong>Step 4: Manipulating the Parameter</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSRX0rmpnV3mk0Ue1tKSRQ.png" /></figure><p>The productId parameter interacts with the back-end, so we&#39;ll try manipulating it to induce an error.</p><p>Now, we’ll replace &#39;1&#39; with a <strong>single quote (</strong><strong>&#39;)</strong> in the productId parameter. Since the server <strong>does not expect this as a valid input</strong>, it may throw an error and potentially display <strong>sensitive information</strong>, especially if stack traces are enabled in the production environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2hgHmkO-4qrnMxdyepEIpg.png" /></figure><p>As expected, we receive a <strong>500 Internal Server Error</strong>, along with the <strong>Apache server version </strong>i.e. <strong><em>2.2.31</em></strong> in the response.</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfINCYAUdUt5BuBfUgpldA.png" /></figure><p>Now, we’ll <strong>copy the Apache server version</strong> from the error message.</p><ol><li>Go to the browser tab where the lab is open.</li><li>Click on <strong>“Submit Solution”</strong>.</li><li>Paste the copied server version.</li><li>Click <strong>OK</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HvHagLgLrEJQgXP_9sztg.png" /></figure><p>Check your browser, and you’ll see the message:<br> <strong>“Congratulations, you have solved the lab.”</strong></p><p>That’s it! You’ve successfully solved the <strong>Information Disclosure in Error Messages</strong> lab.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12b63dc64e07" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/portswigger-lab-information-disclosure-in-error-messages-12b63dc64e07">PortSwigger Lab: Information disclosure in error messages</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: File path traversal, validation of file extension with null byte bypass]]></title>
            <link>https://medium.com/@nikhilbwr34/portswigger-lab-file-path-traversal-validation-of-file-extension-with-null-byte-bypass-05517555036e?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/05517555036e</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Fri, 07 Mar 2025 09:31:22 GMT</pubDate>
            <atom:updated>2025-03-13T11:59:44.542Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*lEZAesuCAaCYT4ttD0TTwQ.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>File path traversal, validation of file extension with null byte bypass.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/file-path-traversal/lab-validate-file-extension-null-byte-bypass">Lab: File path traversal, validation of file extension with null byte bypass | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*lEZAesuCAaCYT4ttD0TTwQ.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TADoZ3WA4QRVVyNy4FhtLg.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Aw4rpcUq9GTF0eZW.png" /></figure><p>In <strong>Burp Suite</strong>, navigate to the <strong>Proxy</strong> tab and select <strong>HTTP History</strong>. Click on <strong>Filter Settings</strong> and enable <strong>Images</strong> as shown above.</p><p><strong>Step 3: Sending Vulnerable Parameter to Repeater</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OOZ2jgCFCSRtd1mIUcsi4g.png" /></figure><p>Observing the requests, we can see that /image?filename= is used to fetch images from the server directory. We&#39;ll manipulate this parameter by sending it to <strong>Burp Suite’s Repeater</strong>.</p><p><strong>Step 4: Manipulating the Parameter</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F2fRPSQaNXc8fOtgocsb1Q.png" /></figure><p>First, we attempt to retrieve sensitive file information using a relative path traversal:</p><pre>filename=../../../etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcB-3alHb02jBBE47AcjgQ.png" /></figure><p>Looking at the response, we see that it does not work. Instead, we receive a <strong>400 Bad Request</strong> error stating &quot;No such file&quot;.</p><p>Since traversal sequences are blocked, we’ll try using an <strong>absolute path</strong> instead:</p><pre>filename=/etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RtTzpcjiU3RM2Nke9B_Iaw.png" /></figure><p>However, we receive the same &quot;No such file&quot; error with <strong>400 Bad Request</strong>. This means we need to try a different approach.</p><p>As we know from the <strong>lab title</strong>, this challenge involves <strong>file extension validation</strong>, and we need to bypass it using a <strong>null byte injection</strong> technique.</p><h3>What is Null Byte Injection?</h3><p>Null byte injection is an <strong>active exploitation technique</strong> used to <strong>bypass file extension validation</strong> in web applications. It works by appending a <strong>URL-encoded null byte (</strong><strong>%00)</strong> to the user-supplied input. Many applications use <strong>string-based checks</strong> to enforce file extensions but rely on lower-level system calls (like open() in C), which <strong>stop processing at the null byte</strong>. This can trick the system into ignoring the enforced extension and accessing restricted files.</p><h3>Our Approach:</h3><p>To bypass the extension check and retrieve /etc/passwd, we&#39;ll use the following payload:</p><pre>../../../etc/passwd%00.png</pre><h3>Why This Works?</h3><ul><li>The application expects a <strong>.png</strong> file, but by appending %00.png, the <strong>sanity check sees</strong> it as a valid .png file.</li><li>However, at the system level, %00 acts as a <strong>string terminator</strong>, causing the system to <strong>ignore everything after it</strong> and process only ../../../etc/passwd.</li><li>This allows us to access the restricted system file while <strong>bypassing extension validation</strong>.</li></ul><p>Now, let’s test this in <strong>Burp Suite</strong>! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q63UdiFBn-4rKjuDc_15FQ.png" /></figure><p><strong>Voila! </strong>null byte bypass works! We receive a <strong>200 OK</strong> status in the Repeater, along with the contents of /etc/passwd.</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXGVFl1stzMuOjxxhvts9A.png" /></figure><p>Go back to your browser, and you’ll see the message:</p><p><em>“Congratulations, you have solved the lab.”</em></p><p>That’s it! You’ve successfully exploited the vulnerability using <strong>validation of file extension with null byte bypass.</strong></p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05517555036e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: File path traversal, validation of start of path]]></title>
            <link>https://medium.com/@nikhilbwr34/portswigger-lab-file-path-traversal-validation-of-start-of-path-43022f43df63?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/43022f43df63</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 16:18:07 GMT</pubDate>
            <atom:updated>2025-03-13T12:00:48.517Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*kWsqMHr-vVOKYeN50v8YRg.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>File path traversal, validation of start of path.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/file-path-traversal/lab-validate-start-of-path">Lab: File path traversal, validation of start of path | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*kWsqMHr-vVOKYeN50v8YRg.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPt21vriDQoBGWzqRuSZ2w.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Aw4rpcUq9GTF0eZW.png" /></figure><p>In <strong>Burp Suite</strong>, navigate to the <strong>Proxy</strong> tab and select <strong>HTTP History</strong>. Click on <strong>Filter Settings</strong> and enable <strong>Images</strong> as shown above.</p><p><strong>Step 3: Sending Vulnerable Parameter to Repeater</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H44sXp6lYmdwHwZMUdzVcA.png" /></figure><p>Observing the requests, we can see that /image?filename= is used to fetch images from the server directory. We&#39;ll manipulate this parameter by sending it to <strong>Burp Suite’s Repeater</strong>.</p><p><strong>Step 4: Manipulating the Parameter</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6tlvr3pYZN_oofg5vuo8A.png" /></figure><p>Compared to previous labs, we can see that the <strong>entire path</strong> where the image is stored is explicitly mentioned. This means our approach needs to be different.</p><p>Instead of using relative traversal sequences, we’ll try accessing the file directly using an <strong>absolute path</strong>:</p><pre>filename=/etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5wpF1WhXd-PNgTa1wB55NA.png" /></figure><p>However, we receive the same &quot;Missing parameter &#39;filename&#39;&quot; error with <strong>400 Bad Request</strong>. This means we need to try a different approach.</p><p>As we know, the original request already contains the <strong>full image path</strong>, such as:</p><pre>/var/www/images/2.jpg</pre><p>This means we can directly attempt to traverse directories using an <strong>absolute path-based approach</strong>.</p><p>To access /etc/passwd, we&#39;ll modify the filename parameter as follows:</p><pre>/var/www/images/../../../etc/passwd</pre><p>This traversal moves <strong>three levels up</strong> from /var/www/images/ to reach the root directory (/), allowing us to access /etc/passwd. Now, let&#39;s test this in Burp Suite!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sKvngHGN5jKfNf80trEY2Q.png" /></figure><p>Voila! 🎉 The absolute path-based approach <strong>works!</strong></p><p>Our payload successfully bypasses the restriction, and we receive a <strong>200 OK</strong> status in Burp Suite’s Repeater, along with the contents of /etc/passwd.</p><p>Now, let’s proceed to complete the lab!</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzv-0RE_cdumSDUEBSAEtQ.png" /></figure><p>Go back to your browser, and you’ll see the message:</p><p><em>“Congratulations, you have solved the lab.”</em></p><p>That’s it! You’ve successfully exploited the vulnerability using <strong>absolute path-based approach.</strong></p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43022f43df63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: File path traversal, traversal sequences stripped non-recursively]]></title>
            <link>https://medium.com/@nikhilbwr34/portswigger-lab-file-path-traversal-traversal-sequences-stripped-non-recursively-624d8562f742?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/624d8562f742</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[burpsuite]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 15:23:15 GMT</pubDate>
            <atom:updated>2025-03-13T12:01:03.099Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ny2ryYyGiO_dW8gfrcdkPQ.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>File path traversal, traversal sequences stripped non-recursively.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/file-path-traversal/lab-sequences-stripped-non-recursively">Lab: File path traversal, traversal sequences stripped non-recursively | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ny2ryYyGiO_dW8gfrcdkPQ.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6i8jDh5LgrU5n-TgWAMhow.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Aw4rpcUq9GTF0eZW.png" /></figure><p>In <strong>Burp Suite</strong>, navigate to the <strong>Proxy</strong> tab and select <strong>HTTP History</strong>. Click on <strong>Filter Settings</strong> and enable <strong>Images</strong> as shown above.</p><p><strong>Step 3: Sending Vulnerable Parameter to Repeater</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvEbnQrXsiO1xzo_gETjxQ.png" /></figure><p>Observing the requests, we can see that /image?filename= is used to fetch images from the server directory. We&#39;ll manipulate this parameter by sending it to <strong>Burp Suite’s Repeater</strong>.</p><p><strong>Step 4: Manipulating the Parameter</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29b4kXDByJMYhR8oTU0dwg.png" /></figure><p>First, we attempt to retrieve sensitive file information using a relative path traversal:</p><pre>filename=../../../etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-X___UINnRraMxr3p9EGA.png" /></figure><p>Looking at the response, we see that it does not work. Instead, we receive a <strong>400 Bad Request</strong> error stating &quot;No such file&quot;.</p><p>Since traversal sequences are blocked, we’ll try using an <strong>absolute path</strong> instead:</p><pre>filename=/etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4HqIjWsBpdXn-0p_YSVnsw.png" /></figure><p>However, we receive the same &quot;No such file&quot; error with <strong>400 Bad Request</strong>. This means we need to try a different approach.</p><p>The application removes path traversal sequences before processing the filename parameter, but it does so <strong>non-recursively</strong> — meaning it strips ../ only once without re-evaluating the modified input.</p><p>To bypass this, we use an obfuscated payload:</p><pre>....//....//....//etc/passwd</pre><h4>Why This Works?</h4><ul><li>The application <strong>detects and removes</strong> ../, but ....// does not match exactly, allowing it to slip through.</li><li>Since filtering is <strong>non-recursive</strong>, parts of the traversal sequence remain intact after initial stripping.</li><li>Many file systems treat // as a single /, making ....// effectively behave like ../.</li></ul><p>Now, let’s test this in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kU3wzmImnMAPwuCww2Xz-w.png" /></figure><p><strong>Voila! </strong>Obfuscated payload works! We receive a <strong>200 OK</strong> status in the Repeater, along with the contents of /etc/passwd.</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBTkKCqnLgsp8S3hON_dpA.png" /></figure><p>Go back to your browser, and you’ll see the message:</p><p><em>“Congratulations, you have solved the lab.”</em></p><p>That’s it! You’ve successfully exploited the vulnerability using a <strong>non-recursive traversal bypass technique</strong>.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=624d8562f742" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger Lab: File path traversal, traversal sequences stripped with superfluous URL-decode]]></title>
            <link>https://medium.com/@nikhilbwr34/portswigger-lab-file-path-traversal-traversal-sequences-stripped-with-superfluous-url-decode-99920ab68298?source=rss-8ccea3eaaa68------2</link>
            <guid isPermaLink="false">https://medium.com/p/99920ab68298</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[burpsuite]]></category>
            <dc:creator><![CDATA[Nikhil Bhandari]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 10:47:00 GMT</pubDate>
            <atom:updated>2025-03-13T12:01:19.185Z</atom:updated>
            <content:encoded><![CDATA[<h4>PortSwigger Web Security Academy Series</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*BiGz4j8nXdqQIlURUBRiLg.png" /></figure><p>Hello everyone! Nikhil Bhandari here. Today, I’ll be sharing a step-by-step guide on how to solve the PortSwigger Lab: <em>File path traversal, traversal sequences stripped with superfluous URL-decode.</em></p><p>To access this lab, you’ll need to create a PortSwigger account. Once you’re logged in, you can access the lab using the link below:</p><p><a href="https://portswigger.net/web-security/file-path-traversal/lab-superfluous-url-decode">Lab: File path traversal, traversal sequences stripped with superfluous URL-decode | Web Security Academy</a></p><p>So, let’s get started!</p><p><strong>Step 1: Accessing the Lab</strong></p><p>First, click on the <strong>Access Lab</strong> button. A new tab will open, where the lab environment will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*BiGz4j8nXdqQIlURUBRiLg.png" /></figure><p><strong>Step 2: Setting Up FoxyProxy and Burp Suite</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QnOKAeu3f6pB0Yj4nrVnyg.png" /></figure><p>Next, configure <strong>FoxyProxy</strong> to redirect the lab’s traffic to <strong>Burp Suite</strong>. Once configured, refresh the page in your browser to start capturing traffic in Burp Suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jrQMQddAgiiRWdC6pxWQJw.png" /></figure><p>In <strong>Burp Suite</strong>, navigate to the <strong>Proxy</strong> tab and select <strong>HTTP History</strong>. Click on <strong>Filter Settings</strong> and enable <strong>Images</strong> as shown above.</p><p><strong>Step 3: Sending Vulnerable Parameter to Repeater</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JrQgzc7MGiG-oVVIknnMzw.png" /></figure><p>Observing the requests, we can see that /image?filename= is used to fetch images from the server directory. We&#39;ll manipulate this parameter by sending it to <strong>Burp Suite’s Repeater</strong>.</p><p><strong>Step 4: Manipulating the Parameter</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SxHQtzK13-FhJKyG1ipACA.png" /></figure><p>First, we attempt to retrieve sensitive file information using a relative path traversal:</p><pre>filename=../../../etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SyN5Sa-QcvKupcLwKqlZwA.png" /></figure><p>Looking at the response, we see that it does not work. Instead, we receive a <strong>400 Bad Request</strong> error stating &quot;No such file&quot;.</p><p>Since traversal sequences are blocked, we’ll try using an <strong>absolute path</strong> instead:</p><pre>filename=/etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK5CCSSTlwn99eo6WQhNWA.png" /></figure><p>However, we receive the same &quot;No such file&quot; error with <strong>400 Bad Request</strong>. This means we need to try a different approach.</p><p>Now, we attempt <strong>URL encoding</strong> using our first payload: we’ll try url encoding using the 1st payload:</p><pre>../../../etc/passwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFEdMzdecX2pn0Ry_z5egw.png" /></figure><p>To URL-encode it in Burp Suite:</p><ul><li>Select the payload ../../../etc/passwd</li><li>Right-click → <strong>Convert Selection</strong> → <strong>URL</strong> → <strong>URL-Encode all characters</strong></li><li>Alternatively, press <strong>Ctrl + U</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcLVz0TUjsfCyK4CW6ye5w.png" /></figure><p>Even after URL encoding, we still get the same <strong>400 Bad Request</strong> error.</p><p>Since the server is stripping traversal sequences after decoding once, we try <strong>double URL encoding</strong>:</p><ol><li>Take the already URL-encoded payload.</li><li>Encode it <strong>again</strong> using the same method.</li></ol><p>This ensures the server decodes it twice, allowing the traversal sequences to bypass the filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeDRRD-aJJHKuWMojz13Lw.png" /></figure><p>Let’s send the double-encoded request and check the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jEr5PjnZ0ijhwQp0YPXFaQ.png" /></figure><p><strong>Voila! </strong>Double encoding our payload works! We receive a <strong>200 OK</strong> status in the Repeater, along with the contents of /etc/passwd.</p><p><strong>Step 5: Completing the Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGP0fAiYlmnrYAb5HGyWVA.png" /></figure><p>Go back to your browser, and you’ll see the message:</p><p><em>“Congratulations, you have solved the lab.”</em></p><p>That’s it! You’ve successfully bypassed the restriction using traversal sequences stripped with superfluous URL-decode.</p><p><strong>Thank you for taking the time to read my article!</strong><br>I hope you found it informative and valuable. If you enjoyed it, please consider <strong>liking</strong> the article, <strong>following</strong> me for more content, and <strong>sharing</strong> it with others who might benefit from it. Your support means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99920ab68298" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>