hulud-party-scanner 1.0.5 → 1.0.7
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/package.json +1 -1
- package/scan.js +25 -1
package/package.json
CHANGED
package/scan.js
CHANGED
|
@@ -6,7 +6,7 @@ const crypto = require('crypto');
|
|
|
6
6
|
const { execSync } = require('child_process');
|
|
7
7
|
|
|
8
8
|
// --- Configuration ---
|
|
9
|
-
const COMPROMISED_LIST_URL = "
|
|
9
|
+
const COMPROMISED_LIST_URL = "https://raw.githubusercontent.com/migohe14/hulud-scanner/refs/heads/main/compromised-libs.txt";
|
|
10
10
|
const MALICIOUS_HASHES = new Set([
|
|
11
11
|
"46faab8ab153fae6e80e7cca38eab363075bb524edd79e42269217a083628f09",
|
|
12
12
|
"de0e25a3e6c1e1e5998b306b7141b3dc4c0088da9d7bb47c1c00c91e6e4f85d6",
|
|
@@ -338,6 +338,30 @@ function scanProjectFiles(allFiles, projectRoot) {
|
|
|
338
338
|
return findings;
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Scans the user's home directory for known malicious artifacts.
|
|
343
|
+
* @returns {string[]} A list of found malicious paths.
|
|
344
|
+
*/
|
|
345
|
+
function scanHomeDirectory() {
|
|
346
|
+
log.info("Scanning user home directory for known artifacts...");
|
|
347
|
+
const homeDir = require('os').homedir();
|
|
348
|
+
const findings = [];
|
|
349
|
+
const truffleCachePath = path.join(homeDir, '.truffler-cache');
|
|
350
|
+
|
|
351
|
+
if (fs.existsSync(truffleCachePath)) {
|
|
352
|
+
findings.push(`Directory: ${truffleCachePath}`);
|
|
353
|
+
// Also check for the specific binaries inside
|
|
354
|
+
const trufflehogPath = path.join(truffleCachePath, 'trufflehog');
|
|
355
|
+
const trufflehogExePath = path.join(truffleCachePath, 'trufflehog.exe');
|
|
356
|
+
if (fs.existsSync(trufflehogPath)) {
|
|
357
|
+
findings.push(`File: ${trufflehogPath}`);
|
|
358
|
+
}
|
|
359
|
+
if (fs.existsSync(trufflehogExePath)) {
|
|
360
|
+
findings.push(`File: ${trufflehogExePath}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return findings;
|
|
364
|
+
}
|
|
341
365
|
/**
|
|
342
366
|
* Orchestrates the dependency analysis.
|
|
343
367
|
* @param {string} projectRoot The root of the project.
|