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을 제출하여 해킹 트릭을 공유하세요.


