-
Notifications
You must be signed in to change notification settings - Fork 272
Setting up BrowserCore.py
Prerequisites:
- Google Chrome
- Installed "Windows accounts" extension https://chrome.google.com/webstore/detail/windows-accounts/ppnbnpeolgkicgegkbkbjmhlideopiji?hl=nl
- Windows VM with admin privileges
- A stolen or requested primary refresh token in the format roadtx can handle (
roadtx.prt
) - The files from the browsercore directory in ROADtools
- Python installed (use the downloadable installer, not the windows store one)
In this case I'm setting things up in the c:\browsercore\
directory. You should copy the files from the browsercore directory in ROADtools to here (the manifest.json and browsercore.py itself).
First install roadlib. Make sure it's the latest version:
pip install roadlib
Then copy an existing roadtx.prt file (must have that name, or you must change it in the browsercore.py source) to the same directory.
You can run bctest.py
to make sure it works without errors (should give you a PRT cookie in the output, not a stacktrace with errors).
Also, make sure that python files will be opened with python.exe
from the installation location of your python install C:\Users\youruse\AppData\Local\Programs\Python\Python311\python.exe
or your local equivalent.
Now we need to point the extension to our custom manifest c:\browsercore\manifest.json
. This should be done in the registry since Chrome stores extension handlers there.
Open the key HKEY_CURRENT_USER\Software\Google\Chrome\NativeMessagingHosts\com.microsoft.browsercore
the default key will contain a path, most likely to a directory in c:\windows
or c:\program files
.
This should be changed to c:\browsercore\manifest.json
:
On recent Windows versions, this key is owned by TrustedInstaller, so you have to change ownership first to your own user:
If you restart chrome, SSO should work. Sometimes you need to enter the username of the account first, or perform a sign-in/sign-out with a different user. If it does not work, try clearing the cookies for login.microsoftonline.com
.