chrome-tools 1.0.1
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/LICENSE +21 -0
- package/README.md +244 -0
- package/bin/cli.js +590 -0
- package/package.json +55 -0
- package/src/core/chrome.js +177 -0
- package/src/core/crypto.js +63 -0
- package/src/core/db.js +69 -0
- package/src/core/keychain.js +68 -0
- package/src/index.js +49 -0
- package/src/modules/autofill.js +213 -0
- package/src/modules/bookmarks.js +109 -0
- package/src/modules/cookies.js +77 -0
- package/src/modules/downloads.js +91 -0
- package/src/modules/extensions.js +80 -0
- package/src/modules/history.js +102 -0
- package/src/modules/passwords.js +61 -0
- package/src/modules/search-engines.js +48 -0
- package/src/modules/top-sites.js +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# chrome-tools
|
|
2
|
+
|
|
3
|
+
A comprehensive, robust command-line interface and Node.js developer library built to extract, decrypt, and inspect saved data from Google Chrome on macOS.
|
|
4
|
+
|
|
5
|
+
This tool interfaces with the macOS Keychain to retrieve the browser's safe storage key, decrypting AES-128-CBC credentials, cookie values, and autofill credit cards. It also parses open databases like Bookmarks (JSON), History (SQLite), Extensions (JSON), and more.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 🔑 **Secure Decryption**: Automatically interfaces with the macOS Keychain to query the Chrome Safe Storage Password.
|
|
10
|
+
- 📦 **Zero Database Locking**: Clones targeted SQLite databases to temporary directories before running queries, ensuring no lockups even while Chrome is active.
|
|
11
|
+
- 👥 **Multi-Profile Support**: Scans and parses data across all discovered Chrome profiles (e.g. `Default`, `Profile 1`, `Profile 2`).
|
|
12
|
+
- 📊 **Rich Subcommands**: Dedicated commands to extract:
|
|
13
|
+
- Saved website credentials (passwords)
|
|
14
|
+
- Bookmarks (fully flattened folder structures)
|
|
15
|
+
- Browsing history and download history
|
|
16
|
+
- Local session cookies
|
|
17
|
+
- Autofill entries, saved addresses, and credit cards
|
|
18
|
+
- Installed extension metadata
|
|
19
|
+
- Configured search engine keywords and top sites
|
|
20
|
+
- 📂 **Target Custom Directories**: Easily target backed-up Chrome user data directories or specific profiles.
|
|
21
|
+
- 🚀 **Dual Interface**: Fully functional as both a global **npx CLI** and an **importable npm module** for custom scripts.
|
|
22
|
+
- 💎 **Developer Friendly**: Structured JSON output options on all commands for custom shell pipeline processing.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation & CLI Setup
|
|
27
|
+
|
|
28
|
+
### Option 1: Run on-the-fly (Recommended)
|
|
29
|
+
You can run any command instantly without manual installation using `npx`:
|
|
30
|
+
```bash
|
|
31
|
+
npx chrome-tools --profiles
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Option 2: Install Globally
|
|
35
|
+
Install the package globally on your system:
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g chrome-tools
|
|
38
|
+
```
|
|
39
|
+
Now, you can execute the command directly:
|
|
40
|
+
```bash
|
|
41
|
+
chrome-tools --help
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## CLI Usage Guide
|
|
47
|
+
|
|
48
|
+
`chrome-tools` provides a Commander.js-powered CLI featuring dedicated subcommands, global option support, and convenient shortcut flags.
|
|
49
|
+
|
|
50
|
+
### Shortcut Flags
|
|
51
|
+
For quick auditing, use these top-level shortcut flags:
|
|
52
|
+
```bash
|
|
53
|
+
# List all saved website credentials (requires macOS Keychain approval)
|
|
54
|
+
npx chrome-tools --passwords
|
|
55
|
+
|
|
56
|
+
# Flatten and list all bookmarks
|
|
57
|
+
npx chrome-tools --bookmarks
|
|
58
|
+
|
|
59
|
+
# List all discovered profiles and locations
|
|
60
|
+
npx chrome-tools --profiles
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Subcommands
|
|
64
|
+
|
|
65
|
+
#### Profiles
|
|
66
|
+
Scan and check profile states:
|
|
67
|
+
```bash
|
|
68
|
+
# List profiles with directory name, display name, account email, and path
|
|
69
|
+
npx chrome-tools profiles
|
|
70
|
+
|
|
71
|
+
# Show detailed profile state along with which data stores are available/missing
|
|
72
|
+
npx chrome-tools profiles states
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Saved Passwords
|
|
76
|
+
```bash
|
|
77
|
+
# List all website credentials across all profiles
|
|
78
|
+
npx chrome-tools passwords
|
|
79
|
+
|
|
80
|
+
# Filter credentials using a search term (matches URL or username)
|
|
81
|
+
npx chrome-tools passwords --search "gmail"
|
|
82
|
+
|
|
83
|
+
# Target a specific profile directory only
|
|
84
|
+
npx chrome-tools passwords --profile "Profile 1"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Bookmarks
|
|
88
|
+
```bash
|
|
89
|
+
# List all bookmarks
|
|
90
|
+
npx chrome-tools bookmarks
|
|
91
|
+
|
|
92
|
+
# Filter bookmarks inside folders containing "Travel"
|
|
93
|
+
npx chrome-tools bookmarks --folder "travel"
|
|
94
|
+
|
|
95
|
+
# Filter bookmarks by title or URL search term
|
|
96
|
+
npx chrome-tools bookmarks --search "github"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### History & Search Terms
|
|
100
|
+
```bash
|
|
101
|
+
# List last 100 browsing history entries
|
|
102
|
+
npx chrome-tools history
|
|
103
|
+
|
|
104
|
+
# Limit browsing history entries and search URL/Title
|
|
105
|
+
npx chrome-tools history --limit 50 --search "news"
|
|
106
|
+
|
|
107
|
+
# Extract search queries entered in the address bar
|
|
108
|
+
npx chrome-tools search-terms --limit 20
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Cookies
|
|
112
|
+
```bash
|
|
113
|
+
# List all cookies (decrypts secure cookie values via Keychain key)
|
|
114
|
+
npx chrome-tools cookies
|
|
115
|
+
|
|
116
|
+
# Filter cookies for a specific domain name
|
|
117
|
+
npx chrome-tools cookies --domain "google.com" --limit 30
|
|
118
|
+
|
|
119
|
+
# Skip decryption of encrypted values (fast metadata lookup)
|
|
120
|
+
npx chrome-tools cookies --no-decrypt
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Autofill, Credit Cards & Addresses
|
|
124
|
+
```bash
|
|
125
|
+
# List autocomplete text entries (e.g. form fields, text inputs)
|
|
126
|
+
npx chrome-tools autofill --limit 50
|
|
127
|
+
|
|
128
|
+
# List saved credit cards (decrypts credit card numbers)
|
|
129
|
+
npx chrome-tools credit-cards
|
|
130
|
+
|
|
131
|
+
# List saved autofill profile addresses (name, email, phone, address, city, zip)
|
|
132
|
+
npx chrome-tools addresses
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### Extensions & Diagnostics
|
|
136
|
+
```bash
|
|
137
|
+
# List installed extensions (name, version, ID, enabled state, and webstore source)
|
|
138
|
+
npx chrome-tools extensions
|
|
139
|
+
|
|
140
|
+
# List configured search engine keywords
|
|
141
|
+
npx chrome-tools search-engines
|
|
142
|
+
|
|
143
|
+
# List frequently visited top sites ordered by rank
|
|
144
|
+
npx chrome-tools top-sites
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Global Options
|
|
148
|
+
|
|
149
|
+
These options apply globally to all subcommands and can be placed anywhere in your command line:
|
|
150
|
+
|
|
151
|
+
- `--chrome-dir <path>`: Specify a custom Chrome User Data folder (e.g., a backed-up profile from another machine).
|
|
152
|
+
- `--profile <name>`: Limit operations to a single profile directory (e.g., `Default`, `Profile 1`).
|
|
153
|
+
- `--json`: Output strictly in JSON format (ideal for programmatic pipes or exporting to files).
|
|
154
|
+
- `--limit <number>`: Restrict the output results count (for history, autofill, cookies, etc.).
|
|
155
|
+
|
|
156
|
+
#### Custom Directory & JSON Examples
|
|
157
|
+
```bash
|
|
158
|
+
# Export bookmarks from a backed-up Chrome folder directly to a JSON file
|
|
159
|
+
npx chrome-tools bookmarks --chrome-dir "/path/to/backup/Chrome" --json > bookmarks.json
|
|
160
|
+
|
|
161
|
+
# Retrieve all history from a specific profile in JSON format
|
|
162
|
+
npx chrome-tools history --profile "Profile 2" --json --limit 10
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Library Import Guide (Programmatic API)
|
|
168
|
+
|
|
169
|
+
`chrome-tools` is written as a modern ES module. You can import any extraction or utility function directly into your custom Node.js projects.
|
|
170
|
+
|
|
171
|
+
### Full API Import
|
|
172
|
+
```javascript
|
|
173
|
+
import {
|
|
174
|
+
discoverProfiles,
|
|
175
|
+
getPasswords,
|
|
176
|
+
getBookmarks,
|
|
177
|
+
getHistory,
|
|
178
|
+
getCookies
|
|
179
|
+
} from "chrome-tools";
|
|
180
|
+
|
|
181
|
+
// 1. Discover active profiles
|
|
182
|
+
const profiles = discoverProfiles("/path/to/chrome/User Data");
|
|
183
|
+
console.log(profiles);
|
|
184
|
+
|
|
185
|
+
// 2. Fetch bookmarks programmatically
|
|
186
|
+
const githubBookmarks = getBookmarks({
|
|
187
|
+
chromeDir: "/path/to/chrome/User Data",
|
|
188
|
+
search: "github"
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// 3. Extract browsing history
|
|
192
|
+
const history = getHistory({ limit: 50 });
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Subpath Imports
|
|
196
|
+
For smaller footprints or isolated dependencies, you can import individual modules directly:
|
|
197
|
+
```javascript
|
|
198
|
+
import { getPasswords } from "chrome-tools/passwords";
|
|
199
|
+
import { getBookmarks } from "chrome-tools/bookmarks";
|
|
200
|
+
import { getHistory } from "chrome-tools/history";
|
|
201
|
+
|
|
202
|
+
// Example: Retrieve username and password for "chatgpt.com"
|
|
203
|
+
const credentials = getPasswords({ search: "chatgpt.com" });
|
|
204
|
+
for (const cred of credentials) {
|
|
205
|
+
console.log(`Profile: ${cred.profile}`);
|
|
206
|
+
console.log(`Username: ${cred.username}`);
|
|
207
|
+
console.log(`Password: ${cred.password}`);
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Available API Modules & Signatures
|
|
212
|
+
|
|
213
|
+
All core functions accept an options object with the following fields:
|
|
214
|
+
- `chromeDir` *(string)*: Custom Chrome User Data directory.
|
|
215
|
+
- `profile` *(string)*: Specific profile subdirectory name (e.g., `"Default"`).
|
|
216
|
+
- `search` *(string)*: Case-insensitive filter term.
|
|
217
|
+
- `limit` *(number)*: Maximum returned rows count.
|
|
218
|
+
|
|
219
|
+
| Function | Module Path | Returns |
|
|
220
|
+
| --- | --- | --- |
|
|
221
|
+
| `discoverProfiles(chromeDir)` | `chrome-tools` | `Array<{name, path}>` |
|
|
222
|
+
| `getProfileStates(chromeDir)` | `chrome-tools` | `Array<ProfileState>` |
|
|
223
|
+
| `getPasswords({chromeDir, profile, search})` | `chrome-tools/passwords` | `Array<Credentials>` |
|
|
224
|
+
| `getBookmarks({chromeDir, profile, folder, search})` | `chrome-tools/bookmarks` | `Array<Bookmark>` |
|
|
225
|
+
| `getHistory({chromeDir, profile, search, limit})` | `chrome-tools/history` | `Array<HistoryEntry>` |
|
|
226
|
+
| `getSearchTerms({chromeDir, profile, limit})` | `chrome-tools/history` | `Array<SearchTerm>` |
|
|
227
|
+
| `getCookies({chromeDir, profile, domain, decrypt, limit})` | `chrome-tools/cookies` | `Array<Cookie>` |
|
|
228
|
+
| `getAutofillEntries({chromeDir, profile, search, limit})` | `chrome-tools/autofill` | `Array<AutofillEntry>` |
|
|
229
|
+
| `getCreditCards({chromeDir, profile})` | `chrome-tools/autofill` | `Array<CreditCard>` |
|
|
230
|
+
| `getAddresses({chromeDir, profile})` | `chrome-tools/autofill` | `Array<Address>` |
|
|
231
|
+
| `getDownloads({chromeDir, profile, search, limit})` | `chrome-tools/downloads` | `Array<Download>` |
|
|
232
|
+
| `getExtensions({chromeDir, profile, search})` | `chrome-tools/extensions` | `Array<Extension>` |
|
|
233
|
+
| `getSearchEngines({chromeDir, profile})` | `chrome-tools/search-engines` | `Array<SearchEngine>` |
|
|
234
|
+
| `getTopSites({chromeDir, profile})` | `chrome-tools/top-sites` | `Array<TopSite>` |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Security Warning
|
|
239
|
+
|
|
240
|
+
This utility is designed strictly for authorized administrative audits, security diagnostics, and local credential migration. macOS will request explicit Keychain authorization before releasing the Chrome Safe Storage Password. Keep your local credentials safe, and only run this code in trusted development environments.
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
This project is licensed under the [MIT License](LICENSE).
|