Member-only story
Introduction
I think XSS is a wonderful type of exploit, we can do many things with it but exploiting it is not always easy. A lot of vulnerabilities are still missed every day because the wrong attack vector was used. In this article, I want to present you with a path to follow that will walk you through a short piece of theory before sending you off to my labs to give it a shot and actually apply what you learned. If you enjoyed this article, I would really appreciate it if you share it with someone that could use it.
What is XSS?
XSS or Cross-Site Scripting is a vulnerability that can occur because developers do not sanitize user input properly. This may result in the user being able to insert a script into the webpage which executes with varying degrees of impact.
You may notice I have not talked about JS yet until this point and this is because XSS can occur in any scripting language such as ASP or the infamous Flash (which arguably had more holes than Swiss cheese). However, JS is by far the most used scripting language so XSS vulnerabilities are found more in the JS scripting language.
Let’s look at a small example, this website takes user input and displays it directly on the page:
<?php
if(isset($_GET['q'])){
echo $_GET['q'];
}
?>