๐Ÿงช DOM-Based XSS Lab (Home Page)


๐Ÿ“Œ Info

This lab contains a DOM-based cross-site scripting (XSS) vulnerability on the home page.

It uses jQuery's $() selector function to auto-scroll to a given post, whose title is passed via the location.hash property.


๐ŸŽฏ Goal

Deliver an exploit to the victim that calls the print() function in their browser.


โš ๏ธ Vulnerability

Example of normal usage:

<https://vulnerable-website.com/#post1>


๐Ÿ› ๏ธ Exploitation Steps

  1. Replace the post ID with a malicious payload:

    <https://vulnerable-website.com/#><img src=print()>
    
    

    โ†’ This demonstrates injection, but it is not enough for solving the lab.

  2. Since the lab requires delivering the exploit via the exploit server, we must embed the payload in an iframe.