Chat bots (& more) for Zoom by figuring out their websocket protocol

zoomer - Bot library for Zoom meetings

Good bot support is part of what makes Discord so nice to use. Unfortunately, the official Zoom API is basically only useful for scheduling meetings and using Zoom Chat, not for making in-meeting bots. So I decided to make bring this feature to Zoom myself.

Here is a demo of a basic, ~130 lines of code bot: Demonstration of basic Zoom bot functionality, controlled via meeting chat

WEB SDK

I created this by reverse engineering the Zoom Web SDK. Regular web joins are captcha-gated but web SDK joins are not. I use an API only used by the Web SDK to get tokens needed to join the meeting. This means you need a Zoom API key/secret, specifically a JWT one. These can be obtained on the Zoom App Marketplace site. The demo at cmd/zoomer/main.go reads these from the environment as ZOOM_JWT_API_KEY and ZOOM_JWT_API_SECRET.

NOTE

Because the API keys are associated with your account, using this software may get your Zoom account banned (reverse engineering is against the Zoom Terms of Service). Please do not use this on an important account.

PLAY WITH DEMO

$ go get github.com/chris124567/zoomer
$ cd $GOPATH/src/github.com/chris124567/zoomer
$ scripts/build.sh
$ ZOOM_JWT_API_KEY="xxx" ZOOM_JWT_API_SECRET="xxx" ./zoomer -meetingNumber xxxxx -password xxxxx

Feel free to use the demo as a template. If you want to use the library elsewhere just import github.com/chris124567/zoomer/pkg/zoom.

DEMO WALKTHROUGH

See the comments in cmd/zoomer/main.go

FEATURES / SUPPORTED MESSAGE TYPES

Feature Send/recv Message Name Function (if send) / struct type (if recv) Host Required Tested
Send a chat message Send WS_CONF_CHAT_REQ ZoomSession.SendChatMessage No Yes
Pretend to "join audio" Send WS_AUDIO_VOIP_JOIN_CHANNEL_REQ ZoomSession.JoinAudioVoipChannel No Yes
Pretend to turn on/off video (if enabled camera indicator appears to be on but actually just shows a black screen) Send WS_VIDEO_MUTE_VIDEO_REQ ZoomSession.SetVideoMuted No Yes
Pretending to screen share (shows "x" is sharing their screen but is just a black screen) Send WS_CONF_SET_SHARE_STATUS_REQ ZoomSession.SetScreenShareMuted Depending on share settings Yes
Pretend to turn on/off audio (if enabled audio indicator appears to be on but no audio is actually outputted) Send WS_AUDIO_MUTE_REQ ZoomSession.SetAudioMuted No Yes
Rename self Send WS_CONF_RENAME_REQ ZoomSession.RenameMe Depending on settings Yes
Rename others Send WS_CONF_RENAME_REQ ZoomSession.RenameById Yes No
Request everyone mutes themselves Send WS_AUDIO_MUTEALL_REQ ZoomSession.RequestAllMute Yes No
Set mute upon entry status Send WS_CONF_SET_MUTE_UPON_ENTRY_REQ ZoomSession.SetMuteUponEntry Yes No
Set allow unmuting audio Send WS_CONF_ALLOW_UNMUTE_AUDIO_REQ ZoomSesssion.SetAllowUnmuteAudio Yes No
Set allow participant renaming Send WS_CONF_ALLOW_PARTICIPANT_RENAME_REQ ZoomSession.SetAllowParticipantRename Yes No
Set chat restrictions level Send WS_CONF_CHAT_PRIVILEDGE_REQ ZoomSession.SetChatLevel Yes Yes
Set screen sharing locked status Send WS_CONF_LOCK_SHARE_REQ ZoomSession.SetShareLockedStatus Yes No
End meeting Send WS_CONF_END_REQ ZoomSession.EndMeeting Yes No
Set allow unmuting video Send WS_CONF_ALLOW_UNMUTE_VIDEO_REQ ZoomSession.SetAllowUnmuteVideo Yes No
Request breakout room join token Send WS_CONF_BO_JOIN_REQ ZoomSession.RequestBreakoutRoomJoinToken No Yes
Breakout room broadcast Send WS_CONF_BO_BROADCAST_REQ ZoomSession.BreakoutRoomBroadcast Yes No
Request a token for creation of a breakout room Send WS_CONF_BO_TOKEN_BATCH_REQ ZoomSession.RequestBreakoutRoomToken Yes Yes
Create a breakout room Send WS_CONF_BO_START_REQ ZoomSession.CreateBreakoutRoom Yes No
Join information (user ID, participant ID and some other stuff) Recv WS_CONF_JOIN_RES JoinConferenceResponse Yes
Breakout room creation token response (response to WS_CONF_BO_TOKEN_BATCH_REQ) Recv WS_CONF_BO_TOKEN_RES ConferenceBreakoutRoomTokenResponse Yes
Breakout room join response Recv WS_CONF_BO_JOIN_RES ConferenceBreakoutRoomJoinResponse Yes
Permission to show avatars changed Recv WS_CONF_AVATAR_PERMISSION_CHANGED ConferenceAvatarPermissionChanged Yes
Roster change (mute/unmute, renames, leaves/joins) Recv WS_CONF_ROSTER_INDICATION ConferenceRosterIndication Yes
Meeting attribute setting (stuff like "is sharing allowed" or "is the meeting locked") Recv WS_CONF_ATTRIBUTE_INDICATION ConferenceAttributeIndication Yes
Host change Recv WS_CONF_HOST_CHANGE_INDICATION ConferenceHostChangeIndication Yes
Cohost change Recv WS_CONF_COHOST_CHANGE_INDICATION ConferenceCohostChangeIndication Yes
"Hold" state (waiting rooms) Recv WS_CONF_HOLD_CHANGE_INDICATION ConferenceHoldChangeIndication Yes
Chat message Recv WS_CONF_CHAT_INDICATION ConferenceChatIndication Yes
Meeting "option" parameter (used for waiting room and breakout rooms) Recv WS_CONF_OPTION_INDICATION ConferenceOptionIndication Yes
??? Local Record Indication ??? Recv WS_CONF_LOCAL_RECORD_INDICATION ConferenceLocalRecordIndication Yes
Breakout room command (forcing you to join a room, broadcasts) Recv WS_CONF_BO_COMMAND_INDICATION ConferenceBreakoutRoomCommandIndication Yes
Breakout room attributes (settings and list of rooms) Recv WS_CONF_BO_ATTRIBUTE_INDICATION ConferenceBreakoutRoomAttributeIndication Yes
Datacenter Region Recv WS_CONF_DC_REGION_INDICATION ConferenceDCRegionIndication Yes
??? Audio Asn ??? Recv WS_AUDIO_ASN_INDICATION AudioAsnIndication Yes
??? Audio Ssrc ??? Recv WS_AUDIO_SSRC_INDICATION AudioSSRCIndication Yes
Someone has enabled video Recv WS_VIDEO_ACTIVE_INDICATION VideoActiveIndication Yes
??? Video Ssrc ??? Recv WS_VIDEO_SSRC_INDICATION SSRCIndication Yes
Someone is sharing their screen Recv WS_SHARING_STATUS_INDICATION SharingStatusIndication Yes

Note that you are free to construct your own message types for any I have not implemented.

For sending: Look at zoom/requests.go and switch out the struct and message type names for your new message type

For receiving: Create a definition for the type and update the getPointerForBody function in zoom/message.go.

INFORMATION ON PROTOCOL

The protocol used by the Zoom Web client is basically just JSON over Websockets. The messages look something like this:

{"body":{"bCanUnmuteVideo":true},"evt":7938,"seq":44}
{"body":{"add":null,"remove":null,"update":[{"audio":"","bAudioUnencrytped":false,"id":16785408}]},"evt":7937,"seq":47}
{"body":{"add":null,"remove":null,"update":[{"caps":5,"id":16785408,"muted":true}]},"evt":7937,"seq":63}
{"body":{"dc":"the United States(SC)","network":"Zoom Global Network","region":"the United States"},"evt":7954,"seq":3}

The "evt" number specifies the event number. There is a (mostly complete) list of these in zoom/constant.go that I extracted from javascript code on the meeting page.

For the above three messages, the types are:

WS_CONF_ATTRIBUTE_INDICATION                     = 7938 // ConferenceAttributeIndication
WS_CONF_ROSTER_INDICATION                        = 7937 // ConferenceRosterIndication
WS_CONF_DC_REGION_INDICATION                     = 7954 // ConferenceDCRegionIndication

The thing in the comments to the right is the struct type for that message, which can be found in zoom/message_types.go.

Also, the server and client both have sequence numbers ("seq") for the messages they send but it doesn't appear to be used for anything (?).

TODO (DESCENDING ORDER OF PRIORITY)

  • Gracefully exit/disconnect
  • Organize zoom/message_types.go and general refactoring
  • Support for meetings where you don't have the password but just a Zoom url with the "pwd" parameter in it (anyone know anything about this??)
  • Thoroughly test things
  • Make it more extensible
  • Joining breakout room support
  • More comments and documentation
  • Support audio/video

REMARK ON MAINTENANCE AND STABILITY

This is hobbyist software that has no guarantees of being maintained or supported. Please don't use it anywhere near production.

Owner
Christopher Tarry
Student
Christopher Tarry
Similar Resources

WebSocket Command Line Client written in Go

ws-cli WebSocket Command Line Client written in Go Installation go get github.com/kseo/ws-cli Usage $ ws-cli -url ws://echo.websocket.org connected (

Nov 12, 2021

proxy your traffic through CDN using websocket

go-cdn2proxy proxy your traffic through CDN using websocket what does it do example server client thanks what does it do you can use this as a library

Dec 7, 2022

Tiny WebSocket library for Go.

RFC6455 WebSocket implementation in Go.

Dec 28, 2022

Simple example for using Turbos Streams in Go with the Gorilla WebSocket toolkit.

Go Example for TurboStreams over WebSockets Simple example for using Turbos Streams in Go with the Gorilla WebSocket toolkit.

Dec 22, 2022

Minimal and idiomatic WebSocket library for Go

websocket websocket is a minimal and idiomatic WebSocket library for Go. Install go get nhooyr.io/websocket Highlights Minimal and idiomatic API First

Dec 31, 2022

:notes: Minimalist websocket framework for Go

:notes: Minimalist websocket framework for Go

melody 🎶 Minimalist websocket framework for Go. Melody is websocket framework based on github.com/gorilla/websocket that abstracts away the tedious p

Dec 23, 2022

A modern, fast and scalable websocket framework with elegant API written in Go

A modern, fast and scalable websocket framework with elegant API written in Go

About neffos Neffos is a cross-platform real-time framework with expressive, elegant API written in Go. Neffos takes the pain out of development by ea

Dec 29, 2022

Terminal on browser via websocket

Terminal on browser via websocket. Supportted OS Linux Mac

Dec 27, 2022

run shell scripts by websocket with go lauguage

run shell scripts by websocket with go lauguage

go_shell_socket run shell scripts by websocket with go lauguage Usage pull project get gin and websocket with go get config config.json file build it

Mar 9, 2022
Comments
  • Clean up message API a bit

    Clean up message API a bit

    This PR changes the API of session.MakeWebsocketConnection so that the caller can type-switch on the message, rather than switching on the Evt field and decoding the JSON themselves.

    I also tried to clean up the mapping from Evt to Go type via a bit of reflection, but I wasn't able to test it locally, so...fingers crossed it works at runtime. 😬

  • feat: add screen share decryption

    feat: add screen share decryption

    This PR adds support for decryption of the screen share video feed. This works quite, well and will spit out recording files by default if you enable it, it's disabled by default.

    There are quite a few changes in this PR, some breaking and honestly I haven't tested the rebased version.

    Here's a sample of the outputted H264 stream (had to change the extension to log to allow upload). It's unplayable in its current form, I hope someone else out there figures out how to actually decode the H264 stream. I managed to decode a a tiny bit of a frame, enough to see some letters but otherwise it's complete garbage. 2022-10-09-18-45-27.h264.log note: constraint_set7_flag, 1111 1110 = 0xFE - ffmpeg will reject, rewriting to 0 does help a bit

    It took me a few months to get to this stage, the ZoomRtpEncoder is untested, never got around to that. They seem to be using their own version of RTP Frame marking as well.

  • Feature development: Audio/Video support

    Feature development: Audio/Video support

    Any chance you could offer notes or starting points on what you've discerned so far re: trying to add audio/video support (in case any contributors would like to try?)

  • Feature Request: Ability to join meetings with no password set

    Feature Request: Ability to join meetings with no password set

    Hi there, I came across this pretty recently and it seems like one of the only options for logging a bot into Zoom sessions, so, thanks for that.

    However - it looks like this was coded without the ability to join Zoom sessions where there's no password set, and I can't quite figure out how to integrate the "meetingNeedsPassword" variable to circumvent this. So if you/anyone here has any ideas on this, I'd definitely appreciate it. Thanks!

Related tags
Websocket-chat - A simple websocket chat application
Websocket-chat - A simple websocket chat application

WebSocket Chat App This is a simple chat app based on websockets. It allows user

Jan 25, 2022
simpleChatInGo - This is a simple chat that i made for fun asnd learn more about websocket
simpleChatInGo - This is a simple chat that i made for fun asnd learn more about websocket

simpleChatInGo This is a simple chat that i made for fun asnd learn more about websocket deploy For deploy this you only need to run the command : $ d

Sep 21, 2022
Awesome WebSocket CLient - an interactive command line client for testing websocket servers
Awesome WebSocket CLient - an interactive command line client for testing websocket servers

Awesome WebSocket CLient - an interactive command line client for testing websocket servers

Dec 30, 2022
Simle websocket chat on Golang

WebsocketChat Simle websocket chat on Golang Installation (with comiling binary files): cd projectDir/cmd/app/server - change current directory go bui

Nov 1, 2021
This application shows how to use the websocket package to implement a simple web chat application.

Chat Example This application shows how to use the websocket package to implement a simple web chat application. Running the example The example requi

Nov 14, 2021
Simple Chat App built with Go, Websocket, etc

Go - Simple Chat Usage: 1. Clone Repository git clone https://github.com/aesuhaendi/go-simple-chat.git 2. Running HTTP Server go run . If you are us

Oct 4, 2021
BrisGolang is a Go implementation of the game of briscola using the WebSocket protocol for client/server communication.

BrisGolang BrisGolang is a Go implementation of the game of briscola using the WebSocket protocol for client/server communication. Usage You can play

Nov 1, 2021
🚀 BiliBili Live WebSocket Protocol SDK in Golang
🚀 BiliBili Live WebSocket Protocol SDK in Golang

BiliGO-LIVE BiliBili Live WebSocket Protocol SDK in Golang 简介 v0版本不保证对外函数、结构的不变性,请勿大规模用于生产环境 哔哩哔哩直播 WebSocket 协议的 Golang 封装 特性 良好的设计,自定义程度高 代码、结构体注释完善

Oct 30, 2022
A fast, well-tested and widely used WebSocket implementation for Go.

Gorilla WebSocket Gorilla WebSocket is a Go implementation of the WebSocket protocol. Documentation API Reference Chat example Command example Client

Jan 2, 2023
Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.

websocketd websocketd is a small command-line tool that will wrap an existing command-line interface program, and allow it to be accessed via a WebSoc

Dec 31, 2022