chrome-tools 1.1.18 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -7
- package/dist/chrome_abe_decrypt.exe +0 -0
- package/dist/chromium/addresses.d.ts +2 -0
- package/dist/chromium/browsers.d.ts +73 -0
- package/dist/chromium/local-storage.d.ts +7 -0
- package/dist/chromium/profiles.d.ts +130 -0
- package/dist/cli.js +95 -8821
- package/dist/core/crypto.d.ts +52 -0
- package/dist/core/keychain.d.ts +57 -0
- package/dist/core/limit.d.ts +4 -0
- package/dist/core/sql.d.ts +2 -0
- package/dist/index.d.ts +28 -628
- package/dist/index.js +29 -2520
- package/dist/modules/autofill.d.ts +68 -0
- package/dist/modules/bookmarks.d.ts +22 -0
- package/dist/modules/cookies.d.ts +40 -0
- package/dist/modules/downloads.d.ts +27 -0
- package/dist/modules/extensions.d.ts +24 -0
- package/dist/modules/history.d.ts +34 -0
- package/dist/modules/local-storage.d.ts +21 -0
- package/dist/modules/passwords.d.ts +50 -0
- package/dist/modules/search-engines.d.ts +21 -0
- package/dist/modules/top-sites.d.ts +17 -0
- package/dist/platform/darwin.d.ts +12 -0
- package/dist/platform/index.d.ts +33 -0
- package/dist/platform/linux.d.ts +10 -0
- package/dist/platform/types.d.ts +49 -0
- package/dist/platform/win32.d.ts +13 -0
- package/dist/storage/binary.d.ts +6 -0
- package/dist/storage/errors.d.ts +13 -0
- package/dist/storage/files.d.ts +5 -0
- package/dist/storage/leveldb.d.ts +8 -0
- package/dist/storage/sqlite.d.ts +5 -0
- package/package.json +9 -10
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decrypts a password/value buffer encrypted by Chrome on macOS or Linux.
|
|
3
|
+
* Chrome v10+ prefixes the encrypted blob with "v10" or "v11", followed by
|
|
4
|
+
* AES-128-CBC ciphertext. (Windows uses AES-256-GCM — see decryptValueBufferGcm.)
|
|
5
|
+
*
|
|
6
|
+
* @param encryptedBlob - The encrypted blob from the database.
|
|
7
|
+
* @param derivedKey - The derived 16-byte key.
|
|
8
|
+
* @returns The decrypted plaintext, or an error placeholder.
|
|
9
|
+
*/
|
|
10
|
+
export declare function decryptValue(encryptedBlob: Buffer | Uint8Array | null | undefined, derivedKey: Buffer): string;
|
|
11
|
+
/**
|
|
12
|
+
* Decrypts a Chrome encrypted blob and returns the raw plaintext bytes.
|
|
13
|
+
*
|
|
14
|
+
* @param encryptedBlob - The encrypted blob from the database.
|
|
15
|
+
* @param derivedKey - The derived 16-byte key.
|
|
16
|
+
* @returns The decrypted plaintext bytes, or an error placeholder.
|
|
17
|
+
*/
|
|
18
|
+
export declare function decryptValueBuffer(encryptedBlob: Buffer | Uint8Array | null | undefined, derivedKey: Buffer): Buffer | string;
|
|
19
|
+
/**
|
|
20
|
+
* Decrypts a Windows Chrome `v10` blob using AES-256-GCM.
|
|
21
|
+
*
|
|
22
|
+
* Unlike the macOS/Linux CBC scheme, Windows blobs carry their own 12-byte
|
|
23
|
+
* nonce after the version prefix and a 16-byte GCM auth tag at the end. The
|
|
24
|
+
* `key` is the 32-byte AES key recovered from `Local State` via DPAPI.
|
|
25
|
+
*
|
|
26
|
+
* @param encryptedBlob - The encrypted blob from the database.
|
|
27
|
+
* @param key - The 32-byte AES-256 key.
|
|
28
|
+
* @returns The decrypted plaintext bytes, or a placeholder string.
|
|
29
|
+
*/
|
|
30
|
+
export declare function decryptValueBufferGcm(encryptedBlob: Buffer | Uint8Array | null | undefined, key: Buffer): Buffer | string;
|
|
31
|
+
/**
|
|
32
|
+
* Decrypts a Windows Chrome 127+ `v20` blob using AES-256-GCM.
|
|
33
|
+
*
|
|
34
|
+
* App-Bound Encryption uses the same AES-256-GCM layout as `v10`/`v11` but
|
|
35
|
+
* with a `"v20"` prefix and a key obtained from Chrome's Elevation Service
|
|
36
|
+
* (IElevator COM) instead of plain DPAPI.
|
|
37
|
+
*
|
|
38
|
+
* Layout: "v20" (3 bytes) + 12-byte nonce + ciphertext + 16-byte GCM tag
|
|
39
|
+
*
|
|
40
|
+
* @param encryptedBlob - The encrypted blob from the database.
|
|
41
|
+
* @param key - The 32-byte AES-256 key from ABE decryption.
|
|
42
|
+
* @returns The decrypted plaintext bytes, or a placeholder string.
|
|
43
|
+
*/
|
|
44
|
+
export declare function decryptValueBufferGcmV20(encryptedBlob: Buffer | Uint8Array | null | undefined, key: Buffer): Buffer | string;
|
|
45
|
+
/**
|
|
46
|
+
* Converts a Chrome/Webkit timestamp (microseconds since 1601-01-01)
|
|
47
|
+
* to a readable local Date string.
|
|
48
|
+
*
|
|
49
|
+
* @param chromeTimestamp - Timestamp in microseconds.
|
|
50
|
+
* @returns Human-readable date-time string, or "N/A".
|
|
51
|
+
*/
|
|
52
|
+
export declare function chromeTimeToDate(chromeTimestamp: bigint | number | string | null | undefined): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** How a Keychain read failed, so callers (and the CLI) can react specifically. */
|
|
2
|
+
export type KeychainErrorKind = "access-denied" | "not-found" | "empty" | "unknown";
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when a browser's Safe Storage key cannot be read from the
|
|
5
|
+
* Keychain. Carries the failing `service` and a `kind` so the CLI can show a
|
|
6
|
+
* clear "No keychain access" message instead of a generic failure.
|
|
7
|
+
*/
|
|
8
|
+
export declare class KeychainAccessError extends Error {
|
|
9
|
+
readonly service: string;
|
|
10
|
+
readonly kind: KeychainErrorKind;
|
|
11
|
+
constructor(message: string, service: string, kind: KeychainErrorKind);
|
|
12
|
+
/** True when the failure means we couldn't get permission to read the key. */
|
|
13
|
+
get isAccessDenied(): boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Narrows an unknown error to a {@link KeychainAccessError} caused by missing
|
|
17
|
+
* Keychain permission (denied/dismissed prompt, locked, or non-interactive).
|
|
18
|
+
*/
|
|
19
|
+
export declare function isKeychainAccessDenied(err: unknown): err is KeychainAccessError;
|
|
20
|
+
export type KeychainPasswordProvider = (service: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the current global keychain password provider hook.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getKeychainPasswordProvider(): KeychainPasswordProvider | null;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the global keychain password provider hook, allowing downstream apps (like Electron)
|
|
27
|
+
* to intercept keychain password lookups and resolve them (e.g. via native node-keytar).
|
|
28
|
+
*/
|
|
29
|
+
export declare function setKeychainPasswordProvider(provider: KeychainPasswordProvider | null): void;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves a browser's "Safe Storage" password from the macOS Keychain.
|
|
32
|
+
* Caches the result per service for subsequent calls within the same process.
|
|
33
|
+
*
|
|
34
|
+
* @param service - Keychain service name, e.g. "Chrome Safe Storage".
|
|
35
|
+
* @returns The raw keychain password.
|
|
36
|
+
* @throws If the password could not be retrieved.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getKeychainPassword(service?: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Backward-compatible alias for {@link getKeychainPassword} using Chrome's item.
|
|
41
|
+
* @deprecated Prefer {@link getKeychainPassword} with an explicit service name.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getChromeKeychainPassword(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Derives the AES-128-CBC key from a browser's Keychain password using PBKDF2.
|
|
46
|
+
* Caches the result per service.
|
|
47
|
+
*
|
|
48
|
+
* @param service - Keychain service name. Defaults to Chrome's.
|
|
49
|
+
* @param keychainPassword - The raw password. If omitted, fetched from Keychain.
|
|
50
|
+
* @returns The derived 16-byte key.
|
|
51
|
+
*/
|
|
52
|
+
export declare function deriveEncryptionKey(service?: string, keychainPassword?: string): Buffer;
|
|
53
|
+
/**
|
|
54
|
+
* Clears cached keychain data for all browsers. Useful for testing or
|
|
55
|
+
* re-authentication.
|
|
56
|
+
*/
|
|
57
|
+
export declare function clearKeychainCache(): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Normalizes the public limit option. Zero, negatives, and non-finite values mean unlimited. */
|
|
2
|
+
export declare function normalizeLimit(limit: number | undefined): number | undefined;
|
|
3
|
+
/** Applies a limit to the final combined result set across every profile. */
|
|
4
|
+
export declare function limitResults<T>(results: T[], limit: number | undefined): T[];
|