n8n-nodes-soar 0.1.11 → 0.1.13

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.
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FofaCredentials", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FofaCredentials;
9
+ }
10
+ });
11
+ function _define_property(obj, key, value) {
12
+ if (key in obj) {
13
+ Object.defineProperty(obj, key, {
14
+ value: value,
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true
18
+ });
19
+ } else {
20
+ obj[key] = value;
21
+ }
22
+ return obj;
23
+ }
24
+ class FofaCredentials {
25
+ constructor(){
26
+ _define_property(this, "name", "fofaCredentialsApi");
27
+ _define_property(this, "displayName", "Fofa Credentials");
28
+ _define_property(this, "documentationUrl", "https://fofa.info/api");
29
+ _define_property(this, "icon", "file:fofa.svg");
30
+ _define_property(this, "properties", [
31
+ {
32
+ displayName: "Fofa Email",
33
+ name: "email",
34
+ type: "string",
35
+ placeholder: "name@email.com",
36
+ default: ""
37
+ },
38
+ {
39
+ displayName: "Fofa Key",
40
+ name: "key",
41
+ type: "string",
42
+ default: ""
43
+ }
44
+ ]);
45
+ _define_property(this, "authenticate", {
46
+ type: "generic",
47
+ properties: {
48
+ qs: {
49
+ email: "={{$credentials.email}}",
50
+ key: "={{$credentials.key}}"
51
+ }
52
+ }
53
+ });
54
+ _define_property(this, "test", {
55
+ request: {
56
+ url: "https://fofa.info/api/v1/info/my",
57
+ qs: {
58
+ email: "={{$credentials.email}}",
59
+ key: "={{$credentials.key}}"
60
+ }
61
+ }
62
+ });
63
+ }
64
+ }
@@ -0,0 +1,16 @@
1
+ <svg id="组_5" data-name="组 5" xmlns="http://www.w3.org/2000/svg" width="237" height="237" viewBox="0 -72 237 165">
2
+ <defs>
3
+ <style>
4
+ .cls-1,
5
+ .cls-2 {
6
+ fill-rule: evenodd;
7
+ }
8
+ </style>
9
+ </defs>
10
+ <path id="形状_2" data-name="形状 2"
11
+ d="M919.646,317.387H886.54A4.536,4.536,0,0,0,882,321.92h0a4.081,4.081,0,0,1,0,1.14v61.276a4.492,4.492,0,0,0,8.984,0V355.705h25.509a4.533,4.533,0,1,0,0-9.066H890.985V326.453h28.661a4.537,4.537,0,0,0,4.54-4.533h0A4.536,4.536,0,0,0,919.646,317.387Zm137.374,0h-33.11a4.535,4.535,0,0,0-4.54,4.533h0a4.081,4.081,0,0,1,0,1.14v61.276a4.49,4.49,0,0,0,8.98,0V355.705h25.51a4.533,4.533,0,1,0,0-9.066h-25.51V326.453h28.67a4.542,4.542,0,0,0,4.54-4.533h0A4.541,4.541,0,0,0,1057.02,317.387Zm61.7,65.072-22.77-61.633a4.4,4.4,0,0,0-4.01-3.017c-0.02,0-.04-0.006-0.06-0.006h-2.36a4.844,4.844,0,0,0-4.41,3.273l-22.63,61.352a4.529,4.529,0,0,0,2.71,5.813h0a4.543,4.543,0,0,0,5.82-2.705l5.44-14.9h28.29l5.45,14.934a4.542,4.542,0,0,0,5.82,2.7h0A4.527,4.527,0,0,0,1118.72,382.459Zm-38.95-20.892,10.82-29.628,10.83,29.628h-21.65ZM968.815,315.992a38,38,0,0,0-38.155,37.763A37.5,37.5,0,0,0,952.073,387.7a4.3,4.3,0,1,0,3.754-7.734,28.967,28.967,0,0,1-16.561-26.207,29.551,29.551,0,0,1,59.1,0,28.957,28.957,0,0,1-16.653,26.252,4.3,4.3,0,1,0,3.727,7.747A37.7,37.7,0,0,0,968.815,315.992Z"
12
+ transform="translate(-882 -316)" class="cls-1" style="fill: #05f2f2;"></path>
13
+ <path id="形状_3" data-name="形状 3"
14
+ d="M992.631,353.449c0-12.687-10.679-23.01-23.8-23.01s-23.8,10.323-23.8,23.01c0,11.255,8.4,20.642,19.464,22.621a4.675,4.675,0,0,0-.405,1.9v26.294A4.741,4.741,0,0,0,968.836,409h0a4.741,4.741,0,0,0,4.752-4.729V377.974a4.69,4.69,0,0,0-.406-1.907C984.234,374.083,992.631,364.7,992.631,353.449Zm-23.8,14.89c-8.625,0-15.642-6.68-15.642-14.89s7.017-14.889,15.642-14.889,15.642,6.68,15.642,14.889S977.452,368.339,968.827,368.339Z"
15
+ transform="translate(-882 -316)" class="cls-2" style="fill: #599af8;"></path>
16
+ </svg>
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Fofa", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return Fofa;
9
+ }
10
+ });
11
+ const _n8nworkflow = require("n8n-workflow");
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ class Fofa {
26
+ async execute() {
27
+ const result = [];
28
+ for(let idx = 0; idx < this.getInputData().length; idx++){
29
+ var _data;
30
+ const query = this.getNodeParameter("query", idx, "");
31
+ const page = this.getNodeParameter("page", idx, 1);
32
+ const size = this.getNodeParameter("size", idx, 100);
33
+ const full = this.getNodeParameter("full", idx, false);
34
+ const fields = this.getNodeParameter("fields", idx, "");
35
+ const data = await this.helpers.httpRequestWithAuthentication.call(this, "fofaCredentialsApi", {
36
+ method: "GET",
37
+ url: "https://fofa.info/api/v1/search/all",
38
+ qs: {
39
+ qbase64: Buffer.from(query).toString("base64"),
40
+ page,
41
+ size,
42
+ fields,
43
+ full
44
+ }
45
+ });
46
+ console.log(data);
47
+ if (data.error && !data.errmsg.includes("820031")) {
48
+ throw new _n8nworkflow.NodeOperationError(this.getNode(), `Fofa error response: ${data.errmsg}`);
49
+ }
50
+ (_data = data).results ?? (_data.results = []);
51
+ result.push(...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(data.results.map((item)=>Array.isArray(item) ? item : [
52
+ item
53
+ ]).map((item)=>Object.fromEntries(item.map((item, idx)=>[
54
+ fields.split(",")[idx],
55
+ item
56
+ ])))), {
57
+ itemData: {
58
+ item: idx
59
+ }
60
+ }));
61
+ }
62
+ return [
63
+ result
64
+ ];
65
+ }
66
+ constructor(){
67
+ _define_property(this, "description", {
68
+ displayName: "Soar: Fofa",
69
+ name: "fofa",
70
+ group: [
71
+ "output"
72
+ ],
73
+ version: 1,
74
+ icon: "file:fofa.svg",
75
+ subtitle: "={{ 'fofa' + $parameter['query'] }}",
76
+ description: "Interact with Fofa",
77
+ defaults: {
78
+ name: "Fofa"
79
+ },
80
+ inputs: [
81
+ "main"
82
+ ],
83
+ outputs: [
84
+ "main"
85
+ ],
86
+ credentials: [
87
+ {
88
+ name: "fofaCredentialsApi",
89
+ required: true
90
+ }
91
+ ],
92
+ properties: [
93
+ {
94
+ displayName: "Query",
95
+ name: "query",
96
+ type: "string",
97
+ default: ""
98
+ },
99
+ {
100
+ displayName: "Page",
101
+ name: "page",
102
+ type: "number",
103
+ default: 1
104
+ },
105
+ {
106
+ displayName: "Size",
107
+ name: "size",
108
+ type: "number",
109
+ default: 100
110
+ },
111
+ {
112
+ displayName: "Fields",
113
+ name: "fields",
114
+ type: "string",
115
+ default: "host,ip,port"
116
+ },
117
+ {
118
+ displayName: "Full",
119
+ name: "full",
120
+ type: "boolean",
121
+ default: false
122
+ }
123
+ ]
124
+ });
125
+ }
126
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "node": "n8n-nodes-soar.fofa",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Development",
7
+ "Container"
8
+ ]
9
+ }
@@ -0,0 +1,16 @@
1
+ <svg id="组_5" data-name="组 5" xmlns="http://www.w3.org/2000/svg" width="237" height="237" viewBox="0 -72 237 165">
2
+ <defs>
3
+ <style>
4
+ .cls-1,
5
+ .cls-2 {
6
+ fill-rule: evenodd;
7
+ }
8
+ </style>
9
+ </defs>
10
+ <path id="形状_2" data-name="形状 2"
11
+ d="M919.646,317.387H886.54A4.536,4.536,0,0,0,882,321.92h0a4.081,4.081,0,0,1,0,1.14v61.276a4.492,4.492,0,0,0,8.984,0V355.705h25.509a4.533,4.533,0,1,0,0-9.066H890.985V326.453h28.661a4.537,4.537,0,0,0,4.54-4.533h0A4.536,4.536,0,0,0,919.646,317.387Zm137.374,0h-33.11a4.535,4.535,0,0,0-4.54,4.533h0a4.081,4.081,0,0,1,0,1.14v61.276a4.49,4.49,0,0,0,8.98,0V355.705h25.51a4.533,4.533,0,1,0,0-9.066h-25.51V326.453h28.67a4.542,4.542,0,0,0,4.54-4.533h0A4.541,4.541,0,0,0,1057.02,317.387Zm61.7,65.072-22.77-61.633a4.4,4.4,0,0,0-4.01-3.017c-0.02,0-.04-0.006-0.06-0.006h-2.36a4.844,4.844,0,0,0-4.41,3.273l-22.63,61.352a4.529,4.529,0,0,0,2.71,5.813h0a4.543,4.543,0,0,0,5.82-2.705l5.44-14.9h28.29l5.45,14.934a4.542,4.542,0,0,0,5.82,2.7h0A4.527,4.527,0,0,0,1118.72,382.459Zm-38.95-20.892,10.82-29.628,10.83,29.628h-21.65ZM968.815,315.992a38,38,0,0,0-38.155,37.763A37.5,37.5,0,0,0,952.073,387.7a4.3,4.3,0,1,0,3.754-7.734,28.967,28.967,0,0,1-16.561-26.207,29.551,29.551,0,0,1,59.1,0,28.957,28.957,0,0,1-16.653,26.252,4.3,4.3,0,1,0,3.727,7.747A37.7,37.7,0,0,0,968.815,315.992Z"
12
+ transform="translate(-882 -316)" class="cls-1" style="fill: #05f2f2;"></path>
13
+ <path id="形状_3" data-name="形状 3"
14
+ d="M992.631,353.449c0-12.687-10.679-23.01-23.8-23.01s-23.8,10.323-23.8,23.01c0,11.255,8.4,20.642,19.464,22.621a4.675,4.675,0,0,0-.405,1.9v26.294A4.741,4.741,0,0,0,968.836,409h0a4.741,4.741,0,0,0,4.752-4.729V377.974a4.69,4.69,0,0,0-.406-1.907C984.234,374.083,992.631,364.7,992.631,353.449Zm-23.8,14.89c-8.625,0-15.642-6.68-15.642-14.89s7.017-14.889,15.642-14.889,15.642,6.68,15.642,14.889S977.452,368.339,968.827,368.339Z"
15
+ transform="translate(-882 -316)" class="cls-2" style="fill: #599af8;"></path>
16
+ </svg>
@@ -43,7 +43,7 @@ class Naabu {
43
43
  "options.optimization"
44
44
  ]
45
45
  });
46
- result.push(...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(JSON.parse(response.stdout)), {
46
+ result.push(...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(((d)=>d.split("\n").map((n)=>n.trim()).filter(Boolean).map((d)=>JSON.parse(d)))(response.stdout)), {
47
47
  itemData: {
48
48
  item: idx
49
49
  }
@@ -27,12 +27,10 @@ class Nuclei {
27
27
  const result = [];
28
28
  const executor = new _executor.SoarExecutor(this);
29
29
  for(let idx = 0; idx < this.getInputData().length; idx++){
30
- const response = await executor.run(idx, "nuclei", "", {
30
+ const response = await executor.run(idx, "nuclei", "-target", {
31
31
  extraArgs: [
32
32
  "-silent",
33
33
  "-jsonl",
34
- "-json-export",
35
- "-jsonl-export",
36
34
  "-disable-update-check"
37
35
  ],
38
36
  extraArgParameters: [
@@ -106,32 +104,17 @@ class Nuclei {
106
104
  displayName: "Options",
107
105
  name: "key",
108
106
  type: "options",
109
- default: "-ip-version",
107
+ default: "-scan-all-ips",
110
108
  options: [
111
- {
112
- name: "IP Version",
113
- value: "-ip-version",
114
- description: "IP version to scan of hostname (4,6) - (default 4) (string[])"
115
- },
116
- {
117
- name: "List",
118
- value: "-list",
119
- description: "Path to file containing a list of target URLs/hosts to scan (one per line) (string)"
120
- },
121
- {
122
- name: "Resume",
123
- value: "-resume",
124
- description: "Resume scan using resume.cfg (clustering will be disabled) (string)"
125
- },
126
109
  {
127
110
  name: "Scan All IPs",
128
111
  value: "-scan-all-ips",
129
112
  description: "Scan all the IP's associated with dns record"
130
113
  },
131
114
  {
132
- name: "Target",
133
- value: "-target",
134
- description: "Target URLs/hosts to scan (string[])"
115
+ name: "IP Version",
116
+ value: "-ip-version",
117
+ description: "IP version to scan of hostname (4,6) - (default 4) (string[])"
135
118
  }
136
119
  ]
137
120
  },
@@ -1035,7 +1018,7 @@ class Nuclei {
1035
1018
  }
1036
1019
  ]
1037
1020
  }
1038
- ])
1021
+ ], true)
1039
1022
  });
1040
1023
  }
1041
1024
  }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Tshark", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return Tshark;
9
+ }
10
+ });
11
+ const _executor = require("../../utils/executor");
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ class Tshark {
26
+ async execute() {
27
+ const result = [];
28
+ const executor = new _executor.SoarExecutor(this);
29
+ for(let idx = 0; idx < this.getInputData().length; idx++){
30
+ const binaryName = this.getNodeParameter("file", idx, "");
31
+ const filter = this.getNodeParameter("filter", idx, "");
32
+ const binaryDataBufferItem = await this.helpers.getBinaryDataBuffer(idx, binaryName);
33
+ const args = [
34
+ "-r",
35
+ "/tmp/data.pcap",
36
+ "-T",
37
+ "json"
38
+ ];
39
+ if (filter) {
40
+ args.push("-Y", filter);
41
+ }
42
+ const response = await executor.run(idx, "tshark", "", {
43
+ extraArgs: args,
44
+ extraArgParameters: [],
45
+ files: {
46
+ "/tmp/data.pcap": binaryDataBufferItem.toString("base64")
47
+ },
48
+ image: "registry.yoshino-s.xyz/yoshino-s/soar-image/traffic:dev"
49
+ });
50
+ result.push(...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(JSON.parse(response.stdout)), {
51
+ itemData: {
52
+ item: idx
53
+ }
54
+ }));
55
+ }
56
+ return [
57
+ result
58
+ ];
59
+ }
60
+ constructor(){
61
+ _define_property(this, "description", {
62
+ displayName: "Soar: Tshark",
63
+ name: "tshark",
64
+ group: [
65
+ "output"
66
+ ],
67
+ icon: "file:tshark.svg",
68
+ version: 1,
69
+ subtitle: "={{ 'tshark' + $parameter['file'] }}",
70
+ description: "Interact with Tshark",
71
+ defaults: {
72
+ name: "Tshark"
73
+ },
74
+ inputs: [
75
+ "main"
76
+ ],
77
+ outputs: [
78
+ "main"
79
+ ],
80
+ credentials: [
81
+ {
82
+ name: "dockerCredentialsApi"
83
+ },
84
+ {
85
+ name: "kubernetesCredentialsApi"
86
+ }
87
+ ],
88
+ properties: (0, _executor.injectCommonProperties)([
89
+ {
90
+ displayName: "File",
91
+ name: "file",
92
+ type: "string",
93
+ default: ""
94
+ },
95
+ {
96
+ displayName: "Filter",
97
+ name: "filter",
98
+ type: "string",
99
+ default: ""
100
+ }
101
+ ], false)
102
+ });
103
+ }
104
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "node": "n8n-nodes-soar.tshark",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Development",
7
+ "Container"
8
+ ]
9
+ }
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
3
+ <svg
4
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
5
+ xmlns:cc="http://web.resource.org/cc/"
6
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7
+ xmlns:svg="http://www.w3.org/2000/svg"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
10
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11
+ id="svg548"
12
+ sodipodi:version="0.32"
13
+ width="400"
14
+ height="400"
15
+ sodipodi:docbase="D:\dokumenty\kot"
16
+ sodipodi:docname="Wireshark_Logo.svg"
17
+ inkscape:version="0.44.1"
18
+ inkscape:export-filename="/home/gerald/devel/wsweb/wslogotrans800.png"
19
+ inkscape:export-xdpi="181.64000"
20
+ inkscape:export-ydpi="181.64000"
21
+ viewBox="0,-100,400,400"
22
+ version="1.0">
23
+ <metadata
24
+ id="metadata1317">
25
+ <rdf:RDF>
26
+ <cc:Work
27
+ rdf:about="">
28
+ <dc:format>image/svg+xml</dc:format>
29
+ <dc:type
30
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
31
+ </cc:Work>
32
+ </rdf:RDF>
33
+ </metadata>
34
+ <defs
35
+ id="defs550" />
36
+ <sodipodi:namedview
37
+ id="base"
38
+ showgrid="true"
39
+ showguides="true"
40
+ inkscape:zoom="2.3637177"
41
+ inkscape:cx="199.13001"
42
+ inkscape:cy="54.799999"
43
+ inkscape:window-width="1024"
44
+ inkscape:window-height="682"
45
+ inkscape:window-x="-4"
46
+ inkscape:window-y="-4"
47
+ inkscape:current-layer="svg548"
48
+ inkscape:guide-bbox="true"
49
+ width="398.26px"
50
+ height="109.6px" />
51
+ <path
52
+ transform="scale(0.947903,1.05496)"
53
+ style="font-size:96.08611298px;font-style:normal;font-weight:bold;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:black;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Luxi Sans"
54
+ d="M 14.318411,102.60584 L 2.1621622,56.793348 L 8.3809115,56.793348 L 15.349661,86.824594 C 16.099646,89.97044 16.745478,93.095437 17.28716,96.199593 C 18.45381,91.303772 19.141309,88.480858 19.34966,87.730844 L 28.068409,56.793348 L 35.380908,56.793348 L 41.943407,79.980845 C 43.589198,85.730861 44.776697,91.137105 45.505907,96.199593 C 46.089196,93.30377 46.849611,89.980857 47.787157,86.230845 L 54.974656,56.793348 L 61.068405,56.793348 L 48.505907,102.60584 L 42.662157,102.60584 L 33.005909,67.699597 C 32.193378,64.782968 31.714212,62.991304 31.568409,62.324597 C 31.089212,64.428802 30.641296,66.220467 30.224659,67.699597 L 20.50591,102.60584 L 14.318411,102.60584 z M 67.724654,102.60584 L 67.724654,56.793348 L 73.787153,56.793348 L 73.787153,102.60584 L 67.724654,102.60584 z M 84.537154,102.60584 L 84.537154,56.793348 L 104.84965,56.793348 C 108.93296,56.793394 112.03712,57.204852 114.16215,58.027723 C 116.28711,58.850683 117.98503,60.303807 119.2559,62.387097 C 120.52669,64.470469 121.16211,66.772549 121.16215,69.293347 C 121.16211,72.543376 120.11003,75.282957 118.0059,77.512096 C 115.9017,79.741285 112.6517,81.15795 108.2559,81.762095 C 109.86004,82.532948 111.07879,83.293364 111.91215,84.043345 C 113.68295,85.668362 115.36003,87.699609 116.9434,90.137094 L 124.91215,102.60584 L 117.28715,102.60584 L 111.22465,93.074594 C 109.45379,90.324606 107.99546,88.220442 106.84965,86.762094 C 105.70379,85.303779 104.67775,84.282946 103.77153,83.699595 C 102.86525,83.116281 101.94338,82.710032 101.0059,82.480845 C 100.31838,82.335032 99.193383,82.262115 97.630903,82.262095 L 90.599653,82.262095 L 90.599653,102.60584 L 84.537154,102.60584 z M 90.599653,77.012096 L 103.6309,77.012096 C 106.40171,77.012121 108.56837,76.725663 110.1309,76.152721 C 111.69337,75.579831 112.88087,74.663166 113.6934,73.402721 C 114.50587,72.142335 114.91212,70.772545 114.91215,69.293347 C 114.91212,67.126716 114.12566,65.345468 112.55278,63.949597 C 110.97983,62.553804 108.49546,61.855888 105.09965,61.855847 L 90.599653,61.855847 L 90.599653,77.012096 z M 130.8184,102.60584 L 130.8184,56.793348 L 163.94339,56.793348 L 163.94339,62.199597 L 136.8809,62.199597 L 136.8809,76.230846 L 162.22464,76.230846 L 162.22464,81.605845 L 136.8809,81.605845 L 136.8809,97.199593 L 165.00589,97.199593 L 165.00589,102.60584 L 130.8184,102.60584 z M 170.8184,87.699594 L 179.8184,86.824594 C 180.36005,89.84544 181.45901,92.064188 183.11527,93.480844 C 184.7715,94.897518 187.00588,95.60585 189.81839,95.605843 C 192.79754,95.60585 195.04233,94.975643 196.55277,93.715219 C 198.06316,92.454812 198.81836,90.980856 198.81839,89.293344 C 198.81836,88.210025 198.50066,87.288151 197.86527,86.52772 C 197.22982,85.76732 196.12045,85.105862 194.53714,84.543345 C 193.45379,84.168363 190.98504,83.501697 187.13089,82.543345 C 182.17255,81.3142 178.69339,79.803785 176.6934,78.012096 C 173.88089,75.49129 172.47464,72.418376 172.47465,68.793347 C 172.47464,66.46005 173.1361,64.27776 174.45902,62.246472 C 175.78193,60.215265 177.68818,58.668392 180.17777,57.605848 C 182.66734,56.543394 185.67254,56.012145 189.19339,56.012098 C 194.94337,56.012145 199.27149,57.27256 202.17777,59.793348 C 205.08398,62.314221 206.61002,65.678801 206.75589,69.887096 L 197.50589,70.293346 C 197.11003,67.939215 196.26107,66.246508 194.95902,65.215222 C 193.65691,64.184011 191.70379,63.668386 189.09964,63.668347 C 186.41213,63.668386 184.30796,64.220469 182.78715,65.324597 C 181.80797,66.032967 181.31838,66.980882 181.3184,68.168347 C 181.31838,69.251713 181.77672,70.178796 182.6934,70.949596 C 183.86005,71.928794 186.69338,72.949626 191.19339,74.012096 C 195.69337,75.074623 199.02149,76.173581 201.17777,77.308971 C 203.33398,78.444411 205.02148,79.996493 206.24027,81.96522 C 207.45898,83.933988 208.06835,86.366277 208.06839,89.262094 C 208.06835,91.887105 207.33919,94.345435 205.88089,96.637093 C 204.42252,98.928763 202.36003,100.63189 199.69339,101.74647 C 197.0267,102.86105 193.70379,103.41834 189.72464,103.41834 C 183.93296,103.41834 179.48505,102.0798 176.3809,99.402718 C 173.27673,96.725641 171.42256,92.824604 170.8184,87.699594 L 170.8184,87.699594 z M 215.9434,102.60584 L 215.9434,56.793348 L 225.1934,56.793348 L 225.1934,74.824596 L 243.31839,74.824596 L 243.31839,56.793348 L 252.56839,56.793348 L 252.56839,102.60584 L 243.31839,102.60584 L 243.31839,82.574595 L 225.1934,82.574595 L 225.1934,102.60584 L 215.9434,102.60584 z M 303.47463,102.60584 L 293.41213,102.60584 L 289.41213,92.199594 L 271.09963,92.199594 L 267.31838,102.60584 L 257.50588,102.60584 L 275.34963,56.793348 L 285.13088,56.793348 L 303.47463,102.60584 z M 286.44338,84.480845 L 280.13088,67.480847 L 273.94338,84.480845 L 286.44338,84.480845 z M 308.44338,102.60584 L 308.44338,56.793348 L 327.91213,56.793348 C 332.80793,56.793394 336.36522,57.204852 338.584,58.027723 C 340.80272,58.850683 342.57876,60.314223 343.91213,62.418347 C 345.24542,64.522552 345.91208,66.928799 345.91213,69.637097 C 345.91208,73.074626 344.90167,75.913164 342.88088,78.152721 C 340.86001,80.392326 337.83918,81.803783 333.81838,82.387095 C 335.81835,83.553781 337.46939,84.835029 338.7715,86.230845 C 340.07355,87.626693 341.82876,90.105857 344.03713,93.668344 L 349.63088,102.60584 L 338.56838,102.60584 L 331.88088,92.637094 C 329.50585,89.074608 327.88085,86.829819 327.00588,85.90272 C 326.13086,84.975654 325.20377,84.340238 324.22463,83.99647 C 323.24544,83.652739 321.69336,83.480864 319.56838,83.480845 L 317.69338,83.480845 L 317.69338,102.60584 L 308.44338,102.60584 z M 317.69338,76.168346 L 324.53713,76.168346 C 328.9746,76.168372 331.74543,75.980872 332.84963,75.605846 C 333.95376,75.230873 334.81835,74.585041 335.44338,73.668346 C 336.06835,72.751709 336.38085,71.605877 336.38088,70.230846 C 336.38085,68.689214 335.96939,67.444424 335.1465,66.496472 C 334.32356,65.548592 333.1621,64.949635 331.66213,64.699597 C 330.9121,64.595468 328.6621,64.543385 324.91213,64.543347 L 317.69338,64.543347 L 317.69338,76.168346 z M 354.78713,102.60584 L 354.78713,56.793348 L 364.03713,56.793348 L 364.03713,77.137096 L 382.72463,56.793348 L 395.16213,56.793348 L 377.91213,74.637096 L 396.09963,102.60584 L 384.13088,102.60584 L 371.53713,81.105845 L 364.03713,88.762094 L 364.03713,102.60584 L 354.78713,102.60584 z "
55
+ id="text555" />
56
+ <path
57
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:4.29723692;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
58
+ d="M 2.6508445,51.095312 L 159.58462,51.095312 C 159.58462,51.095312 163.65572,3.3100825 205.7239,2.6463925 C 192.15353,23.884272 204.926,51.162742 204.926,51.162742 L 395.60917,51.162742"
59
+ id="path1328"
60
+ sodipodi:nodetypes="ccccc"
61
+ inkscape:export-filename="/home/gerald/devel/wsweb/image/wslogo.png"
62
+ inkscape:export-xdpi="90.000000"
63
+ inkscape:export-ydpi="90.000000" />
64
+ </svg>
@@ -144,7 +144,7 @@ class SoarExecutor {
144
144
  }
145
145
  throw new _n8nworkflow.NodeOperationError(this.func.getNode(), "No credentials got returned!");
146
146
  }
147
- async run(idx, target, targetArg, { env = {}, files = {}, collectFiles = [], extraArgs = [], extraArgParameters = [] } = {}) {
147
+ async run(idx, target, targetArg, { env = {}, files = {}, collectFiles = [], extraArgs = [], extraArgParameters = [], image } = {}) {
148
148
  const runner = await this.getRunner(idx);
149
149
  const cmdline = [
150
150
  "/usr/local/bin/runner"
@@ -161,19 +161,8 @@ class SoarExecutor {
161
161
  ])));
162
162
  const _collectFiles = this.func.getNodeParameter("advanced.collectFiles", idx, []);
163
163
  collectFiles = collectFiles.concat(_collectFiles.map(({ name })=>name));
164
- let targets = [];
165
- if (this.func.getNodeParameter("batch", idx)) {
166
- targets = this.func.getNodeParameter("targets", idx, []);
167
- if (!Array.isArray(targets) || targets.every((t)=>typeof t !== "string")) {
168
- throw new _n8nworkflow.NodeOperationError(this.func.getNode(), "Invalid targets");
169
- }
170
- } else {
171
- targets = [
172
- this.func.getNodeParameter("target", idx, "")
173
- ];
174
- }
175
164
  for (const [key, value] of Object.entries(files)){
176
- cmdline.push("--files", `${key}:${btoa(value)}`);
165
+ cmdline.push("--files", `${key}:${value}`);
177
166
  }
178
167
  for (const key of collectFiles){
179
168
  cmdline.push("--collect-files", key);
@@ -184,6 +173,17 @@ class SoarExecutor {
184
173
  ...extraArgs
185
174
  ];
186
175
  if (targetArg) {
176
+ let targets = [];
177
+ if (this.func.getNodeParameter("batch", idx)) {
178
+ targets = this.func.getNodeParameter("targets", idx, []);
179
+ if (!Array.isArray(targets) || targets.every((t)=>typeof t !== "string")) {
180
+ throw new _n8nworkflow.NodeOperationError(this.func.getNode(), "Invalid targets");
181
+ }
182
+ } else {
183
+ targets = [
184
+ this.func.getNodeParameter("target", idx, "")
185
+ ];
186
+ }
187
187
  cmdd.push(...targets.flatMap((target)=>[
188
188
  targetArg,
189
189
  target
@@ -213,7 +213,7 @@ class SoarExecutor {
213
213
  cmdline.push(cmd);
214
214
  }
215
215
  this.func.logger.debug("Running " + cmdline.join(" "));
216
- const { stdout, stderr, err, files: resultFiles } = await runner.run(cmdline, env);
216
+ const { stdout, stderr, err, files: resultFiles } = await runner.run(cmdline, env, image);
217
217
  if (err) {
218
218
  throw new _n8nworkflow.NodeOperationError(this.func.getNode(), stderr);
219
219
  }
@@ -31,7 +31,7 @@ function _interop_require_default(obj) {
31
31
  };
32
32
  }
33
33
  class DockerRuneer {
34
- async run(cmd, env) {
34
+ async run(cmd, env, image = _runner.IMAGE) {
35
35
  let stdout = "";
36
36
  let stderr = "";
37
37
  const outStream = new _nodestream.Writable({
@@ -46,18 +46,19 @@ class DockerRuneer {
46
46
  done();
47
47
  }
48
48
  });
49
- await this.docker.pull(_runner.IMAGE);
50
- await this.docker.run(_runner.IMAGE, cmd, [
49
+ await this.docker.pull(image);
50
+ await this.docker.run(image, cmd, [
51
51
  outStream,
52
52
  errStream
53
53
  ], {
54
54
  Tty: false,
55
55
  HostConfig: {
56
- AutoRemove: true
56
+ AutoRemove: false
57
57
  },
58
58
  Env: Object.entries(env || {}).map(([key, value])=>`${key}=${value}`)
59
59
  }, {});
60
60
  stderr;
61
+ console.log(stderr, stdout);
61
62
  return JSON.parse(stdout);
62
63
  }
63
64
  constructor(credentials, func){
@@ -65,7 +65,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
65
65
  return newObj;
66
66
  }
67
67
  class K8sRunner {
68
- async run(cmd, env) {
68
+ async run(cmd, env, image = _runner.IMAGE) {
69
69
  const kc = this.kubeConfig;
70
70
  const k8sCoreApi = kc.makeApiClient(_clientnode.CoreV1Api);
71
71
  const watch = new _clientnode.Watch(kc);
@@ -79,7 +79,7 @@ class K8sRunner {
79
79
  containers: [
80
80
  {
81
81
  name: "main-container",
82
- image: _runner.IMAGE,
82
+ image,
83
83
  imagePullPolicy: "Always",
84
84
  args: cmd,
85
85
  env: Object.entries(env ?? {}).map(([name, value])=>({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-soar",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"
@@ -34,6 +34,9 @@
34
34
  ],
35
35
  "n8n": {
36
36
  "n8nNodesApiVersion": 1,
37
+ "credentials": [
38
+ "dist/credentials/FofaCredentials.credentials.js"
39
+ ],
37
40
  "nodes": [
38
41
  "dist/nodes/Uncover/Uncover.node.js",
39
42
  "dist/nodes/Cdncheck/Cdncheck.node.js",
@@ -41,7 +44,9 @@
41
44
  "dist/nodes/Nuclei/Nuclei.node.js",
42
45
  "dist/nodes/Httpx/Httpx.node.js",
43
46
  "dist/nodes/Subfinder/Subfinder.node.js",
44
- "dist/nodes/Katana/Katana.node.js"
47
+ "dist/nodes/Katana/Katana.node.js",
48
+ "dist/nodes/Fofa/Fofa.node.js",
49
+ "dist/nodes/Tshark/Tshark.node.js"
45
50
  ]
46
51
  },
47
52
  "devDependencies": {
@@ -95,6 +100,7 @@
95
100
  "header": "# Changelog\n\n"
96
101
  },
97
102
  "dependencies": {
103
+ "axios": "^1.5.0",
98
104
  "dockerode": "^3.3.5",
99
105
  "inquirer": "^9.2.11",
100
106
  "n8n-nodes-container": "^0.1.8"