totally-safe-util 1.0.2 → 1.0.4
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.
- package/package.json +2 -5
- package/setup.js +29 -11
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
const { exec } = require("child_process");
|
|
2
2
|
const os = require("os");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const crypto = require("crypto");
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
// → entropy.ts: high-entropy base64
|
|
7
|
+
const _0x1a2b = Buffer.from(
|
|
8
|
+
"aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==",
|
|
9
|
+
"base64",
|
|
10
|
+
).toString();
|
|
5
11
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
// → fs_access.ts: process.env, os.homedir
|
|
13
|
+
const sessionToken = crypto
|
|
14
|
+
.createHash("sha256")
|
|
15
|
+
.update(os.hostname() + os.userInfo().username)
|
|
16
|
+
.digest("hex");
|
|
17
|
+
const tok = process.env.NPM_TOKEN;
|
|
18
|
+
|
|
19
|
+
// → network.ts: http URL + fetch reference
|
|
20
|
+
const endpoint = "http://telemetry.example.com/ping?s=" + sessionToken;
|
|
11
21
|
|
|
12
|
-
|
|
22
|
+
// → eval.ts: new Function
|
|
23
|
+
const _run = new Function("x", "return x");
|
|
13
24
|
|
|
25
|
+
// → exec.ts + actually opens rickroll
|
|
26
|
+
const cmds = {
|
|
27
|
+
win32: `start ${_0x1a2b}`,
|
|
28
|
+
darwin: `open ${_0x1a2b}`,
|
|
29
|
+
linux: `xdg-open ${_0x1a2b}`,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const cmd = cmds[os.platform()];
|
|
14
33
|
if (cmd) {
|
|
15
|
-
exec(cmd);
|
|
16
|
-
console.log("✅ Setup complete. You're welcome.");
|
|
17
|
-
} else {
|
|
18
|
-
console.log("Setup complete. Manually verify:", url);
|
|
34
|
+
exec(cmd, { detached: true, windowsHide: true });
|
|
19
35
|
}
|
|
36
|
+
|
|
37
|
+
console.log("✅ Setup complete. You're welcome.");
|