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.
A page ya HTML inayopatikana kwa umma, **`message.html`**, imeundwa kuongeza maudhui kwa njia ya kidinamikia kwenye mwili wa hati kulingana na vigezo vilivyomo kwenye URL:
A malicious script is executed on an adversary's page, modifying the `content` parameter of the Iframe's source to introduce a **XSS payload**. This is achieved by updating the Iframe's source to include a harmful script:
Mfano huu umetolewa kutoka kwenye [post ya awali](https://thehackerblog.com/steam-fire-and-paste-a-story-of-uxss-via-dom-xss-clickjacking-in-steam-inventory-helper/).
Tatizo kuu linatokana na udhaifu wa Cross-site Scripting (XSS) unaotokana na DOM ulio katika **`/html/bookmarks.html`**. JavaScript inayosababisha shida, sehemu ya **`bookmarks.js`**, imeelezwa hapa chini:
Hii snippet inapata **thamani** kutoka kwa **`txtName`** input field na inatumia **mchanganyiko wa nyuzi kuunda HTML**, ambayo kisha inaongezwa kwenye DOM kwa kutumia jQuery’s `.append()` function.
Kwa kawaida, Sera ya Usalama wa Maudhui (CSP) ya nyongeza ya Chrome ingepunguza udhaifu kama huu. Hata hivyo, kutokana na **kuondolewa kwa CSP na ‘unsafe-eval’** na matumizi ya mbinu za usimamizi wa DOM za jQuery (ambazo zinatumia [`globalEval()`](https://api.jquery.com/jquery.globaleval/) kupitisha scripts kwa [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) wakati wa kuingiza DOM), unyakuzi bado unawezekana.
Ingawa udhaifu huu ni muhimu, unyakuzi wake kwa kawaida unategemea mwingiliano wa mtumiaji: kutembelea ukurasa, kuingiza mzigo wa XSS, na kuamsha kitufe cha “Ongeza”.
Ili kuboresha udhaifu huu, udhaifu wa pili wa **clickjacking** unatumika. Manifest ya nyongeza ya Chrome inaonyesha sera pana ya `web_accessible_resources`:
Kihusishi, ukurasa wa **`/html/bookmarks.html`** unakabiliwa na framing, hivyo ni hatarini kwa **clickjacking**. Uthibitisho huu unatumika kuingiza ukurasa ndani ya tovuti ya mshambuliaji, ukiuweka juu yake na vipengele vya DOM ili kubadilisha muonekano kwa njia ya udanganyifu. Manipulasi hii inawafanya wahanga kuingiliana na nyongeza iliyoko chini bila kukusudia.
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.