Open Redirect

Example:

https://google.com/?redirect_to=https://gmail.google.com

Could change to:

https://google.com/?redirect_to=https://attacker.com

Keep an eye out for URL parameters that include certain names, such as url=, redirect=, next=, etc. In some cases, redirect parameters might be labled with just single characters, such as r= or u=.

When a user accesses to a resource with unauthenticated session, web applications uasually redirect user to login form url which contains the link of the resource as a url parameter. When the user logs in successfully, these applications use the url parameter to redirect user to the url which user attend to access in the begining. Thereforce, the open redirect vulnerability uasually occurs in login form.

Bypass payload:

Some applications do filter, whitelist or blacklist the redirect parameter before performs it.

Should fuzzing with all payloads in PayloadsAllTheThings

Fuzzing

Replace www.whitelisteddomain.tld from Open-Redirect-payloads.txt with a specific white listed domain in your test case

To do this simply modify the WHITELISTEDDOMAIN with value www.test.com to your test case URL.

WHITELISTEDDOMAIN="www.test.com" && sed 's/www.whitelisteddomain.tld/'"$WHITELISTEDDOMAIN"'/' Open-Redirect-payloads.txt > Open-Redirect-payloads-burp-"$WHITELISTEDDOMAIN".txt && echo "$WHITELISTEDDOMAIN" | awk -F. '{print "https://"$0"."$NF}' >> Open-Redirect-payloads-burp-"$WHITELISTEDDOMAIN".txt

Filter Bypass

Shopify login open redirect

Using a whitelisted domain or keyword

Using CRLF to bypass "javascript" blacklisted keyword

Using "//" to bypass "http" blacklisted keyword

Using "https:" to bypass "//" blacklisted keyword

Using "\/\/" to bypass "//" blacklisted keyword (Browsers see \/\/ as //)

Using "%E3%80%82" to bypass "." blacklisted character

Using null byte "%00" to bypass blacklist filter

Using parameter pollution

Using "@" character, browser will redirect to anything after the "@"

Creating folder as their domain

Host/Split Unicode Normalization

XSS from Open URL - If it's in a JS variable

XSS from data:// wrapper

XSS from javascript:// wrapper

Common injection parameters

References

https://book.hacktricks.xyz/pentesting-web/open-redirect https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Open%20Redirect https://pentester.land/cheatsheets/2018/11/02/open-redirect-cheatsheet.html

Last updated

Was this helpful?