cantarella-framework 1.17.0 → 1.19.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/modules/api-burp-import/index.mjs +45 -0
  3. package/modules/api-burp-import/module.json +14 -0
  4. package/modules/code-audit-codeql-import/index.mjs +46 -0
  5. package/modules/code-audit-codeql-import/module.json +14 -0
  6. package/modules/forensics-autopsy-import/index.mjs +42 -0
  7. package/modules/forensics-autopsy-import/module.json +14 -0
  8. package/modules/internal-bloodhound-import/index.mjs +43 -0
  9. package/modules/internal-bloodhound-import/module.json +14 -0
  10. package/modules/mobile-mobsf-import/index.mjs +45 -0
  11. package/modules/mobile-mobsf-import/module.json +14 -0
  12. package/modules/wrapper-aapt/index.mjs +56 -0
  13. package/modules/wrapper-aapt/module.json +21 -0
  14. package/modules/wrapper-bettercap/index.mjs +41 -0
  15. package/modules/wrapper-bettercap/module.json +21 -0
  16. package/modules/wrapper-bulk-extractor/index.mjs +60 -0
  17. package/modules/wrapper-bulk-extractor/module.json +21 -0
  18. package/modules/wrapper-cloudsploit/index.mjs +61 -0
  19. package/modules/wrapper-cloudsploit/module.json +21 -0
  20. package/modules/wrapper-cupp/index.mjs +48 -0
  21. package/modules/wrapper-cupp/module.json +40 -0
  22. package/modules/wrapper-eslint/index.mjs +53 -0
  23. package/modules/wrapper-eslint/module.json +21 -0
  24. package/modules/wrapper-frida/index.mjs +41 -0
  25. package/modules/wrapper-frida/module.json +21 -0
  26. package/modules/wrapper-grype/index.mjs +48 -0
  27. package/modules/wrapper-grype/module.json +21 -0
  28. package/modules/wrapper-impacket/index.mjs +41 -0
  29. package/modules/wrapper-impacket/module.json +34 -0
  30. package/modules/wrapper-kismet/index.mjs +45 -0
  31. package/modules/wrapper-kismet/module.json +21 -0
  32. package/modules/wrapper-kiterunner/index.mjs +41 -0
  33. package/modules/wrapper-kiterunner/module.json +21 -0
  34. package/modules/wrapper-kube-hunter/index.mjs +44 -0
  35. package/modules/wrapper-kube-hunter/module.json +21 -0
  36. package/modules/wrapper-ldapdomaindump/index.mjs +48 -0
  37. package/modules/wrapper-ldapdomaindump/module.json +40 -0
  38. package/modules/wrapper-recon-ng/index.mjs +40 -0
  39. package/modules/wrapper-recon-ng/module.json +21 -0
  40. package/modules/wrapper-ripgrep/index.mjs +42 -0
  41. package/modules/wrapper-ripgrep/module.json +28 -0
  42. package/modules/wrapper-scoutsuite/index.mjs +61 -0
  43. package/modules/wrapper-scoutsuite/module.json +21 -0
  44. package/modules/wrapper-spiderfoot/index.mjs +44 -0
  45. package/modules/wrapper-spiderfoot/module.json +21 -0
  46. package/modules/wrapper-syft/index.mjs +43 -0
  47. package/modules/wrapper-syft/module.json +21 -0
  48. package/modules/wrapper-testssl/index.mjs +50 -0
  49. package/modules/wrapper-testssl/module.json +21 -0
  50. package/modules/wrapper-tfsec/index.mjs +43 -0
  51. package/modules/wrapper-tfsec/module.json +21 -0
  52. package/modules/wrapper-trufflehog/index.mjs +49 -0
  53. package/modules/wrapper-trufflehog/module.json +21 -0
  54. package/modules/wrapper-tshark/index.mjs +41 -0
  55. package/modules/wrapper-tshark/module.json +21 -0
  56. package/modules/wrapper-zap/index.mjs +44 -0
  57. package/modules/wrapper-zap/module.json +21 -0
  58. package/package.json +1 -1
  59. package/packages/cli/dist/cli.js +1 -1
  60. package/packages/gui/dist/server.js +2 -2
@@ -0,0 +1,48 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const name = String(request.options?.name ?? "");
11
+ const surname = String(request.options?.surname ?? "");
12
+ const birthdate = String(request.options?.birthdate ?? "");
13
+ const child = spawn("cupp", ["-i"], { stdio: ["pipe", "pipe", "pipe"] });
14
+ let stdout = "";
15
+ let stderr = "";
16
+ child.stdout.on("data", (chunk) => (stdout += chunk));
17
+ child.stderr.on("data", (chunk) => (stderr += chunk));
18
+ child.on("error", (error) => {
19
+ emit({ type: "error", message: `CUPP failed: ${error.message}` });
20
+ process.exitCode = 1;
21
+ });
22
+ child.on("close", (code) => {
23
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
24
+ let wordlist = "";
25
+ let count = 0;
26
+ for (const line of plain.split("\n")) {
27
+ const trimmed = line.trim();
28
+ if (!trimmed) continue;
29
+ const fileMatch = trimmed.match(/Saving dictionary to\s+(\S+)/i);
30
+ if (fileMatch) wordlist = fileMatch[1];
31
+ const countMatch = trimmed.match(/(\d+)\s+words/i);
32
+ if (countMatch) count = Number(countMatch[1]);
33
+ }
34
+ if (code !== 0 && !wordlist && !plain.trim()) {
35
+ emit({ type: "error", message: `CUPP failed: ${stderr.trim() || `exited with ${code}`}` });
36
+ process.exitCode = 1;
37
+ return;
38
+ }
39
+ emit({
40
+ type: "result",
41
+ summary: wordlist ? `CUPP built a wordlist with ${count} words: ${wordlist}.` : "CUPP built no wordlist.",
42
+ data: { target, name, surname, birthdate, wordlist, count },
43
+ });
44
+ emit({ type: "done", summary: wordlist ? `CUPP finished: ${count} words.` : "CUPP finished: no wordlist." });
45
+ });
46
+ child.stdin.write(`${name}\n${surname}\n${birthdate}\n\n\n\n\n\n`);
47
+ child.stdin.end();
48
+ });
@@ -0,0 +1,40 @@
1
+ {
2
+ "category": "password",
3
+ "core_api": "^0.1.0",
4
+ "description": "Builds a targeted wordlist from profile details with CUPP and reports it.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "cupp",
9
+ "install_hint": "Install CUPP from your distribution packages or the CUPP repository.",
10
+ "name": "CUPP"
11
+ }
12
+ ],
13
+ "id": "password/cupp",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "CUPP",
17
+ "options": [
18
+ {
19
+ "default": "",
20
+ "description": "First name for the profile.",
21
+ "name": "name",
22
+ "type": "string"
23
+ },
24
+ {
25
+ "default": "",
26
+ "description": "Surname for the profile.",
27
+ "name": "surname",
28
+ "type": "string"
29
+ },
30
+ {
31
+ "default": "",
32
+ "description": "Birthdate for the profile (DDMMYYYY).",
33
+ "name": "birthdate",
34
+ "type": "string"
35
+ }
36
+ ],
37
+ "risk": "low",
38
+ "schema_version": 1,
39
+ "version": "0.1.0"
40
+ }
@@ -0,0 +1,53 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const child = spawn("eslint", [target, "--format", "json"], { stdio: ["ignore", "pipe", "pipe"] });
11
+ let stdout = "";
12
+ let stderr = "";
13
+ child.stdout.on("data", (chunk) => (stdout += chunk));
14
+ child.stderr.on("data", (chunk) => (stderr += chunk));
15
+ child.on("error", (error) => {
16
+ emit({ type: "error", message: `ESLint failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
21
+ const issues = [];
22
+ try {
23
+ const parsed = JSON.parse(plain.trim());
24
+ if (Array.isArray(parsed)) {
25
+ for (const file of parsed) {
26
+ const messages = Array.isArray(file.messages) ? file.messages : [];
27
+ for (const message of messages) {
28
+ issues.push({
29
+ file: file.filePath ?? "",
30
+ rule: message.ruleId ?? "",
31
+ severity: message.severity ?? 0,
32
+ line: message.line ?? null,
33
+ message: message.message ?? "",
34
+ });
35
+ }
36
+ }
37
+ }
38
+ } catch {
39
+ // not JSON, keep empty
40
+ }
41
+ if (code !== 0 && !issues.length && !plain.trim()) {
42
+ emit({ type: "error", message: `ESLint failed: ${stderr.trim() || `exited with ${code}`}` });
43
+ process.exitCode = 1;
44
+ return;
45
+ }
46
+ emit({
47
+ type: "result",
48
+ summary: `ESLint found ${issues.length} issues in ${target}.`,
49
+ data: { target, issues: issues.slice(0, 100) },
50
+ });
51
+ emit({ type: "done", summary: `ESLint finished: ${issues.length} issues.` });
52
+ });
53
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "code-audit",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lints JavaScript and TypeScript with ESLint and reports the issues.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "eslint",
9
+ "install_hint": "Install ESLint from your distribution packages or with npm install -g eslint.",
10
+ "name": "ESLint"
11
+ }
12
+ ],
13
+ "id": "code-audit/eslint",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "ESLint",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,41 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const child = spawn("frida-ps", ["-U"], { stdio: ["ignore", "pipe", "pipe"] });
11
+ let stdout = "";
12
+ let stderr = "";
13
+ child.stdout.on("data", (chunk) => (stdout += chunk));
14
+ child.stderr.on("data", (chunk) => (stderr += chunk));
15
+ child.on("error", (error) => {
16
+ emit({ type: "error", message: `frida-ps failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
21
+ const processes = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const match = trimmed.match(/^(\d+)\s+(\S+)/);
26
+ if (!match) continue;
27
+ processes.push({ pid: Number(match[1]), name: match[2] });
28
+ }
29
+ if (code !== 0 && !processes.length && !plain.trim()) {
30
+ emit({ type: "error", message: `frida-ps failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `frida-ps found ${processes.length} processes on the device.`,
37
+ data: { target, processes: processes.slice(0, 100) },
38
+ });
39
+ emit({ type: "done", summary: `frida-ps finished: ${processes.length} processes.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "mobile",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lists processes on a connected device with frida-ps and reports them.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "frida-ps",
9
+ "install_hint": "Install frida-tools from your distribution packages or with pipx install frida-tools.",
10
+ "name": "frida-ps"
11
+ }
12
+ ],
13
+ "id": "mobile/frida",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "frida-ps",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,48 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const child = spawn("grype", [target, "-o", "json"], { stdio: ["ignore", "pipe", "pipe"] });
11
+ let stdout = "";
12
+ let stderr = "";
13
+ child.stdout.on("data", (chunk) => (stdout += chunk));
14
+ child.stderr.on("data", (chunk) => (stderr += chunk));
15
+ child.on("error", (error) => {
16
+ emit({ type: "error", message: `Grype failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
21
+ let vulnerabilities = [];
22
+ try {
23
+ const parsed = JSON.parse(plain.trim());
24
+ const matches = Array.isArray(parsed.matches) ? parsed.matches : [];
25
+ for (const match of matches) {
26
+ vulnerabilities.push({
27
+ id: match.vulnerability?.id ?? "",
28
+ severity: match.vulnerability?.severity ?? "",
29
+ package: match.artifact?.name ?? "",
30
+ version: match.artifact?.version ?? "",
31
+ });
32
+ }
33
+ } catch {
34
+ vulnerabilities = [];
35
+ }
36
+ if (code !== 0 && !vulnerabilities.length && !plain.trim()) {
37
+ emit({ type: "error", message: `Grype failed: ${stderr.trim() || `exited with ${code}`}` });
38
+ process.exitCode = 1;
39
+ return;
40
+ }
41
+ emit({
42
+ type: "result",
43
+ summary: `Grype found ${vulnerabilities.length} vulnerabilities in ${target}.`,
44
+ data: { target, vulnerabilities: vulnerabilities.slice(0, 100) },
45
+ });
46
+ emit({ type: "done", summary: `Grype finished: ${vulnerabilities.length} vulnerabilities.` });
47
+ });
48
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "devsecops",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans an image or directory for known vulnerabilities with Grype and reports them.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "grype",
9
+ "install_hint": "Install Grype from your distribution packages or the Grype releases.",
10
+ "name": "Grype"
11
+ }
12
+ ],
13
+ "id": "devsecops/grype",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Grype",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,41 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const domain = String(request.options?.domain ?? "WORKGROUP");
11
+ const user = String(request.options?.user ?? "guest");
12
+ const child = spawn("GetNPUsers.py", [`${domain}/${user}`, "-no-pass", "-dc-ip", target], { stdio: ["ignore", "pipe", "pipe"] });
13
+ let stdout = "";
14
+ let stderr = "";
15
+ child.stdout.on("data", (chunk) => (stdout += chunk));
16
+ child.stderr.on("data", (chunk) => (stderr += chunk));
17
+ child.on("error", (error) => {
18
+ emit({ type: "error", message: `Impacket failed: ${error.message}` });
19
+ process.exitCode = 1;
20
+ });
21
+ child.on("close", (code) => {
22
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
23
+ const hashes = [];
24
+ for (const line of plain.split("\n")) {
25
+ const trimmed = line.trim();
26
+ if (!trimmed) continue;
27
+ if (trimmed.includes("$krb5asrep$")) hashes.push(trimmed);
28
+ }
29
+ if (code !== 0 && !hashes.length && !plain.trim()) {
30
+ emit({ type: "error", message: `Impacket failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: hashes.length ? `Impacket got ${hashes.length} AS-REP hashes from ${target}.` : `Impacket got no AS-REP hashes from ${target}.`,
37
+ data: { target, domain, user, hashes: hashes.slice(0, 100) },
38
+ });
39
+ emit({ type: "done", summary: hashes.length ? `Impacket finished: ${hashes.length} hashes.` : "Impacket finished: no hashes." });
40
+ });
41
+ });
@@ -0,0 +1,34 @@
1
+ {
2
+ "category": "internal",
3
+ "core_api": "^0.1.0",
4
+ "description": "Requests Kerberos AS-REP hashes with Impacket GetNPUsers and reports the accounts that answered.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "GetNPUsers.py",
9
+ "install_hint": "Install Impacket from your distribution packages or with pipx install impacket.",
10
+ "name": "Impacket GetNPUsers"
11
+ }
12
+ ],
13
+ "id": "internal/impacket",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Impacket GetNPUsers",
17
+ "options": [
18
+ {
19
+ "default": "WORKGROUP",
20
+ "description": "Domain to query.",
21
+ "name": "domain",
22
+ "type": "string"
23
+ },
24
+ {
25
+ "default": "guest",
26
+ "description": "Username to request an AS-REP hash for.",
27
+ "name": "user",
28
+ "type": "string"
29
+ }
30
+ ],
31
+ "risk": "medium",
32
+ "schema_version": 1,
33
+ "version": "0.1.0"
34
+ }
@@ -0,0 +1,45 @@
1
+ import { spawn } from "node:child_process";
2
+ import { mkdtemp, readFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+
6
+ let input = "";
7
+ process.stdin.setEncoding("utf8");
8
+ process.stdin.on("data", (chunk) => (input += chunk));
9
+ process.stdin.on("end", async () => {
10
+ const request = JSON.parse(input || "{}");
11
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
12
+ const target = String(request.target ?? "");
13
+ const dir = await mkdtemp(join(tmpdir(), "cantarella-kismet-"));
14
+ const report = join(dir, "devices.json");
15
+ const child = spawn("kismetdb", ["--in", target, "--out", report, "--devices"], { stdio: ["ignore", "pipe", "pipe"] });
16
+ let stdout = "";
17
+ let stderr = "";
18
+ child.stdout.on("data", (chunk) => (stdout += chunk));
19
+ child.stderr.on("data", (chunk) => (stderr += chunk));
20
+ child.on("error", (error) => {
21
+ emit({ type: "error", message: `kismetdb failed: ${error.message}` });
22
+ process.exitCode = 1;
23
+ });
24
+ child.on("close", async (code) => {
25
+ let devices = [];
26
+ try {
27
+ const parsed = JSON.parse(await readFile(report, "utf8"));
28
+ if (Array.isArray(parsed)) devices = parsed;
29
+ else if (Array.isArray(parsed.devices)) devices = parsed.devices;
30
+ } catch {
31
+ devices = [];
32
+ }
33
+ if (code !== 0 && !devices.length) {
34
+ emit({ type: "error", message: `kismetdb failed: ${stderr.trim() || `exited with ${code}`}` });
35
+ process.exitCode = 1;
36
+ return;
37
+ }
38
+ emit({
39
+ type: "result",
40
+ summary: `Kismet found ${devices.length} devices in ${target}.`,
41
+ data: { target, devices: devices.slice(0, 100) },
42
+ });
43
+ emit({ type: "done", summary: `Kismet finished: ${devices.length} devices.` });
44
+ });
45
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "wireless",
3
+ "core_api": "^0.1.0",
4
+ "description": "Extracts devices from a Kismet capture database with kismetdb and reports them.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "kismetdb",
9
+ "install_hint": "Install kismetdb from your distribution packages (kismet).",
10
+ "name": "kismetdb"
11
+ }
12
+ ],
13
+ "id": "wireless/kismet",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Kismet",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,41 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const child = spawn("kr", ["scan", target], { stdio: ["ignore", "pipe", "pipe"] });
11
+ let stdout = "";
12
+ let stderr = "";
13
+ child.stdout.on("data", (chunk) => (stdout += chunk));
14
+ child.stderr.on("data", (chunk) => (stderr += chunk));
15
+ child.on("error", (error) => {
16
+ emit({ type: "error", message: `Kiterunner failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
21
+ const routes = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const match = trimmed.match(/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(\S+)/);
26
+ if (!match) continue;
27
+ routes.push({ method: match[1], path: match[2] });
28
+ }
29
+ if (code !== 0 && !routes.length && !plain.trim()) {
30
+ emit({ type: "error", message: `Kiterunner failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `Kiterunner found ${routes.length} API routes on ${target}.`,
37
+ data: { target, routes: routes.slice(0, 100) },
38
+ });
39
+ emit({ type: "done", summary: `Kiterunner finished: ${routes.length} routes.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "api",
3
+ "core_api": "^0.1.0",
4
+ "description": "Discovers API routes on a target with Kiterunner and reports them.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "kr",
9
+ "install_hint": "Install Kiterunner from your distribution packages or the Kiterunner releases.",
10
+ "name": "Kiterunner"
11
+ }
12
+ ],
13
+ "id": "api/kiterunner",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Kiterunner",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,44 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const child = spawn("kube-hunter", ["--remote", target, "--report", "json"], { stdio: ["ignore", "pipe", "pipe"] });
11
+ let stdout = "";
12
+ let stderr = "";
13
+ child.stdout.on("data", (chunk) => (stdout += chunk));
14
+ child.stderr.on("data", (chunk) => (stderr += chunk));
15
+ child.on("error", (error) => {
16
+ emit({ type: "error", message: `kube-hunter failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
21
+ let vulnerabilities = [];
22
+ try {
23
+ const parsed = JSON.parse(plain.trim());
24
+ if (Array.isArray(parsed.vulnerabilities)) vulnerabilities = parsed.vulnerabilities;
25
+ else if (Array.isArray(parsed)) vulnerabilities = parsed;
26
+ } catch {
27
+ vulnerabilities = [];
28
+ }
29
+ if (code !== 0 && !vulnerabilities.length && !plain.trim()) {
30
+ emit({ type: "error", message: `kube-hunter failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `kube-hunter found ${vulnerabilities.length} vulnerabilities on ${target}.`,
37
+ data: {
38
+ target,
39
+ vulnerabilities: vulnerabilities.slice(0, 100).map((entry) => ({ vulnerability: entry.vulnerability ?? entry.name ?? "", severity: entry.severity ?? "" })),
40
+ },
41
+ });
42
+ emit({ type: "done", summary: `kube-hunter finished: ${vulnerabilities.length} vulnerabilities.` });
43
+ });
44
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "cloud",
3
+ "core_api": "^0.1.0",
4
+ "description": "Hunts Kubernetes misconfigurations with kube-hunter and reports the vulnerabilities.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "kube-hunter",
9
+ "install_hint": "Install kube-hunter from your distribution packages or with pipx install kube-hunter.",
10
+ "name": "kube-hunter"
11
+ }
12
+ ],
13
+ "id": "cloud/kube-hunter",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "kube-hunter",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,48 @@
1
+ import { spawn } from "node:child_process";
2
+ import { mkdtemp, readFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+
6
+ let input = "";
7
+ process.stdin.setEncoding("utf8");
8
+ process.stdin.on("data", (chunk) => (input += chunk));
9
+ process.stdin.on("end", async () => {
10
+ const request = JSON.parse(input || "{}");
11
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
12
+ const target = String(request.target ?? "");
13
+ const domain = String(request.options?.domain ?? "WORKGROUP");
14
+ const user = String(request.options?.user ?? "");
15
+ const password = String(request.options?.password ?? "");
16
+ const dir = await mkdtemp(join(tmpdir(), "cantarella-ldapdump-"));
17
+ const child = spawn("ldapdomaindump", ["-u", `${domain}\\${user}`, "-p", password, target, "-o", dir], { stdio: ["ignore", "pipe", "pipe"] });
18
+ let stdout = "";
19
+ let stderr = "";
20
+ child.stdout.on("data", (chunk) => (stdout += chunk));
21
+ child.stderr.on("data", (chunk) => (stderr += chunk));
22
+ child.on("error", (error) => {
23
+ emit({ type: "error", message: `ldapdomaindump failed: ${error.message}` });
24
+ process.exitCode = 1;
25
+ });
26
+ child.on("close", async (code) => {
27
+ let users = [];
28
+ try {
29
+ const parsed = JSON.parse(await readFile(join(dir, "domain_users.json"), "utf8"));
30
+ if (Array.isArray(parsed)) {
31
+ users = parsed.map((entry) => entry.username ?? entry.name ?? "").filter(Boolean);
32
+ }
33
+ } catch {
34
+ users = [];
35
+ }
36
+ if (code !== 0 && !users.length) {
37
+ emit({ type: "error", message: `ldapdomaindump failed: ${stderr.trim() || `exited with ${code}`}` });
38
+ process.exitCode = 1;
39
+ return;
40
+ }
41
+ emit({
42
+ type: "result",
43
+ summary: `ldapdomaindump found ${users.length} users on ${target}.`,
44
+ data: { target, domain, user, users: users.slice(0, 100) },
45
+ });
46
+ emit({ type: "done", summary: `ldapdomaindump finished: ${users.length} users.` });
47
+ });
48
+ });
@@ -0,0 +1,40 @@
1
+ {
2
+ "category": "internal",
3
+ "core_api": "^0.1.0",
4
+ "description": "Dumps domain users with ldapdomaindump and reports the accounts it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "ldapdomaindump",
9
+ "install_hint": "Install ldapdomaindump from your distribution packages or with pipx install ldapdomaindump.",
10
+ "name": "ldapdomaindump"
11
+ }
12
+ ],
13
+ "id": "internal/ldapdomaindump",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "ldapdomaindump",
17
+ "options": [
18
+ {
19
+ "default": "WORKGROUP",
20
+ "description": "Domain to dump.",
21
+ "name": "domain",
22
+ "type": "string"
23
+ },
24
+ {
25
+ "default": "",
26
+ "description": "Username for the LDAP bind.",
27
+ "name": "user",
28
+ "type": "string"
29
+ },
30
+ {
31
+ "default": "",
32
+ "description": "Password for the LDAP bind.",
33
+ "name": "password",
34
+ "type": "string"
35
+ }
36
+ ],
37
+ "risk": "low",
38
+ "schema_version": 1,
39
+ "version": "0.1.0"
40
+ }