Nahamcon - Online Chatroom
18/06/2023This was a challenge a bit more interesting about websockets but still pretty straight forward.
This was a challenge a bit more interesting about websockets but still pretty straight forward.
For this challenge we have the server code here : main.go
We can see one interseting line 🧐
That tells us that the flag is in one of the messages posted by User5, we just need to retreive it.
Also one of the thing to tell from the source code is that we have access to a chatroom.js file.
Let's take a look at that file to get an idea on how it works :
You don't have to read the whole file but we now know that the chat works with a websocket and we can retreive old messages with !history id and add new messages with !write message
To get the messages we can just use that webSocket.send(!history ${i}
);, lets take advantage on that and select all messages
for (let index = 0; index < 100; index++) { webSocket.send(`!history ${index}`); }
Now we get all the messages (they were only 10 of them so use 100 is taking a hammer to kill a fly 😂) :