Wembsoncket
·
CTF Write Up/BYU CTF 2025
코드 분석더보기server.jsJWT 토큰을 확인해 사용자를 인증하고 /getFlag 메시지를 받을 경우 FLAG를 보내준다. // WebSocket connection handlerwss.on('connection', (ws, req) => { // Get the userId from the cookie const userId = req.headers.cookie ? req.headers.cookie.split('token=')[1] : null; if (userId) { try { const decoded = jwt.verify(userId, JWT_SECRET); const user = decoded.userId; sendMsg(ws, `Welcome! Send..