Client Side Template Injection (CSTI)
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Ni kama Server Side Template Injection lakini katika mteja. SSTI inaweza kukuruhusu kutekeleza msimbo kwenye seva ya mbali, CSTI inaweza kukuruhusu kutekeleza msimbo wa JavaScript wa kiholela katika kivinjari cha mwathirika.
Kujaribu udhaifu huu ni kama ilivyo katika kesi ya SSTI, mfasiri anatarajia kigezo na atakitekeleza. Kwa mfano, kwa payload kama {{ 7-7 }}
, ikiwa programu ina udhaifu utaona 0
, na ikiwa sivyo, utaona asili: {{ 7-7 }}
AngularJS ni mfumo wa JavaScript unaotumika sana ambao unawasiliana na HTML kupitia sifa zinazojulikana kama maagizo, moja maarufu ikiwa ng-app
. Agizo hili linaruhusu AngularJS kushughulikia maudhui ya HTML, na kuwezesha utekelezaji wa maelekezo ya JavaScript ndani ya mabano mawili ya curly.
Katika hali ambapo input ya mtumiaji inaingizwa kwa nguvu katika mwili wa HTML ulio na lebo ng-app
, inawezekana kutekeleza msimbo wa JavaScript wa kiholela. Hii inaweza kufikiwa kwa kutumia sintaksia ya AngularJS ndani ya input. Hapa chini kuna mifano inayoonyesha jinsi msimbo wa JavaScript unaweza kutekelezwa:
You can find a very basic online example of the vulnerability in AngularJS in http://jsfiddle.net/2zs2yv7o/ and in Burp Suite Academy
Angular 1.6 iliondoa sandbox hivyo kutoka toleo hili payload kama {{constructor.constructor('alert(1)')()}}
au <input ng-focus=$event.view.alert('XSS')>
inapaswa kufanya kazi.
You can find a vulnerable Vue implementation in https://vue-client-side-template-injection-example.azu.now.sh/
Working payload: https://vue-client-side-template-injection-example.azu.now.sh/?name=%7B%7Bthis.constructor.constructor(%27alert(%22foo%22)%27)()%7D%
And the source code of the vulnerable example here: https://github.com/azu/vue-client-side-template-injection-example
A really good post on CSTI in VUE can be found in https://portswigger.net/research/evading-defences-using-vuejs-script-gadgets
Mwandiko: Gareth Heyes, Lewis Ardern & PwnFunction
Credit: Mario Heiderich
Angalia zaidi VUE payloads katika https://portswigger.net/web-security/cross-site-scripting/cheat-sheet#vuejs-reflected
Payload:
Zaidi ya payloads katika https://portswigger.net/research/abusing-javascript-frameworks-to-bypass-xss-mitigations
Jifunze & fanya mazoezi ya AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Jifunze & fanya mazoezi ya GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)