Important information
Our challenges do NOT require any bruteforcing/directory fuzzing/massive amounts of traffic. Please practise hacking on our challenges manually.
Failure to abide by the rules will put you at risk of being restricted from using our free challenges.
This strict URL filter should prevent XSS, right?
Medium
Cross Site Scripting (XSS)
This one is pretty simple. One parameter is vulnerable, ?url=
. Can you get XSS to execute?
Completed the challenge?
You can browse the intended solution to this challenge below.
Solution
Solution: data:text/html,<iframe name="<svg onload=alert(document.domain)>" src=https://www.bugbountytraining.com/challenges/challenge-6.php?url=javascript:name>
When using the javascript pseudo scheme, if the returned value is a string, browsers will write it onto the page like document.write. This is why some bookmarklets have a void(0) at the end to prevent the results accidentally return a string.
Another thing to know is the window.name property persists even after navigation, and we can control this value.
So, we can assign window.name with a XSS payload in HTML, then use javascript:name so that it writes the payload onto the page.