Advertisement
Guest User

Untitled

a guest
Mar 9th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. #region namespaces
  2. using System;
  3. using System.Reflection;
  4. using System.Management;
  5. using System.Linq;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. using System.Net.NetworkInformation;
  9. using System.IO;
  10. using System.Xml;
  11. using System.Threading;
  12. using System.Security.Permissions;
  13. using Microsoft.Win32;
  14. using System.Runtime.InteropServices;
  15. using System.Windows.Forms;
  16. using Microsoft.VisualBasic;
  17. using System.Net;
  18. using System.Diagnostics;
  19. using System.Net.Sockets;
  20. using System.Text.RegularExpressions;
  21. using System.Data;
  22. using System.Data.SQLite;
  23. #endregion
  24.  
  25. namespace WtSlRLte
  26. {
  27. public class main
  28. {
  29. #region common variables;
  30. public static string exen = new FileInfo(Application.ExecutablePath).Name;
  31. public static string chromestealerstring;
  32. #endregion
  33.  
  34. /*
  35. * wait for user to enter db file path
  36. * wait for user to enter decoded db path (txt file)
  37. * load db
  38. * decode db
  39. * parse db to string
  40. * save string to txt (user defined path)
  41. *
  42. */
  43.  
  44. static void decoderfunction()
  45. {
  46. Console.WriteLine("Please enter the full path to your chrome db FILE!");
  47. Console.WriteLine("Example : C:\\Users\\SoftCreatR\\Desktop\\chromedatabase.db");
  48. string filepath_input = Console.ReadLine();
  49. Console.WriteLine("Please enter the PATH where to save the decoded db textfile ..");
  50. Console.WriteLine("Example : C:\\Users\\SoftCreatR\\Desktop\\");
  51. string filepath_output = Console.ReadLine();
  52. Console.WriteLine("Loading chrome db");
  53. if (File.Exists(filepath_input))
  54. {
  55. try
  56. {
  57. DataTable dataTable = getDataTable("SELECT origin_url, username_value, password_value FROM logins", "Data Source=" + filepath_input);
  58. foreach (DataRow dataRow in dataTable.Rows)
  59. {
  60. string user = dataRow["username_value"].ToString();
  61. string text2;
  62. string @string = Encoding.UTF8.GetString(DPAPI.Decrypt((byte[])dataRow["password_value"], null, out text2));
  63. string host = dataRow["origin_url"].ToString();
  64. string spacer = "\n";
  65. chromestealerstring = chromestealerstring + spacer + "Website : " + host + spacer + "Username : " + user + spacer + "Password : " + @string + spacer;
  66. }
  67. }
  68. catch
  69. {
  70. MessageBox.Show("Error finding your input!");
  71. }
  72. }
  73. Console.WriteLine("DB successfully loaded and decoded");
  74. Console.WriteLine("saving ..");
  75. try
  76. {
  77.  
  78. System.IO.File.WriteAllText(filepath_output + "decoded_db_" + ".txt", chromestealerstring + "\n");
  79. }
  80. catch
  81. {
  82. MessageBox.Show("Error saving your file!");
  83. }
  84. Console.WriteLine("Saved your decoded db file to : " + filepath_output + "decoded_db_"+ ".txt");
  85. Console.WriteLine("Press any key to exit");
  86. Console.ReadKey();
  87. }
  88.  
  89. static DataTable getDataTable(string sql, string dbConnection)
  90. {
  91. DataTable dataTable = new DataTable();
  92. try
  93. {
  94. SQLiteConnection sQLiteConnection = new SQLiteConnection(dbConnection);
  95. sQLiteConnection.Open();
  96. SQLiteDataReader sQLiteDataReader = new SQLiteCommand(sQLiteConnection)
  97. {
  98. CommandText = sql
  99. }.ExecuteReader();
  100. dataTable.Load(sQLiteDataReader);
  101. sQLiteDataReader.Close();
  102. sQLiteConnection.Close();
  103. }
  104. catch (Exception ex)
  105. {
  106. throw new Exception(ex.Message);
  107. }
  108. return dataTable;
  109. }
  110.  
  111. static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
  112. {
  113. return EmbeddedAssembly.Get(args.Name);
  114. }
  115.  
  116. static void Main(string[] args)
  117. {
  118. string resource = "Chrome_DB_Decoder.System.Data.SQLite.dll";
  119. EmbeddedAssembly.Load(resource, "System.Data.SQLite.dll");
  120. AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
  121. Console.Title = "Chrome DB Decoder by sandaasu";
  122. decoderfunction();
  123. Application.Exit();
  124. }
  125. }
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement