intercepting cosmo
requirements
create a device
- install
android studio and android SDK
yay -S android-studio android-sdk-platform-tools
- run
android-studio
- open the virtual device manager
- create a new device with the following settings
device: pixel 8
API: API 34 android 14.0
services: google play store
system image: recommended x86_64 image
default boot: cold
camera: none
graphics: hardware acceleration
- boot the device
- open the play store and install cosmo
root the device
- download
rootAVD
git clone https://gitlab.com/newbit/rootAVD && cd rootAVD
- run the script
./rootAVD.sh ~/Android/Sdk/system-images/android-34/google_apis_playstore/x86_64/ramdisk.img
- restart the device (cold boot)
become a superuser
- download
magisk
curl -L https://github.com/topjohnwu/Magisk/releases/latest/download/app-release.apk -o magisk.apk
- sideload
magisk onto the device
adb install magisk.apk
- open
magisk on the device, then update and reboot if required
- ask for root access
adb shell
su
- switch to the superuser tab in the
magisk app and grant permissions when prompted
monitor network traffic
- install
httptoolkit
yay -S httptoolkit
- run
httptoolkit and select Android Device via ADB
- confirm access on the device, ensuring system trust is enabled
- open cosmo and create an account
- monitor traffic inside
httptoolkit to find tokens
- view a livestream to find api key located in a stream.io url
example responses
- authentication
{
"user": {
"id": 123456,
"email": "cosmo@mail.com",
"address": "0x3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"nickname": "cosmo",
"guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"credentials": {
"accessToken": "eyJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"refreshToken": "eyJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
- livestream
wss://video.stream-io-api.com/video/connect?api_key=XXXXXXXXXXXX&stream-auth-type=jwt&X-Stream-Client=stream-video-react_native-v1.24.0%7Cclient_bundle%3Dbrowser-esm"