Code Monkey home page Code Monkey logo

clubhouse-py's Introduction

WARNING / NOTES

  • FOR REFERENCE AND EDUCATION PURPOSES ONLY. THIS DOES NOT COME WITH ANY KINDS OF WARRANTY.

  • PLEASE DO NOT CREATE BOTS OR DO ANY HARMFUL THINGS TO THE SERVICE. DON'T BREAK THINGS. DON'T BE EVIL.

  • ANDROID OFFICIAL BUILD IS OUT. THERE WILL BE NO MORE UPDATES ON THIS PROJECT.

Pull Requests / Issues

I disabled PRs and issues temporarily. I will only accept requests when it is worth fixing.

Closed PRs / Closed Issues

Please contact by DMs through @stereotype32 for any questions. Please do not spam e-mails for a request.

All rc_token related requests will be rejected. (See closed issues)

QnA

Are you affiliated with those guys who built the website that streamed Clubhouse rooms?

No.

I am not affiliated with anyone or any company with regards to Clubhouse issues.

Why did you develop this? what is your whole intention about releasing this to public?

  1. There has been a lot of articles about security concerns of Clubhouse when I joined Clubhouse.
  2. I decided to take a closer look at the application by reverse engineering the app. With this I can find out what is the truth and what isn't.
  3. I found some possible security risks during the analysis. However, I will not disclose this information until things are properly and safely mitigated.
  4. I was planning to destroy my work after doing the analysis, but I've decided to share the code as (i) I found out that the whole authentication flow and API base may change in the future, so this src will be priceless at some point of time (ii) I think it would be better off for Android phone users to interact with others. (iii) I wanted more people to join into conversations and have fun.

What if someone uses your code to do malicious activities? Wouldn't that be an issue?

  1. Evil people with evil intentions will do bad things even if the sourcecode wasn't released.
  2. There has been already numerous reports of trollers doing bad things around here and there. (Reference) These trollers have also disclosed their sourcecode, so please have some time to check their source code. These guys did their stuff without even referencing other's source code. This already shows that evil people will always try to break stuff and do bad things regardless of any other helpful factors.
  3. What I shared on GitHub is a very basic thing that a reverse engineer can do. It's technically not difficult to get these information snatched from the binary.
  4. Clubhouse has a straightforward API with some unknown security mechanisms; They have implemented things to ban you for excessive usage.
  5. DO NOT even try anything if you don't really know what you're trying to do. I have been mentioning the same message over here and there.
  6. I am not liable for anything you do with this application. I already warned about this as well.

You've released API keys and secret keys. Wouldn't that severely impact the server?

  1. Let me make things clear first. Those keys are NOT confidential secrets.
  2. These are just identifiers for third-party services to declare that your actions are coming from the Clubhouse app.
  3. These keys are used for communication, adding your instagram/twitter accounts, chat notifications, etc.
  4. I wouldn't have disclosed keys if these keys were actual secrets/confidentials.

Can you disclose what you've found during an analysis?

No.

I will only disclose these issues to the vendor.

I think issues I found seem to be already reported by other researchers as well and they might be already aware of these issues and circumstances.

I've already sent a twitter DM to one of Clubhouse employees as of 2021/Feb/24, but I haven't received any messages yet.

Then, can you explain a bit on that myth about the Chinese IP thing?

  1. It's fixed in the latest version. You don't have to worry about this anymore.
  2. Worth reading this technical post for more detailed information.
  3. The blog post is written in Korean so please translate the page.

I heard that the app is using iOS just to prevent the voice recording. Releasing these kinds of code can possibly make it 'easier' to make voice recording. I want to hear your opinions.

  1. There is literally no way to disallow users from recording the voice. Imagine some people having a "physical" recording device next to them. How will you or the Clubhouse app detect such actions?
  2. Moreover, there is no way to even catch or block the user when someone records and shares your voice record anonymously.
  3. I think there are much more serious risks/problems that CH developers need to take a look at. There seem to be more high priority issues than this one. (in which I assume they're already working on atm)

What do you think about the Clubhouse app? Is the app secure enough? Can you rate their security quality?

From my very personal perspective as a security engineer:

  1. API: Well-made, and I see developers are trying to fix some security issues here. although they still haven't fixed it, yet.
  2. Notifications: LGTM. but sometimes the server goes down pretty frequently. I haven't looked deep into it.
  3. Interaction with voice protocol: meh, but it looks like they're trying to work on it. I think it is more fun to dig more in but doing so will go out of the scope.

Don't you think your actions were ethically wrong?

  1. I also heard that these issues were raised and discussed over several months in an open Clubhouse chatroom, and I guess I've clarified a lot of questions people had over for several months. I guess this already helped some of engineers who were pretty much concerned about things here.
  2. I am pretty sure that somemone would've done this if it wasn't me anyways. At least I gave some initiative to try with good wills and share details with you guys.

I heard that the voice communication is not encrypted. is this true?

As of 2021/Feb/24,

  1. This technical post already explains things really well about the current situation.
  2. I was also curious and read some documentations in Agora.io (Reference)
  3. As mentioned in the technical post, it looks like the communication encryption is never done.
  4. Also, ny looking at those documentations and my codes, you may have already noticed that the enableEncryption is never used here.
  5. In the latest version, they have added the encryption routine but it is not yet used. It should be fixed in the upcoming releases.

I heard that the app is also using Camera permissions. I am really worried right now.

You don't have to worry about this as well. There are some things to share here.

  1. It may have been turned on because you tried to take a photo of yourself to put a profile image.
  2. ... or the voice SDK is trying to secretly access your camera. But from my analysis, I don't see anything like that happening from the App to take photos or videos. Although they have the feature to communicate with your camera, the app does not use that part of the feature atm. (Confirmed safe as of Feb 2021)

I heard that the app is also taking your information while adding your Instagram/Twitter accounts. did you check that?

Yes. You don't have to worry about this as well.

Clubhouse only takes very basic part of your information just to verify that you are the owner of the given account.

  • For Instagram: You're allowing Clubhouse to just take your username. That's all.
  • For Twitter: You're allowing Clubhouse to read your profile, timeline and tweets. However, Clubhouse CANNOT read your personal DMs. This is the least permission they can ask to a user.

The permission setting can also change, but in that case you will be asked again to re-authorize the application with additional permission. Don't worry so much about this part.

If you're still worried about this, You can also revoke the access by doing the following action.

  • For Instagram: Settings -> Security -> Apps and Websites -> Active -> Clubhouse -> revoke access.
  • For Twitter: Settings -> Security and account access -> Apps and sessions -> Connected apps -> Clubhouse -> revoke acccess.

Do you have any plans to do further analysis if Clubhouse opens up a bug bounty programme?

Very unlikely.

Is Clubhouse actually working hard to fix all kinds of security stuff? I'm really worried.

Yes, but there are some reasons why developers are taking some time.

  1. They probably don't want to break things while updating. Developers also need time to fix and test their own code.
  2. Clubhouse is a small company with ~10 employees. You also need to consider the manpower to fix issues.
  3. It may take a few days to get their updates reviewed by Apple.
  4. They also need to have some time to make "best moves" in order to efficiently fix issues.

As a typical user, what do I need to be very careful about when using Clubhouse?

  1. As a speaker: Always assume that someone is recording your voice. Always think multiple times before you speak. Don't speak out confidential/personal stuff. I am not saying that the Clubhouse is recording your voice. There are chances that some trolls or reporters are trying to record multiple chatrooms.
  2. As a moderator: You need to be alert and make quick decisions to make your channel healthy. If someone says something weird or does something crazy, you need to make quick decisions. Move that speaker to audience or just kick the user out of the channel. Simple as that. Also, be aware that you have a lot of privileges. Do not give moderators to unknown people. Any moderator can destroy the channel.

Why did you block issues / PRs?

Mainly two reasons:

  1. There are some people sending me some issues without actually looking into sourcecodes and testing codes.
  2. There are some people wasting their time to send worthless PRs.

I will not open these for the time being. You can send me a message or make your own fork, and I will take a look whenever I'm free

Clubhouse API written in Python

clubhouse-py is originally developed for the sake of interoperability.

Standalone client is also created with very basic features, including but not limited to the audio-chat.

Please note that you may get a permanent ban for sending invalid API requests. Server's ratelimit and security mechanisms are quite strict.

Downloads

Check Releases. OSX(x86_64) may not be stable for use yet.

Demo

Please click the image to open a Youtube video demo.

Demo video

Requirements

  • Windows or OSX
  • Python 3.7 or higher

Installation

By pip

  1. Install by pip
$ pip3 install clubhouse-py
...
Successfully built clubhouse-py
Installing collected packages: clubhouse-py
Successfully installed clubhouse-py-304.0.1
  1. You need to install Agora SDK for voice communication. Refer to Agora-Python-SDK#installation.

Manual Installation

  1. Clone project
$ git clone https://github.com/stypr/clubhouse-py.git clubhouse
$ cd clubhouse
  1. You need to install dependencies first.
$ pip3 install -r requirements.txt
  1. You need to install Agora SDK for voice communication. Refer to Agora-Python-SDK#installation.

Usage

  • For calling APIs from other script
from clubhouse.clubhouse import Clubhouse

...

if __name__ == "__main__":
    clubhouse = Clubhouse()
  • For running a standalone client
$ python3 cli.py

PubNub

PubNub is used for the notification while being in a conversation. This has not been implemented yet. However, you may utilize the PubSub keys provided in the sourcecode to implement this.

Reference / Recommended to read

You may also add more endpoints and features based on the following repositories.

Please note that these repositories were partially referenced to create this project.

Most of things were tested and handcrafted from scratch.

clubhouse-py's People

Contributors

stypr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clubhouse-py's Issues

Kick from channel feature

Is there any possibility to kick a user from a channel but allow him to rejoin? Or maybe is there any list of blocked users related to the channel?

Signup error - Method "GET" not allowed

python3 cli.py

1 )In docker with different version of python (3.6, 3.7, 3.8, 3.9). I don't understand why it's happening - because it's requests.post request :

Please enter your phone number. (+818043217654) > +79099028132
{'detail': 'Method "GET" not allowed.'}
[-] Error occured during authentication. (None)
  1. On OSX 11, using python3.9 I'm getting HTTPSConnectionPool(host='www.clubhouseapi.com', port=443): Max retries exceeded with url: /api/start_phone_number_auth (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

  2. On OSX using app for requests, like - Insomnia - all working fine.

Anyone have thoughts why it may happen with python? I tried installing requests[security] - but it's didn't helped either

How can i invite someone?

I saw some functions with invite and comment: " Invite users to app. but this only works when you have a leftover invitation.".
So what I need to do?

/get_event example?

Hello!

Can anyone explain how /get_event method works? Let's say I have a link to event: https://www.joinclubhouse.com/event/abcdef
I am trying to get link to the room from that event (yes, the event has already started and room exists). I thought that abcdef is an event_id, but calling .get_event(event_id='abcdef') returns 500 error from server.

Profile pic upload

Is there currently a way to upload and update a profile pic? If so - do we need to upload it to a certain S3 bucket, or which API requests are available for this?
If it's not yet implemented - are you planning on doing so?

The room not available

Hey! I try to connect to room with channel name from the link, but get that message:
{'success': False, 'error_message': 'That room is no longer available ๐Ÿ‘‹๐Ÿผ\nTry starting a new one instead?'}
And my friends with iOS can get access to that room. I don't understand why it happened.

Can't enter the room

Hi, thanks for the work. After I launched the client and authorized by sms code and tried to enter a particular room the following error occurred:

zsh: killed     python3 cli.py

I think it has to do with permissions. Can you help?

More rooms

Hello, is it possible to see more rooms. Like next page etc?

req.json() is a weak point

I really don't like the part with

req = requests.post(smth)
return req.json()

It can cause so many problems, server can return 50* and it will break .json() method, server can theoretically return "bad" json and so on.

What do you think about idea to at least start validating response headers, or (better!) check if server response is a correct JSON. I can make a PR if you approve the idea.

Is it possible to get ban by sending requests to same endpoint repeatedly in range of 5-7 seconds?

Thank you for your work!

I want to make a auto-updating subscriber counter in my bio, like "now i have N subscribers". As README says:

Please note that you may get a permanent ban for sending invalid API requests. Server's ratelimit and security mechanisms are quite strict.

I just want to know it it's safe to do this. Have you ever been banned? If so, how often were the requests sent? I want to update my bio every 5-10 seconds. Is it safe?

Is there any option to sign-up using invite code?

 python3 cli.py
[.] Please enter your phone number. (+818043217654) > +12345678900
[.] Please enter the SMS verification code (1234, 0000, ...) > 0000
[.] Writing configuration file complete.
[!] You're still on the waitlist. Find your friends to get yourself in.
Traceback (most recent call last):
  File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 326, in <module>
    main()
  File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 323, in main
    main()
  File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 319, in main
    chat_main(client)
  File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 150, in chat_main
    print_channel_list(client, max_limit)
  File "/Users/tandav/Desktop/clubhouse-py/cli.py", line 83, in print_channel_list
    channels = client.get_channels()['channels']
KeyError: 'channels'```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.