wssprotocol establishes a WebSocket over an encrypted TLS connection, while the
wsprotocol uses an unencrypted connection.
Upgradeheaders in the request and response indicate that this is a WebSocket handshake.
Sec-WebSocket-Versionrequest header specifies the WebSocket protocol version that the client wishes to use. This is typically
Sec-WebSocket-Keyrequest header contains a Base64-encoded random value, which should be randomly generated in each handshake request.
Sec-WebSocket-Acceptresponse header contains a hash of the value submitted in the
Sec-WebSocket-Keyrequest header, concatenated with a specific string defined in the protocol specification. This is done to prevent misleading responses resulting from misconfigured servers or caching proxies.
Sec-WebSocket-Keyheader contains a random value to prevent errors from caching proxies, and is not used for authentication or session handling purposes (It's not a CSRF token).
websocatto stablish a raw connection with a websocket.
wsHook.jsfile from https://github.com/skepticfx/wshook and save it inside the folder with the web files. Exposing the web application and making a user connect to it you will be able to steal the sent and received messages via websocket: