This lab contains a simple vulnerability in the search functionality.
To solve the lab, perform a cross-site scripting attack that calls the alert
function.
After accessing the lab, I immediately noticed a search functionality that takes user input. To test for XSS vulnerabilities, I started with some basic HTML tag injection to observe any abnormal output.
First, I injected a payload that displays the word "hacker" in bold:
The response was:
0 search results for 'hacker'
This indicated that my HTML tag worked, suggesting that the input isn't sanitized. Based on this, I proceeded to inject a script payload to pop an alert:
When I submitted this payload, I received the alert, confirming the XSS vulnerability. With that, the lab was solved.