Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/arte.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/arte.png"alt=""data-size="line">\
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/grte.png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/grte.png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
Hii darasa lina **tabia ya kushangaza.** Kutoka kwenye hati: “**Wenyeji wawili wanachukuliwa kuwa sawa ikiwa majina yote ya mwenyeji yanaweza kutatuliwa kuwa anwani sawa za IP**.”\
Basi, kila wakati kitu cha URL kinapoitisha **yoyote** ya **kazi `equals`** au **`hashCode`** ombi la **DNS** kupata Anwani ya IP litakuwa **litatumwa**.
**Kuita** kazi **`hashCode`** **kutoka** kwa kitu cha **URL** ni rahisi sana, inatosha kuingiza kitu hiki ndani ya `HashMap` ambacho kitakuwa kinachakatwa. Hii ni kwa sababu **mwishoni** mwa **kazi `readObject`** kutoka `HashMap` hii nambari inatekelezwa:
It is **going** the **execute**`putVal` with every value inside the `HashMap`. But, more relevant is the call to `hash` with every value. This is the code of the `hash` function:
Kama unavyoweza kuona, **wakati wa deserialization** ya **`HashMap`** kazi `hash` itatekelezwa **na kila kitu** na **wakati** wa utekelezaji wa **`hash`** **itaweza kutekelezwa**`.hashCode()` ya kitu. Hivyo, ikiwa unafanya **deserialization** ya **`HashMap`** **iliyokuwa na** kitu cha **URL**, **kitu cha URL** kita **tekeleza**`.hashCode()`.
Therefore, this class can be **kutumiwa vibaya** in order to **kuanzisha** a **ombio la DNS** to **kuonyesha** that **deserialization** is possible, or even to **kuondoa taarifa** (you can append as subdomain the output of a command execution).
You can find the [URDNS payload code from ysoserial here](https://github.com/frohoff/ysoserial/blob/master/src/main/java/ysoserial/payloads/URLDNS.java). However, just for make it easier to understand how to code it I created my own PoC (based on the one from ysoserial):
* Katika wazo la asili, mzigo wa makusanyo ya kawaida ulibadilishwa ili kutekeleza uchunguzi wa DNS, hii ilikuwa na uaminifu mdogo kuliko njia iliyopendekezwa, lakini hii ndiyo chapisho: [https://www.gosecure.net/blog/2017/03/22/detecting-deserialization-bugs-with-dns-exfiltration/](https://www.gosecure.net/blog/2017/03/22/detecting-deserialization-bugs-with-dns-exfiltration/)
**GadgetProbe** itajaribu kubaini kama **darasa la Java fulani lipo** kwenye darasa la Java la seva ili uweze kujua **kama** lina **udhaifu** kwa exploit inayojulikana.
**GadgetProbe** itatumia **mzigo wa DNS wa sehemu ya awali** lakini **kabla** ya kuendesha uchunguzi wa DNS itajaribu **kufanya deserialization ya darasa lolote**. Ikiwa **darasa lolote lipo**, **uchunguzi wa DNS** uta **tumwa** na GadgetProbe itakumbuka kwamba darasa hili lipo. Ikiwa **ombio la DNS** halijatumwa **kamwe**, hii inamaanisha kwamba **darasa lolote halikufanywa deserialization** kwa mafanikio hivyo labda halipo au **halitambuliki/haliwezi kutumika**.
Ndani ya github, [**GadgetProbe ina orodha za maneno**](https://github.com/BishopFox/GadgetProbe/tree/master/wordlists) zenye madarasa ya Java kwa ajili ya kupimwa.
Kwa kawaida inachunguza **kwa njia ya kupita** maombi yote na majibu yaliyotumwa **ikiangalia****baiti za uchawi za Java zilizosajiliwa** na itawasilisha onyo la udhaifu ikiwa yoyote itapatikana:
Unaweza kuchagua ombi, bonyeza kulia na `Send request to DS - Manual Testing`.\
Kisha, ndani ya _Deserialization Scanner Tab_ --> _Manual testing tab_ unaweza kuchagua **nukta ya kuingiza**. Na **anzisha upimaji** (Chagua shambulio linalofaa kulingana na uandishi uliofanywa).
Hata kama hii inaitwa "Manual testing", ni **otomatiki** sana. Itakagua kiotomatiki kama **deserialization** ina **udhaifu** kwa **mzigo wowote wa ysoserial** ikichunguza maktaba zilizopo kwenye seva ya wavuti na itaonyesha zile zenye udhaifu. Ili **kuangalia** maktaba **zenye udhaifu** unaweza kuchagua kuanzisha **Javas Sleeps**, **sleeps** kupitia **matumizi ya CPU**, au kutumia **DNS** kama ilivyotajwa hapo awali.
Mara tu unapokuwa umepata maktaba yenye udhaifu unaweza kutuma ombi kwenye _Exploiting Tab_.\
Katika tab hii unapaswa **kuchagua****nukta ya kuingiza** tena, na **kuandika****maktaba yenye udhaifu** unayotaka kuunda mzigo kwa, na **amri**. Kisha, bonyeza tu kitufe cha **Attack** kinachofaa.
Jifunze & fanya mazoezi ya AWS Hacking:<imgsrc="/.gitbook/assets/arte.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/arte.png"alt=""data-size="line">\
Jifunze & fanya mazoezi ya GCP Hacking: <imgsrc="/.gitbook/assets/grte.png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/grte.png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
* 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 **tufuatilie** 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.