Selenium-based Python3.7+ cookie and API key dump for Google Voice service. Utilized for accessing the internal Google Voice API.
Due to Google's automation detection, it is necessary to run the script in a non-headless environment. Otherwise, the script will not function properly. It is also assumed this Google account is not making use of 2FA and has finished the initial setup.
The following environment variables need to be set prior to running the script:
- GVOICE_EMAIL= the Google email for the account.
- GVOICE_PASSWORD= the Google password for the account.
The following steps need to done before running the secret_dump.py
script:
- Ensure that a Python3.7+ environment has already been setup.
- Ensure the Chrome geckodriver has been setup on the machine.
- Install dependencies with
pip3 install -r requirements.txt
. - Set the environment varaibles as described in config.
- Navigate to
src/
and run the script withpython3 secret_dump.py
. The secrets will be dumped into asecrets.json
file.
The following error might pop up when the script is run:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:50107
from session not created: This version of ChromeDriver only supports Chrome version 101
Current browser version is 98.0.4692.71
In the case of the error, you would need to set the chrome driver version as the major release of the currently installed browser. In this case it would be 98. To set it, pass it as an arg when running such as:
python3 secret_dump.py 98
Google voice secret dump can also be utilized as a package for other Python projects. Simply install it with:
pip3 install git+https://github.com/kingcobra2468/gvoice-secret-dump
Example of logging in and getting secret dump.
from gvoicesecretdump.secrets.gvoice_secret import GVoiceSecret
username='username@gmail.com'
password='password'
# geckodriver chrome version
chrome_version = 100
account = GVoiceSecret(username, password, chrome_version)
account.login()
print(f'secrets: {account.dump_secrets()}')