hacktricks/mobile-pentesting/xamarin-apps.md

83 lines
6.2 KiB
Markdown
Raw Normal View History

2024-02-11 02:13:58 +00:00
# Programu za Xamarin
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua 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>
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2024-01-05 11:02:33 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako inayotangazwa 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 [**Familia ya PEASS**](https://opensea.io/collection/the-peass-family), mkusanyiko wetu wa [**NFTs**](https://opensea.io/collection/the-peass-family) ya kipekee
* **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 PR kwa** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos za github.
</details>
2024-02-11 02:13:58 +00:00
Hii ni muhtasari wa chapisho la blogu [https://www.appknox.com/security/xamarin-reverse-engineering-a-guide-for-penetration-testers](https://www.appknox.com/security/xamarin-reverse-engineering-a-guide-for-penetration-testers)
2024-02-11 02:13:58 +00:00
## **Taarifa Msingi**
2024-02-11 02:13:58 +00:00
Xamarin ni **jukwaa huria** lililoundwa kwa watengenezaji kuunda programu za iOS, Android, na Windows kwa kutumia fremu za .NET na C#. Jukwaa hili linafikia zana nyingi na nyongeza za kuunda programu za kisasa kwa ufanisi.
2024-02-11 02:13:58 +00:00
### Usanifu wa Xamarin
2024-02-11 02:13:58 +00:00
- Kwa **Android**, Xamarin inaunganisha na majina ya Android na Java kupitia vifurushi vya .NET, ikifanya kazi ndani ya mazingira ya utekelezaji ya Mono pamoja na Android Runtime (ART). Vifurushi vya Kuita vilivyosimamiwa (MCW) na Vifurushi vya Kuita vya Android (ACW) hufanikisha mawasiliano kati ya Mono na ART, ambayo yote yamejengwa kwenye kernel ya Linux.
- Kwa **iOS**, programu zinaendeshwa chini ya utekelezaji wa Mono, ikichanganya uongofu kamili wa Mbele ya Wakati (AOT) kuwa lugha ya usanifu ya ARM kutoka kwa nambari ya C# .NET. Mchakato huu unaendesha pamoja na Utekelezaji wa Objective-C kwenye kernel kama ya UNIX.
2024-02-11 02:13:58 +00:00
### .NET Runtime na Mono Framework
2024-02-11 02:13:58 +00:00
**Fremu ya .NET** inajumuisha vifurushi, darasa, na majina ya nafasi za maendeleo ya programu, na .NET Runtime inasimamia utekelezaji wa nambari. Inatoa uhuru wa jukwaa na utangamano wa nyuma. **Mono Framework** ni toleo huria la fremu ya .NET, ilianzishwa mwaka 2005 kuongeza .NET kwa Linux, sasa inayoungwa mkono na Microsoft na inayoongozwa na Xamarin.
2024-02-11 02:13:58 +00:00
### Kudukua Programu za Xamarin
2024-02-11 02:13:58 +00:00
#### Kudondoa Kificho cha Kukusanywa cha Xamarin
2024-02-11 02:13:58 +00:00
Kudondoa kificho cha kukusanywa hubadilisha kificho kilichokusanywa kuwa kificho cha chanzo. Katika Windows, dirisha la Moduli katika Visual Studio linaweza kutambua moduli za kudondoa, kuruhusu upatikanaji wa moja kwa moja wa nambari ya chanzo ya mtu wa tatu na uchimbaji wa kificho cha chanzo kwa uchambuzi.
2024-02-11 02:13:58 +00:00
#### Kompilisheni ya JIT vs AOT
2024-02-11 02:13:58 +00:00
- **Android** inasaidia Kompilisheni ya Mara tu-Inapo (JIT) na Kompilisheni ya Mbele ya Wakati (AOT), na hali ya Hybrid AOT kwa kasi bora ya utekelezaji. AOT kamili inapatikana tu kwa leseni za Enterprise.
- **iOS** inatumia tu Kompilisheni ya AOT kutokana na vizuizi vya Apple kwenye utekelezaji wa nambari ya kudumu.
2024-02-11 02:13:58 +00:00
### Kuchimbua Faili za dll kutoka APK/IPA
2024-02-11 02:13:58 +00:00
Ili kupata vifurushi katika APK/IPA, fungua faili na tafuta saraka za vifurushi. Kwa Android, zana kama [XamAsmUnZ](https://github.com/cihansol/XamAsmUnZ) na [xamarin-decompress](https://github.com/NickstaDB/xamarin-decompress) zinaweza kufungua faili za dll.
2024-02-08 03:06:37 +00:00
```bash
python3 xamarin-decompress.py -o /path/to/decompressed/apk
```
2024-02-11 02:13:58 +00:00
Kwa blobs za mkutano katika Android, [pyxamstore](https://github.com/jakev/pyxamstore) inaweza kuzifungua.
2024-02-08 03:06:37 +00:00
```bash
pyxamstore unpack -d /path/to/decompressed/apk/assemblies/
```
2024-02-11 02:13:58 +00:00
Faili za dll za iOS zinapatikana kwa urahisi kwa decompilation, zikifunua sehemu kubwa ya nambari ya programu, ambayo mara nyingi inashiriki msingi wa kawaida kati ya jukwaa tofauti.
2024-02-11 02:13:58 +00:00
### Uchambuzi wa Kudumu
2024-02-11 02:13:58 +00:00
Uchambuzi wa kudumu unahusisha ukaguzi wa SSL pinning na matumizi ya zana kama [Fridax](https://github.com/NorthwaveSecurity/fridax) kwa marekebisho ya wakati wa kukimbia ya .NET binary katika programu za Xamarin. Skrini za Frida zinapatikana kwa kuzidisha ugunduzi wa root au SSL pinning, kuongeza uwezo wa uchambuzi.
2024-02-11 02:13:58 +00:00
Skrini nyingine za Frida za kuvutia:
* [**xamarin-antiroot**](https://codeshare.frida.re/@Gand3lf/xamarin-antiroot/)
* [**xamarin-root-detect-bypass**](https://codeshare.frida.re/@nuschpl/xamarin-root-detect-bypass/)
* [**Frida-xamarin-unpin**](https://github.com/GoSecure/frida-xamarin-unpin)
2024-02-11 02:13:58 +00:00
## Taarifa Zaidi
* [https://www.appknox.com/security/xamarin-reverse-engineering-a-guide-for-penetration-testers](https://www.appknox.com/security/xamarin-reverse-engineering-a-guide-for-penetration-testers)
* [https://thecobraden.com/posts/unpacking\_xamarin\_assembly\_stores/](https://thecobraden.com/posts/unpacking\_xamarin\_assembly\_stores/)
<details>
2024-02-11 02:13:58 +00:00
<summary><strong>Jifunze kuhusu kudukua AWS kutoka sifuri hadi shujaa na</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2024-02-11 02:13:58 +00:00
Njia nyingine za kusaidia HackTricks:
2024-01-05 11:02:33 +00:00
2024-02-11 02:13:58 +00:00
* Ikiwa unataka kuona **kampuni yako inatangazwa katika HackTricks** au **kupakua HackTricks kwa muundo wa PDF** Angalia [**MPANGO WA KUJIUNGA**](https://github.com/sponsors/carlospolop)!
* Pata [**swag rasmi wa PEASS & HackTricks**](https://peass.creator-spring.com)
* Gundua [**The PEASS Family**](https://opensea.io/collection/the-peass-family), mkusanyiko wetu wa [**NFTs**](https://opensea.io/collection/the-peass-family) za kipekee
* **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 PR kwa** [**HackTricks**](https://github.com/carlospolop/hacktricks) na [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
</details>