Challenge 10: XSS bypass backslash escape
Table of Contents
Today's article should be somewhat similar and like a recap. Will look at how the XSS can be exploited in the HTML Before getting started, ensure your Kurukshetra lab is up and running. Feel free to refer back to the below link. Practical Hands-On Way to Learn XSS with Kurukshetra - Vulnerable App by Design You reached " XSS Challenge 10". Great to see your consistent progress. In the past article, we covered how the XSS vulnerability does not always need to be exploited using the same parameter. XSS can also be looked at in other parameters, which might depend on the param, or it can also be an appending parameter. Let's get started with XSS Challenge 10. Visit: http://localhost:8066 and ensure it’s accessible, then navigate to “ XSS Challenge 10“. Output: Feel free to experiment with your XSS ideas before going ahead with the next steps. Hope you have partially or successfully exploited it. In the above screenshot, I have keyed the text " ABC" in the input field. Let’s verify how the text is being reflected back in the HTTP response code. To do that, "Right-click" and select “ View Page Source”, then search for the inserted string “ ABC”. Injected text is being reflected back at the bottom of the page, and this time, it’s inserted between the HTML div tags with double quotes appended. Remember from the previous lessons, we can keep trying out the different XSS payloads, but at the same time need to gather the list of allowed characters as well which can help in crafting an XSS payload. Going ahead, will be trying out all the payloads and narrow down to the allowed characters. Payload 1 – Simple XSS Browser Output: Page Source – Output: Closely observing the closing " ", a “ ****” backslash is appended and turned the closing script to " <\/script>". This breaks the HTML syntax, as it’s expecting the closing script tag. The backslash escape is a technique used to prevent special characters from being interpreted as code in web applications. Currently, this application is using the same to block XSS attacks. The above technique is good when used in combination with multiple XSS prevention techniques. (i.e., Defense in Depth). Also, note that in the above case, the backslash “ ****” is only being appended to the slash in the closing script tag, not for any other special characters, which is an indication of poor XSS mitigation. 💡 TIP – 10 Try HTML tags that work without closing tags Yes, as mentioned in the heading. Not all HTML tags need to have a compulsory closing tag, and there are some HTML tags that work even if the closing tag is not provided. (say tag-based XSS payload
XSS Challenge
Kurukshetra XSS Challenge Page 10
Reflection of user input
Viewing the Page Source
Only a combination of single quotes is displayed
Broken HTML Syntax
About Slash-Escape
,