repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
index.mdMarkdown195 lines8.2 KiBsource raw download

title: "Open URL Redirect" topic: "Open Redirect" topicSlug: "open-redirect" sourcePath: "Open Redirect/README.md" sourceUrl: "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/3ac27901c711/Open%20Redirect/README.md" sha: "3ac27901c711" isReadme: true#

Open URL Redirect#

Un-validated redirects and forwards are possible when a web application accepts untrusted input that could cause the web application to redirect the request to a URL contained within untrusted input. By modifying untrusted URL input to a malicious site, an attacker may successfully launch a phishing scam and steal user credentials. Because the server name in the modified link is identical to the original site, phishing attempts may have a more trustworthy appearance. Un-validated redirect and forward attacks can also be used to maliciously craft a URL that would pass the application’s access control check and then forward the attacker to privileged functions that they would normally not be able to access.

Summary#

Methodology#

An open redirect vulnerability occurs when a web application or server uses unvalidated, user-supplied input to redirect users to other sites. This can allow an attacker to craft a link to the vulnerable site which redirects to a malicious site of their choosing.

Attackers can leverage this vulnerability in phishing campaigns, session theft, or forcing a user to perform an action without their consent.

Example: A web application has a feature that allows users to click on a link and be automatically redirected to a saved preferred homepage. This might be implemented like so:

https://example.com/redirect?url=https://userpreferredsite.com

An attacker could exploit an open redirect here by replacing the userpreferredsite.com with a link to a malicious website. They could then distribute this link in a phishing email or on another website. When users click the link, they're taken to the malicious website.

HTTP Redirection Status Code#

HTTP Redirection status codes, those starting with 3, indicate that the client must take additional action to complete the request. Here are some of the most common ones:

Redirect Methods#

Path-based Redirects#

Instead of query parameters, redirection logic may rely on the path:

JavaScript-based Redirects#

If the application uses JavaScript for redirects, attackers may manipulate script variables:

Example:

var redirectTo = "http://trusted.com";
window.location = redirectTo;

Payload: ?redirectTo=http://malicious.com

Common Query Parameters#

?checkout_url={payload}
?continue={payload}
?dest={payload}
?destination={payload}
?go={payload}
?image_url={payload}
?next={payload}
?redir={payload}
?redirect_uri={payload}
?redirect_url={payload}
?redirect={payload}
?return_path={payload}
?return_to={payload}
?return={payload}
?returnTo={payload}
?rurl={payload}
?target={payload}
?url={payload}
?view={payload}
/{payload}
/redirect/{payload}

Filter Bypass#

Labs#

References#