labs

Lab - 1: DOM-based open redirection

  • This lab contains a DOM-based open-redirection vulnerability. To solve this lab, exploit this vulnerability and redirect the victim to the exploit server.

  • Vulnerable script may be at /post?postId=1 page

<a
  href="#"
  onclick='returnUrl = /url=(https?:\/\/.+)/.exec(location); if(returnUrl)location.href = returnUrl[1];else location.href = "/"'
  >Back to Blog</a
>
https://0a6a008d033583b9c00962fb00c600c1.web-security-academy.net/post?postId=1&url=https://exploit-server.com#

  • This lab demonstrates DOM-based client-side cookie manipulation. To solve this lab, inject a cookie that will cause XSS on a different page and call the print() function. You will need to use the exploit server to direct the victim to the correct pages.

  • Vulnerable script may be at /post?postId=1 page

<script>
  document.cookie =
    "lastViewedProduct=" + window.location + "; SameSite=None; Secure";
</script>

In the exploit server body,


Lab - 3: DOM XSS using web messages (P)

  • Vuln JS script that was found

  • In exploit server body,


Lab - 4: DOM XSS using web messages and a JavaScript URL

  • Vulns JS script that was found

  • In exploit server body


Lab - 5: DOM XSS using web messages and JSON.parse

  • Vulns JS script

  • In exploit server body,


Lab - 6: Exploiting DOM clobbering to enable XSS

Last updated