Skip to content

Commit

Permalink
Fix updated vault decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesposito committed Dec 14, 2023
1 parent 685462b commit f8322b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ function extractVaultFromFile (data) {
// a nested object.
const matches = data.match(/KeyringController":(\{"vault":".*=\\"\}"\})/);
if (matches && matches.length) {
keyringControllerState = matches[1];
try {
return JSON.parse(JSON.parse(keyringControllerState).vault);
return JSON.parse(JSON.parse(matches[1]).vault);
} catch (err) {
// Not valid JSON: continue
}
Expand Down
15 changes: 14 additions & 1 deletion bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,20 @@ function extractVaultFromFile(data) {
return JSON.parse(JSON.parse(vaultBody));
}
}
// attempt 4: chromium 000005.ldb on windows
{
// attempt 4: chromium 000006.log on MacOS
// this variant also contains a 'keyMetadata' key in the vault, which should be
// a nested object.
var _matches2 = data.match(/KeyringController":(\{"vault":".*=\\"\}"\})/);
if (_matches2 && _matches2.length) {
try {
return JSON.parse(JSON.parse(_matches2[1]).vault);
} catch (err) {
// Not valid JSON: continue
}
}
}
// attempt 5: chromium 000005.ldb on windows
var matchRegex = /Keyring[0-9](?:[\0-\|~-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(\{(?:[\0-z\|~-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*\\"\})/g;
var captureRegex = /Keyring[0-9](?:[\0-\|~-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(\{(?:[\0-z\|~-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*\\"\})/;
var ivRegex = /\\"iv(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){1,4}(?:[\0-\*,-\.:-@\[-`\{-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){1,10}([\+\/-9A-Za-z]{10,40}=*)/;
Expand Down

0 comments on commit f8322b6

Please sign in to comment.