hacktricks/pentesting-web/account-takeover.md

122 lines
6.5 KiB
Markdown
Raw Normal View History

2024-02-11 02:13:58 +00:00
# Kuchukua Udhibiti wa Akaunti
2022-11-03 10:18:27 +00:00
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua AWS kutoka mwanzo hadi kuwa bingwa na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)</strong></a><strong>!</strong></summary>
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2024-02-03 12:22:53 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako inatangazwa kwenye HackTricks** au **kupakua HackTricks kwa muundo wa PDF** Angalia [**MPANGO WA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi ya PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**The PEASS Family**](https://opensea.io/collection/the-peass-family), mkusanyiko wetu wa kipekee wa [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Jiunge na** 💬 [**Kikundi cha Discord**](https://discord.gg/hRep4RUj7f) au [**kikundi cha telegram**](https://t.me/peass) au **tufuate** kwenye **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Shiriki mbinu zako za kudukua kwa kuwasilisha PRs kwenye** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos za github.
2022-11-03 10:18:27 +00:00
</details>
2024-02-11 02:13:58 +00:00
## **Tatizo la Uthibitishaji**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Barua pepe ya akaunti inapaswa kujaribiwa kubadilishwa, na mchakato wa uthibitisho **unapaswa kuchunguzwa**. Ikiwa utagundua kuwa ni **dhaifu**, barua pepe inapaswa kubadilishwa na ile ya mwathirika anayetarajiwa na kisha kuthibitishwa.
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
## **Tatizo la Ulinganishaji wa Unicode**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
1. Akaunti ya mwathirika anayetarajiwa `victim@gmail.com`
2. Akaunti inapaswa kuundwa kwa kutumia Unicode\
kwa mfano: `vićtim@gmail.com`
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
Kwa maelezo zaidi, angalia hati kuhusu Ulinganishaji wa Unicode:
2022-11-03 10:18:27 +00:00
[unicode-normalization.md](unicode-injection/unicode-normalization.md)
2024-02-11 02:13:58 +00:00
## **Kutumia Upya Kiungo cha Kurejesha**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Ikiwa mfumo wa lengo unaruhusu **kiungo cha kurejesha kutumika tena**, jitihada zinapaswa kufanywa ili **kupata viungo zaidi vya kurejesha** kwa kutumia zana kama vile `gau`, `wayback`, au `scan.io`.
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
## **Kabla ya Kuchukua Udhibiti wa Akaunti**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
1. Barua pepe ya mwathirika inapaswa kutumika kujiandikisha kwenye jukwaa, na nenosiri linapaswa kuwekwa (jaribio la kuthibitisha linapaswa kufanywa, ingawa kukosa ufikiaji wa barua pepe za mwathirika kunaweza kufanya hii kuwa haiwezekani).
2. Inapaswa kusubiri hadi mwathirika ajisajili kwa kutumia OAuth na kuthibitisha akaunti.
3. Inatumainiwa kuwa usajili wa kawaida utathibitishwa, kuruhusu ufikiaji wa akaunti ya mwathirika.
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
## **Kosa la Uwekaji wa CORS kwa Kuchukua Udhibiti wa Akaunti**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Ikiwa ukurasa una **makosa ya uwekaji wa CORS** unaweza kuwa na uwezo wa **kuiba habari nyeti** kutoka kwa mtumiaji ili **kuchukua udhibiti wa akaunti yake** au kumfanya abadilishe habari ya uthibitisho kwa lengo sawa:
2022-11-03 10:18:27 +00:00
{% content-ref url="cors-bypass.md" %}
[cors-bypass.md](cors-bypass.md)
{% endcontent-ref %}
2024-02-11 02:13:58 +00:00
## **Csrf kwa Kuchukua Udhibiti wa Akaunti**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Ikiwa ukurasa una kasoro ya CSRF unaweza kuwa na uwezo wa kufanya **mtumiaji abadilishe nenosiri lake**, barua pepe au uthibitisho ili uweze kisha kuipata:
2022-11-03 10:18:27 +00:00
{% content-ref url="csrf-cross-site-request-forgery.md" %}
[csrf-cross-site-request-forgery.md](csrf-cross-site-request-forgery.md)
{% endcontent-ref %}
2024-02-11 02:13:58 +00:00
## **XSS kwa Kuchukua Udhibiti wa Akaunti**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Ikiwa unapata XSS kwenye programu unaweza kuwa na uwezo wa kuiba kuki, uhifadhi wa ndani, au habari kutoka kwenye ukurasa wa wavuti ambayo inaweza kukuruhusu kuchukua udhibiti wa akaunti:
2022-11-03 10:18:27 +00:00
{% content-ref url="xss-cross-site-scripting/" %}
[xss-cross-site-scripting](xss-cross-site-scripting/)
{% endcontent-ref %}
2024-02-11 02:13:58 +00:00
## **Chanzo Kimoja + Kuki**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Ikiwa unapata XSS iliyopunguzwa au kuchukua udhibiti wa subdomain, unaweza kucheza na kuki (kuzifunga kwa mfano) kujaribu kudhoofisha akaunti ya mwathirika:
2022-11-03 10:18:27 +00:00
{% content-ref url="hacking-with-cookies/" %}
[hacking-with-cookies](hacking-with-cookies/)
{% endcontent-ref %}
2024-02-11 02:13:58 +00:00
## **Kushambulia Mfumo wa Kurejesha Nenosiri**
2022-11-03 10:18:27 +00:00
{% content-ref url="reset-password.md" %}
[reset-password.md](reset-password.md)
{% endcontent-ref %}
2024-02-11 02:13:58 +00:00
## **Ubadilishaji wa Majibu**
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Ikiwa majibu ya uthibitisho yanaweza **kupunguzwa kuwa boolean rahisi jaribu kubadilisha uwongo kuwa kweli** na uone ikiwa unapata ufikiaji wowote.
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
## OAuth kwa Kuchukua Udhibiti wa Akaunti
2022-11-03 10:18:27 +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)
2022-11-03 10:18:27 +00:00
{% endcontent-ref %}
2024-02-11 02:13:58 +00:00
## Uingizaji wa Kichwa cha Mwenyeji
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
1. Kichwa cha Mwenyeji kinabadilishwa baada ya ombi la kurejesha nenosiri.
2. Kichwa cha mbele-nyuma cha `X-Forwarded-For` kinabadilishwa kuwa `attacker.com`.
3. Kichwa cha Mwenyeji, Kichwa cha Kurejelea, na Kichwa cha Asili vinabadilishwa wakati mmoja kuwa `attacker.com`.
4. Baada ya kuanzisha upya nenosiri na kisha kuchagua kutuma tena barua, njia zote tatu zilizotajwa hapo juu hutumiwa.
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
## Ubadilishaji wa Majibu
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
1. **Ubadilishaji wa Kanuni**: Kanuni ya hali inabadilishwa kuwa `200 OK`.
2. **Ubadilishaji wa Kanuni na Mwili**:
- Kanuni ya hali inabadilishwa kuwa `200 OK`.
- Mwili wa majibu unabadilishwa kuwa `{"success":true}` au kitu tupu `{}`.
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
Teknolojia hizi za ubadilishaji ni muhimu katika hali ambapo JSON hutumiwa kwa usafirishaji na kupokea data.
2024-02-06 03:10:38 +00:00
2024-02-11 02:13:58 +00:00
## Marejeo
2022-11-03 10:18:27 +00:00
* [https://infosecwriteups.com/firing-8-account-takeover-methods-77e892099050](https://infosecwriteups.com/firing-8-account-takeover-methods-77e892099050)
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua AWS kutoka mwanzo hadi kuwa bingwa na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)</strong></a><strong>!</strong></summary>
2022-11-03 10:18:27 +00:00
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2024-02-03 12:22:53 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako inatangazwa kwenye HackTricks** au **kupakua HackTricks kwa muundo wa PDF** Angalia [**MPANGO WA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi ya PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**The PEASS Family**](https://opensea.io/collection/the-peass-family), mkusanyiko wetu wa kipekee wa [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Jiunge na** 💬 [**Kikundi cha Discord**](https://discord.gg/hRep4RUj7f) au [**kikundi cha telegram**](https://t.me/peass) au **tufuate** kwenye **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Shiriki mbinu zako za kudukua kwa kuwasilisha PRs kwenye** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos za github.
2022-11-03 10:18:27 +00:00
</details>