Account Takeover
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Authorization Issue
๊ณ์ ์ ์ด๋ฉ์ผ์ ๋ณ๊ฒฝํ๋ ค ์๋ํ๊ณ , ํ์ธ ํ๋ก์ธ์ค๋ฅผ ๋ฐ๋์ ๊ฒ์ฌํด์ผ ํฉ๋๋ค. ํ์ธ ์ ์ฐจ๊ฐ ์ทจ์ฝํ ๊ฒฝ์ฐ, ์ด๋ฉ์ผ์ ๋์ ํผํด์์ ๊ฒ์ผ๋ก ๋ณ๊ฒฝํ ๋ค ํ์ธ์ ์๋ฃํ์ธ์.
Unicode Normalization Issue
- ๋์ ํผํด์์ ๊ณ์
victim@gmail.com - Unicode\๋ฅผ ์ฌ์ฉํด ๊ณ์ ์ ์์ฑํฉ๋๋ค. ์:
viฤtim@gmail.com
As explained in this talk, the previous attack could also be done abusing third party identity providers:
- Create an account in the third party identity with similar email to the victim using some unicode character (
viฤtim@company.com). - The third party provider shouldnโt verify the email
- If the identity provider verifies the email, maybe you can attack the domain part like:
victim@ฤompany.comand register that domain and hope that the identity provider generates the ascii version of the domain while the victim platform normalize the domain name. - Login via this identity provider in the victim platform who should normalize the unicode character and allow you to access the victim account.
For further details, refer to the document on Unicode Normalization:
Reusing Reset Token
๋์ ์์คํ
์ด reset link๋ฅผ ์ฌ์ฌ์ฉ ํ์ฉํ๋ฉด, gau, wayback, scan.io ๊ฐ์ ๋๊ตฌ๋ฅผ ์ฌ์ฉํด ๋ ๋ง์ reset ๋งํฌ๋ฅผ ์ฐพ์ผ๋ ค ๋
ธ๋ ฅํด์ผ ํฉ๋๋ค.
Pre Account Takeover
- ํผํด์์ ์ด๋ฉ์ผ์ ์ฌ์ฉํด ํ๋ซํผ์ ๊ฐ์ ํ๊ณ ๋น๋ฐ๋ฒํธ๋ฅผ ์ค์ ํฉ๋๋ค(๊ฐ๋ฅํ๋ค๋ฉด ํ์ธ ์๋๋ ํด๋ณด๋, ํผํด์์ ์ด๋ฉ์ผ ์ ๊ทผ ๊ถํ์ด ์์ผ๋ฉด ๋ถ๊ฐ๋ฅํ ์ ์์ต๋๋ค).
- ํผํด์๊ฐ OAuth๋ก ๊ฐ์ ํ๊ณ ๊ณ์ ์ ํ์ธํ ๋๊น์ง ๊ธฐ๋ค๋ฆฝ๋๋ค.
- ์ผ๋ฐ ๊ฐ์ ์ด ํ์ธ๋๋ฉด ํผํด์ ๊ณ์ ์ ์ ๊ทผํ ์ ์๊ฒ ๋๊ธฐ๋ฅผ ๊ธฐ๋ํฉ๋๋ค.
CORS Misconfiguration to Account Takeover
ํ์ด์ง์ CORS misconfigurations๊ฐ ์์ผ๋ฉด ์ฌ์ฉ์์ ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ํ์ทจํ์ฌ ๊ณ์ ์ takeoverํ๊ฑฐ๋ ๋์ผํ ๋ชฉ์ ์ ์ํด ์ธ์ฆ ์ ๋ณด๋ฅผ ๋ณ๊ฒฝํ๊ฒ ํ ์ ์์ต๋๋ค:
CORS - Misconfigurations & Bypass
Csrf to Account Takeover
ํ์ด์ง๊ฐ CSRF์ ์ทจ์ฝํ๋ฉด ์ฌ์ฉ์๊ฐ ์์ ์ ๋น๋ฐ๋ฒํธ, ์ด๋ฉ์ผ ๋๋ ์ธ์ฆ ์ ๋ณด๋ฅผ ๋ณ๊ฒฝํ๊ฒ ๋ง๋ค์ด ์ดํ์ ์ ๊ทผํ ์ ์์ต๋๋ค:
CSRF (Cross Site Request Forgery)
XSS to Account Takeover
์ ํ๋ฆฌ์ผ์ด์ ์์ XSS๋ฅผ ๋ฐ๊ฒฌํ๋ฉด ์ฟ ํค, local storage, ๋๋ ์น ํ์ด์ง์ ์ ๋ณด๋ฅผ ํ์ทจํ์ฌ ๊ณ์ ์ takeoverํ ์ ์์ต๋๋ค:
- Attribute-only reflected payloads on login pages can hook
document.onkeypress, exfiltrate keystrokes throughnew Image().src, and steal credentials without submitting the form. See Attribute-only login XSS behind WAFs for a practical workflow.
Same Origin + Cookies
์ ํ์ ์ธ XSS๋ ์๋ธ๋๋ฉ์ธ takeover๋ฅผ ๋ฐ๊ฒฌํ๋ฉด cookies๋ฅผ ์กฐ์(์: fixating)ํ์ฌ ํผํด์ ๊ณ์ ์ ์นจํดํ๋ ค ์๋ํ ์ ์์ต๋๋ค:
Attacking Password Reset Mechanism
Reset/Forgotten Password Bypass
Security-question resets that trust client-supplied usernames
If an โupdate security questionsโ flow takes a username parameter even though the caller is already authenticated, you can overwrite any accountโs recovery data (including admins) because the backend typically runs UPDATE ... WHERE user_name = ? with your untrusted value. The pattern is:
- Log in with a throwaway user and capture the session cookie.
- Submit the victim username plus new answers via the reset form.
- Immediately authenticate through the security-question login endpoint using the answers you just injected to inherit the victimโs privileges.
POST /reset.php HTTP/1.1
Host: file.era.htb
Cookie: PHPSESSID=<low-priv>
Content-Type: application/x-www-form-urlencoded
username=admin_ef01cab31aa&new_answer1=A&new_answer2=B&new_answer3=C
Anything gated by the victimโs $_SESSION context (admin dashboards, dangerous stream-wrapper features, etc.) is now exposed without touching the real answers.
Enumerated usernames can then be targeted via the overwrite technique above or reused against ancillary services (FTP/SSH password spraying).
Response Manipulation
์ธ์ฆ ์๋ต์ ๋จ์ํ ๋ถ๋ฆฌ์ธ์ผ๋ก ์ถ์ํ ์ ์๋ค๋ฉด, false๋ฅผ true๋ก ๋ณ๊ฒฝํด๋ณด๊ณ ์ ๊ทผ์ด ๋๋์ง ํ์ธํ๋ผ.
OAuth to Account takeover
Host Header Injection
- password reset ์์ฒญ์ ์์ํ ํ Host ํค๋๊ฐ ์์ ๋๋ค.
X-Forwarded-Forํ๋ก์ ํค๋๊ฐattacker.com์ผ๋ก ๋ณ๊ฒฝ๋๋ค.- Host, Referrer, Origin ํค๋๋ฅผ ๋์์
attacker.com์ผ๋ก ๋ณ๊ฒฝํ๋ค. - password reset์ ์์ํ ๋ค์ ๋ฉ์ผ ์ฌ์ ์ก์ ์ ํํ๋ฉด ์์ ์ธ๊ธํ ์ธ ๊ฐ์ง ๋ฐฉ๋ฒ์ด ๋ชจ๋ ์ฌ์ฉ๋๋ค.
Response Manipulation
- Code Manipulation: ์ํ ์ฝ๋๋ฅผ
200 OK๋ก ๋ณ๊ฒฝํ๋ค. - Code and Body Manipulation:
- ์ํ ์ฝ๋๋ฅผ
200 OK๋ก ๋ณ๊ฒฝํ๋ค. - ์๋ต ๋ณธ๋ฌธ์
{"success":true}๋๋ ๋น ๊ฐ์ฒด{}๋ก ์์ ํ๋ค.
์ด๋ฌํ manipulation ๊ธฐ๋ฒ์ JSON์ด ๋ฐ์ดํฐ ์ ์ก ๋ฐ ์์ ์ ์ฌ์ฉ๋๋ ๊ฒฝ์ฐ์ ํจ๊ณผ์ ์ด๋ค.
Change email of current session
From this report:
- ๊ณต๊ฒฉ์๊ฐ ์์ ์ ์ด๋ฉ์ผ์ ์ ์ฃผ์๋ก ๋ณ๊ฒฝ ์์ฒญํ๋ค
- ๊ณต๊ฒฉ์๋ ์ด๋ฉ์ผ ๋ณ๊ฒฝ ํ์ธ ๋งํฌ๋ฅผ ๋ฐ๋๋ค
- ๊ณต๊ฒฉ์๋ ๊ทธ ๋งํฌ๋ฅผ ํผํด์์๊ฒ ๋ณด๋ด๊ณ ํผํด์๊ฐ ํด๋ฆญํ๊ฒ ํ๋ค
- ํผํด์์ ์ด๋ฉ์ผ์ด ๊ณต๊ฒฉ์๊ฐ ์ง์ ํ ์ฃผ์๋ก ๋ณ๊ฒฝ๋๋ค
- ์ด ๊ณต๊ฒฉ์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณต๊ตฌํ๊ฑฐ๋ ๊ณ์ ์ ํ์ทจํ ์ ์๊ฒ ํ๋ค
This also happened in this report.
Bypass email verification for Account Takeover
- ๊ณต๊ฒฉ์๊ฐ attacker@test.com์ผ๋ก ๋ก๊ทธ์ธํ๊ณ ๊ฐ์ ์ ์ด๋ฉ์ผ์ ๊ฒ์ฆํ๋ค.
- ๊ณต๊ฒฉ์๊ฐ ๊ฒ์ฆ๋ ์ด๋ฉ์ผ์ victim@test.com์ผ๋ก ๋ณ๊ฒฝํ๋ค(์ด๋ฉ์ผ ๋ณ๊ฒฝ์ ๋ํ ์ถ๊ฐ ๊ฒ์ฆ ์์)
- ์ด์ ์ฌ์ดํธ๋ victim@test.com์ผ๋ก ๋ก๊ทธ์ธ์ ํ์ฉํ๋ฉฐ ํผํด์์ ์ด๋ฉ์ผ ๊ฒ์ฆ์ ์ฐํํ๊ฒ ๋๋ค.
Old Cookies
As explained in this post, ํ ๊ณ์ ์ ๋ก๊ทธ์ธํด ์ธ์ฆ๋ ์ฌ์ฉ์๋ก์ ์ฟ ํค๋ฅผ ์ ์ฅํ๊ณ ๋ก๊ทธ์์ํ ๋ค์ ๋ค์ ๋ก๊ทธ์ธํ ์ ์์๋ค.
์ ๋ก๊ทธ์ธ์์๋ ๋ค๋ฅธ ์ฟ ํค๊ฐ ์์ฑ๋ ์ ์์์๋ ๋ถ๊ตฌํ๊ณ ์ด์ ์ฟ ํค๊ฐ ๋ค์ ์๋ํ๊ฒ ๋์๋ค.
Trusted device cookies + batch API leakage
๋ณต๊ตฌ๋ฅผ ์ํํ๋ ์ฅ๊ธฐ ์ ์ง ์ฅ์น ์๋ณ์(long-lived device identifiers)๋ batch API๊ฐ ์ฝ์ ์ ์๋ ํ์ ์๋ต์ ์ฐ๊ธฐ ๊ฐ๋ฅํ ์ฑํฌ๋ก ๋ณต์ฌํ๊ฒ ํ์ฉํ ๋ ๋๋๋ ์ ์๋ค.
- ๋ณต๊ตฌ ์ฒดํฌ๋ฅผ ์ํํ๋ ๋ฐ ์ฌ์ฉ๋๋ trusted-device cookie (
SameSite=None, long-lived)๋ฅผ ์๋ณํ๋ค. - ํด๋น ์ฅ์น ID๋ฅผ JSON์ผ๋ก ๋ฐํํ์ง๋ง(์: OAuth
code๊ตํ์ดmachine_id๋ฅผ ๋ฐํ) cross-origin์์ ์ฝ์ ์ ์๋ first-party endpoint๋ฅผ ์ฐพ๋๋ค. - ์ด์ ํ์์๋ต์ ์ฐธ์กฐ(
{result=name:$.path})ํ๊ณ ์ด๋ฅผ ๊ณต๊ฒฉ์์๊ฒ ๋ณด์ด๋ ์ฑํฌ(ํ์ด์ง post, upload-by-URL ๋ฑ)์ ์ธ ์ ์๊ฒ ํ๋ batch/chained API๋ฅผ ์ด์ฉํ๋ค. Example with Facebook Graph API:
POST https://graph.facebook.com/
batch=[
{"method":"post","omit_response_on_success":0,"relative_url":"/oauth/access_token?client_id=APP_ID%26redirect_uri=REDIRECT_URI","body":"code=SINGLE_USE_CODE","name":"leaker"},
{"method":"post","relative_url":"PAGE_ID/posts","body":"message={result=leaker:$.machine_id}"}
]
access_token=PAGE_ACCESS_TOKEN&method=post
- ์จ๊ฒจ์ง
<iframe>์ batch URL์ ๋ก๋ํ์ฌ ํผํด์๊ฐ trusted-device cookie๋ฅผ ์ ์กํ๊ฒ ํจ; JSON-path ์ฐธ์กฐ๊ฐ ํ์ด์ง์์ OAuth ์๋ต์ ์ฝ์ ์ ์์์๋ ๋ถ๊ตฌํ๊ณmachine_id๋ฅผ attacker-controlled post๋ก ๋ณต์ฌํจ. - Replay: ๋๋๋นํ device cookie๋ฅผ ์ ์ธ์ ์ ์ค์ . Recovery๋ ์ด์ ๋ธ๋ผ์ฐ์ ๋ฅผ trusted๋ก ์ทจ๊ธํ์ฌ ์ข ์ข ๋ ์ฝํ โno email/phoneโ ํ๋ก์ฐ(์: automated document upload)๋ฅผ ๋ ธ์ถ์ํค๋ฉฐ password๋ 2FA ์์ด attacker email์ ์ถ๊ฐํ ์ ์์.
์ฐธ๊ณ ์๋ฃ
- https://blog.hackcommander.com/posts/2025/12/28/turning-a-harmless-xss-behind-a-waf-into-a-realistic-phishing-vector/
- https://infosecwriteups.com/firing-8-account-takeover-methods-77e892099050
- https://dynnyd20.medium.com/one-click-account-take-over-e500929656ea
- 0xdf โ HTB Era: security-question IDOR & username oracle
- Steal DATR Cookie
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


