27.4 Lab: DOM-based open redirection

This lab contain s a DOM-based open-redirection vulnerability. To solve this lab, exploit this vulnerability and redirect the victim to the exploit server | Karthikeyan Nagaraj

Karthikeyan Nagaraj
2 min readJun 4, 2024

Description

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

Solution

  1. The blog post page contains the following link, which returns to the home page of the blog
    <a href='#' onclick='returnURL' = /url=https?:\/\/.+)/.exec(location); if(returnUrl)location.href = returnUrl[1];else location.href = "/"'>Back to Blog</a>
  2. The url parameter contains an open redirection vulnerability that allows you to change where the "Back to Blog" link takes the user. To solve the lab, construct and visit the following URL, remembering to change the URL to contain your lab ID and your exploit server ID:
    https://YOUR-LAB-ID.web-security-academy.net/post?postId=4&url=https://YOUR-EX

--

--

Karthikeyan Nagaraj

Security Researcher | Bug Hunter | Web Pentester | CTF Player | TryHackme Top 1% | AI Researcher | Blockchain Developer