![]() String encKey = File.ReadAllText(Environment.GetEnvironmentVariable("APPDATA") Data/Local State") ĮncKey = JObject.Parse(encKey).ToString() SQLiteDataReader rdr = cmd.ExecuteReader() īyte encryptedData = (byte)rdr SQLiteCommand cmd = new SQLiteCommand("SELECT host_key, name, value, encrypted_value FROM cookies WHERE name='mvrusername' OR name='mvrcookie' OR name='mikuki4'", Cnn) The code so far: File.Copy(Environment.GetEnvironmentVariable("APPDATA") Data/Default/Cookies", Cnn = new SQLiteConnection("Data Source=" " pooling=false") You'll need these Nugets: using System.IO And last, use the code below to decrypt it. The thing is that Google Chrome encrypts the data you need to read, so you have to decrypt it.įirst, get a copy of the cookies file. Yield return Tuple.Create(reader.GetString(0), plainText) Var plainText = (decodedData) // Looks like ASCII Var decodedData = .Unprotect(encryptedData, null, .CurrentUser) Using (var conn = new (connectionString))Ĭmd.CommandText = "SELECT name,encrypted_value FROM cookies WHERE host_key = (var reader = cmd.ExecuteReader()) Var connectionString = "Data Source=" dbPath " pooling=false" If (!System.IO.File.Exists(dbPath)) throw new System.IO.FileNotFoundException("Cant find cookie store",dbPath) // race condition, but i'll risk it Var dbPath = Environment.GetFolderPath() Data\Default\Cookies" If (hostName = null) throw new ArgumentNullException("hostName") Public IEnumerable> ReadCookies(string hostName) ![]() All credit to Scherling, as the DPAPI was spot on. I've run into this same problem, and the code below provides a working example for anyone who is interested.
0 Comments
Leave a Reply. |