hacktricks/mobile-pentesting/android-app-pentesting/android-task-hijacking.md

84 lines
6.4 KiB
Markdown
Raw Normal View History

2024-02-11 02:13:58 +00:00
# Udukuzi wa Kazi ya Android
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze udukuzi wa AWS kutoka sifuri hadi shujaa 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-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2024-01-03 10:43:38 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako inatangazwa katika HackTricks** au **kupakua HackTricks katika PDF** Angalia [**MPANGO WA KUJISAJILI**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi ya PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**Familia ya PEASS**](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 udukuzi kwa kuwasilisha PR 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>
2023-09-02 23:51:32 +00:00
<figure><img src="/.gitbook/assets/image (675).png" alt=""><figcaption></figcaption></figure>
2023-09-02 23:48:41 +00:00
2024-02-11 02:13:58 +00:00
Pata udhaifu unaowajali zaidi ili uweze kuzirekebisha haraka. Intruder inafuatilia eneo lako la shambulio, inafanya uchunguzi wa vitisho wa proaktivi, inapata masuala katika mfumo wako mzima wa teknolojia, kutoka kwa APIs hadi programu za wavuti na mifumo ya wingu. [**Jaribu bure**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) leo.
2023-09-02 23:48:41 +00:00
{% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %}
***
2024-02-11 02:13:58 +00:00
## Kazi, Back Stack, na Shughuli za Mbele
2024-02-11 02:13:58 +00:00
Katika Android, **kazi** ni seti ya shughuli ambazo watumiaji wanashirikiana nazo ili kukamilisha kazi maalum, zilizoandaliwa ndani ya **back stack**. Stack hii inapanga shughuli kulingana na wakati zilipofunguliwa, na shughuli ya hivi karibuni zaidi inaonyeshwa juu kama **shughuli ya mbele**. Wakati wowote, shughuli hii tu ndiyo inayoonekana kwenye skrini, ikifanya sehemu ya **kazi ya mbele**.
2024-02-11 02:13:58 +00:00
Hapa kuna maelezo mafupi ya mabadiliko ya shughuli:
2024-02-11 02:13:58 +00:00
- **Shughuli 1** inaanza kama shughuli pekee katika mbele.
- Kuzindua **Shughuli 2** hufanya **Shughuli 1** iende kwenye back stack, ikileta **Shughuli 2** mbele.
- Kuanza **Shughuli 3** huhamisha **Shughuli 1** na **Shughuli 2** zaidi nyuma kwenye stack, na sasa **Shughuli 3** iko mbele.
- Kufunga **Shughuli 3** kunarudisha **Shughuli 2** mbele, ikionyesha mfumo wa urambazaji wa kazi ya Android uliofupishwa.
2024-02-08 03:06:37 +00:00
![https://developer.android.com/images/fundamentals/diagram_backstack.png](<../../.gitbook/assets/image (548).png>)
2024-02-11 02:13:58 +00:00
## Shambulio la Urafiki wa Kazi
2024-02-11 02:13:58 +00:00
### Muhtasari wa Urafiki wa Kazi na Modes za Kuzindua
2024-02-11 02:13:58 +00:00
Katika programu za Android, **urafiki wa kazi** unabainisha kazi inayopendelewa ya shughuli, kwa kawaida inalingana na jina la pakiti ya programu. Hii ni muhimu katika kuunda programu ya uthibitisho wa dhana (PoC) kwa kuonyesha shambulio.
2024-02-11 02:13:58 +00:00
### Modes za Kuzindua
2024-02-11 02:13:58 +00:00
Sifa ya `launchMode` inaelekeza kushughulikia visa vya shughuli ndani ya kazi. Mode ya **singleTask** ni muhimu kwa shambulio hili, ikidhibiti hali tatu kulingana na visa vilivyopo vya shughuli na mechi za urafiki wa kazi. Udanganyifu unategemea uwezo wa programu ya mshambuliaji kuiga urafiki wa kazi wa programu ya lengo, kuwadanganya mfumo wa Android kuzindua programu ya mshambuliaji badala ya programu iliyokusudiwa.
2024-02-11 02:13:58 +00:00
### Hatua za Shambulio Kwa Ufupi
2024-02-11 02:13:58 +00:00
1. **Usakinishaji wa Programu Mbovu**: Mtu aliyeathiriwa anasakinisha programu mbovu kwenye kifaa chao.
2. **Uzinduzi wa Awali**: Mtu aliyeathiriwa kwanza anafungua programu mbovu, kuandaa kifaa kwa shambulio.
3. **Jaribio la Kuzindua Programu Lengo**: Mtu aliyeathiriwa anajaribu kufungua programu iliyokusudiwa.
4. **Udukuzi wa Utekelezaji**: Kwa sababu ya urafiki wa kazi unaofanana, programu mbovu inazinduliwa badala ya programu iliyokusudiwa.
5. **Udanganyifu**: Programu mbovu inaonyesha skrini bandia ya kuingia inayofanana na programu iliyokusudiwa, kuwadanganya mtumiaji kuingiza habari nyeti.
2024-02-11 02:13:58 +00:00
Kwa utekelezaji wa vitendo wa shambulio hili, tazama hazina ya Task Hijacking Strandhogg kwenye GitHub: [Task Hijacking Strandhogg](https://github.com/az0mb13/Task_Hijacking_Strandhogg).
2024-02-11 02:13:58 +00:00
### Hatua za Kuzuia
2024-02-11 02:13:58 +00:00
Ili kuzuia mashambulio kama haya, watengenezaji wanaweza kuweka `taskAffinity` kuwa herufi tupu na kuchagua mode ya kuzindua `singleInstance`, kuhakikisha kujitenga kwa programu yao na nyingine. Kubinafsisha kazi ya `onBackPressed()` hutoa ulinzi zaidi dhidi ya udukuzi wa kazi.
2024-02-11 02:13:58 +00:00
## **Marejeo**
2022-04-05 22:24:52 +00:00
* [**https://blog.dixitaditya.com/android-task-hijacking/**](https://blog.dixitaditya.com/android-task-hijacking/)
* [**https://blog.takemyhand.xyz/2021/02/android-task-hijacking-with.html**](https://blog.takemyhand.xyz/2021/02/android-task-hijacking-with.html)
2022-04-28 16:01:33 +00:00
2023-09-02 23:51:32 +00:00
<figure><img src="/.gitbook/assets/image (675).png" alt=""><figcaption></figcaption></figure>
2023-09-02 23:48:41 +00:00
2024-02-11 02:13:58 +00:00
Pata udhaifu unaowajali zaidi ili uweze kuzirekebisha haraka. Intruder inafuatilia eneo lako la shambulio, inafanya uchunguzi wa vitisho wa proaktivi, inapata masuala katika mfumo wako mzima wa teknolojia, kutoka kwa APIs hadi programu za wavuti na mifumo ya wingu. [**Jaribu bure**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) leo.
2023-09-02 23:48:41 +00:00
{% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %}
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze udukuzi wa AWS kutoka sifuri hadi shujaa 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-04-28 16:01:33 +00:00
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2024-01-03 10:43:38 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako inatangazwa katika HackTricks** au **kupakua HackTricks katika PDF** Angalia [**MPANGO WA KUJISAJILI**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi ya PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**Familia ya PEASS**](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 udukuzi kwa kuwasilisha PR kwa** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [