# Luki PostMessage {{#include ../../banners/hacktricks-training.md}} ## Wyślij **PostMessage** **PostMessage** używa następującej funkcji do wysyłania wiadomości: ```bash targetWindow.postMessage(message, targetOrigin, [transfer]); # postMessage to current page window.postMessage('{"__proto__":{"isAdmin":True}}', '*') # postMessage to an iframe with id "idframe" document.getElementById('idframe').contentWindow.postMessage('{"__proto__":{"isAdmin":True}}', '*') # postMessage to an iframe via onload ``` Dla **więcej informacji**: - Link do strony o [**zanieczyszczeniu prototypu**](../deserialization/nodejs-proto-prototype-pollution/index.html) - Link do strony o [**XSS**](../xss-cross-site-scripting/index.html) - Link do strony o [**zanieczyszczeniu prototypu po stronie klienta do XSS**](../deserialization/nodejs-proto-prototype-pollution/index.html#client-side-prototype-pollution-to-xss) ## Odniesienia - [https://jlajara.gitlab.io/web/2020/07/17/Dom_XSS_PostMessage_2.html](https://jlajara.gitlab.io/web/2020/07/17/Dom_XSS_PostMessage_2.html) - [https://dev.to/karanbamal/how-to-spot-and-exploit-postmessage-vulnerablities-36cd](https://dev.to/karanbamal/how-to-spot-and-exploit-postmessage-vulnerablities-36cd) - Do ćwiczeń: [https://github.com/yavolo/eventlistener-xss-recon](https://github.com/yavolo/eventlistener-xss-recon) {{#include ../../banners/hacktricks-training.md}}