cantarella-framework 1.1.0 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.0
4
+
5
+ - New wrapper modules: ffuf content discovery, Nikto web scan, WhatWeb fingerprinting, and sqlmap in batch mode.
6
+
7
+ ## 1.2.0
8
+
9
+ - New native modules: CORS checker, JWT inspector, password strength estimator, and RDAP domain lookup.
10
+
3
11
  ## 1.1.0
4
12
 
5
13
  - New modules: evidence indexer, workflow plan validator, Exploit-DB reference search through searchsploit, and cookie security checker.
@@ -0,0 +1,32 @@
1
+ let input = "";
2
+ process.stdin.setEncoding("utf8");
3
+ process.stdin.on("data", (chunk) => (input += chunk));
4
+ process.stdin.on("end", () => {
5
+ const request = JSON.parse(input || "{}");
6
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
7
+ const parts = String(request.target ?? "").trim().split(".");
8
+ if (parts.length !== 3) {
9
+ emit({ type: "error", message: "Target must be a JWT with three dot-separated parts." });
10
+ process.exitCode = 1;
11
+ return;
12
+ }
13
+ try {
14
+ const decode = (part) => JSON.parse(Buffer.from(part, "base64url").toString("utf8"));
15
+ const header = decode(parts[0]);
16
+ const payload = decode(parts[1]);
17
+ const expiresAt = payload.exp ? new Date(payload.exp * 1000).toISOString() : null;
18
+ const expired = payload.exp ? payload.exp * 1000 < Date.now() : null;
19
+ if (header.alg === "none") {
20
+ emit({ type: "finding", title: "JWT uses alg none", severity: "high", description: "The token header declares no signature algorithm." });
21
+ }
22
+ emit({
23
+ type: "result",
24
+ summary: `JWT alg ${header.alg ?? "unknown"}, expires ${expiresAt ?? "not set"}${expired ? " (expired)" : ""}.`,
25
+ data: { header, payload, expires_at: expiresAt, expired, signature_present: Boolean(parts[2]) },
26
+ });
27
+ emit({ type: "done", summary: "JWT inspection finished." });
28
+ } catch (error) {
29
+ emit({ type: "error", message: `JWT inspection failed: ${error.message}` });
30
+ process.exitCode = 1;
31
+ }
32
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "api/jwt-inspector",
4
+ "name": "JWT Inspector",
5
+ "version": "0.1.0",
6
+ "category": "api",
7
+ "kind": "native",
8
+ "risk": "info",
9
+ "description": "Decodes a JWT header and payload and reports expiry without verifying the signature.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,28 @@
1
+ let input = "";
2
+ process.stdin.setEncoding("utf8");
3
+ process.stdin.on("data", (chunk) => (input += chunk));
4
+ process.stdin.on("end", () => {
5
+ const request = JSON.parse(input || "{}");
6
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
7
+ const password = String(request.target ?? "");
8
+ const classes = {
9
+ lowercase: /[a-z]/.test(password),
10
+ uppercase: /[A-Z]/.test(password),
11
+ digits: /\d/.test(password),
12
+ symbols: /[^A-Za-z0-9]/.test(password),
13
+ };
14
+ const variety = Object.values(classes).filter(Boolean).length;
15
+ let score = 0;
16
+ if (password.length >= 8) score += 1;
17
+ if (password.length >= 12) score += 1;
18
+ if (password.length >= 16) score += 1;
19
+ if (variety >= 3) score += 1;
20
+ if (variety === 4 && password.length >= 12) score += 1;
21
+ const labels = ["very weak", "weak", "fair", "good", "strong", "excellent"];
22
+ emit({
23
+ type: "result",
24
+ summary: `Password strength: ${labels[score]} (${score}/5), length ${password.length}.`,
25
+ data: { length: password.length, classes, score, label: labels[score] },
26
+ });
27
+ emit({ type: "done", summary: "Password strength check finished." });
28
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "password/password-strength",
4
+ "name": "Password Strength",
5
+ "version": "0.1.0",
6
+ "category": "password",
7
+ "kind": "native",
8
+ "risk": "info",
9
+ "description": "Estimates password strength from length and character variety.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,31 @@
1
+ let input = "";
2
+ process.stdin.setEncoding("utf8");
3
+ process.stdin.on("data", (chunk) => (input += chunk));
4
+ process.stdin.on("end", async () => {
5
+ const request = JSON.parse(input || "{}");
6
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
7
+ const domain = String(request.target ?? "").replace(/^https?:\/\//, "").split("/")[0].toLowerCase();
8
+ try {
9
+ const response = await fetch(`https://rdap.org/domain/${encodeURIComponent(domain)}`, {
10
+ signal: AbortSignal.timeout(10000),
11
+ });
12
+ if (!response.ok) throw new Error(`RDAP returned HTTP ${response.status}`);
13
+ const body = await response.json();
14
+ const events = Object.fromEntries((body.events ?? []).map((event) => [event.eventAction, event.eventDate]));
15
+ emit({
16
+ type: "result",
17
+ summary: `${domain}: registered ${events.registration ?? "unknown"}, expires ${events.expiration ?? "unknown"}.`,
18
+ data: {
19
+ domain,
20
+ handle: body.handle,
21
+ status: body.status,
22
+ nameservers: body.nameservers?.map((item) => item.ldhName),
23
+ events,
24
+ },
25
+ });
26
+ emit({ type: "done", summary: "RDAP lookup finished." });
27
+ } catch (error) {
28
+ emit({ type: "error", message: `RDAP lookup failed: ${error.message}` });
29
+ process.exitCode = 1;
30
+ }
31
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "recon/rdap-lookup",
4
+ "name": "RDAP Lookup",
5
+ "version": "0.1.0",
6
+ "category": "recon",
7
+ "kind": "native",
8
+ "risk": "low",
9
+ "description": "Looks up domain registration data through RDAP.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,45 @@
1
+ let input = "";
2
+ process.stdin.setEncoding("utf8");
3
+ process.stdin.on("data", (chunk) => (input += chunk));
4
+ process.stdin.on("end", async () => {
5
+ const request = JSON.parse(input || "{}");
6
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
7
+ const target = /^https?:\/\//.test(request.target) ? request.target : `https://${request.target}`;
8
+ try {
9
+ const response = await fetch(target, {
10
+ method: "OPTIONS",
11
+ headers: {
12
+ Origin: "https://example.com",
13
+ "Access-Control-Request-Method": "GET",
14
+ },
15
+ redirect: "manual",
16
+ signal: AbortSignal.timeout(8000),
17
+ });
18
+ const allowOrigin = response.headers.get("access-control-allow-origin");
19
+ const allowCredentials = response.headers.get("access-control-allow-credentials");
20
+ if (allowOrigin === "*" && allowCredentials === "true") {
21
+ emit({
22
+ type: "finding",
23
+ title: "Wildcard CORS with credentials",
24
+ severity: "medium",
25
+ description: "The response allows any origin while also allowing credentials.",
26
+ });
27
+ }
28
+ emit({
29
+ type: "result",
30
+ summary: `${target} CORS allow-origin: ${allowOrigin ?? "not set"}.`,
31
+ data: {
32
+ url: target,
33
+ status: response.status,
34
+ allow_origin: allowOrigin,
35
+ allow_credentials: allowCredentials,
36
+ allow_methods: response.headers.get("access-control-allow-methods"),
37
+ allow_headers: response.headers.get("access-control-allow-headers"),
38
+ },
39
+ });
40
+ emit({ type: "done", summary: "CORS check finished." });
41
+ } catch (error) {
42
+ emit({ type: "error", message: `CORS check failed: ${error.message}` });
43
+ process.exitCode = 1;
44
+ }
45
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "web/cors-checker",
4
+ "name": "CORS Checker",
5
+ "version": "0.1.0",
6
+ "category": "web",
7
+ "kind": "native",
8
+ "risk": "low",
9
+ "description": "Checks CORS response headers for a web origin.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,33 @@
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 wordlist = String(request.options?.wordlist ?? "/usr/share/wordlists/dirb/common.txt");
11
+ const child = spawn("ffuf", ["-u", target, "-w", wordlist, "-json", "-s"], { stdio: ["ignore", "pipe", "pipe"] });
12
+ let stdout = "";
13
+ let stderr = "";
14
+ child.stdout.on("data", (chunk) => (stdout += chunk));
15
+ child.stderr.on("data", (chunk) => (stderr += chunk));
16
+ child.on("error", (error) => {
17
+ emit({ type: "error", message: `ffuf failed: ${error.message}` });
18
+ process.exitCode = 1;
19
+ });
20
+ child.on("close", (code) => {
21
+ let results = [];
22
+ try {
23
+ results = (JSON.parse(stdout).results ?? []).map((item) => ({ url: item.url, status: item.status, length: item.length }));
24
+ } catch {}
25
+ if (code !== 0 && !results.length) {
26
+ emit({ type: "error", message: `ffuf failed: ${stderr.trim() || `exited with ${code}`}` });
27
+ process.exitCode = 1;
28
+ return;
29
+ }
30
+ emit({ type: "result", summary: `ffuf found ${results.length} results for ${target}.`, data: { target, wordlist, results } });
31
+ emit({ type: "done", summary: "ffuf scan finished." });
32
+ });
33
+ });
@@ -0,0 +1,28 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "web/ffuf",
4
+ "name": "ffuf",
5
+ "version": "0.1.0",
6
+ "category": "web",
7
+ "kind": "wrapper",
8
+ "risk": "medium",
9
+ "description": "Runs ffuf content discovery against a URL containing FUZZ.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": [
14
+ {
15
+ "name": "wordlist",
16
+ "type": "string",
17
+ "description": "Path to the wordlist file.",
18
+ "default": "/usr/share/wordlists/dirb/common.txt"
19
+ }
20
+ ],
21
+ "external_tools": [
22
+ {
23
+ "name": "ffuf",
24
+ "command": "ffuf",
25
+ "install_hint": "Install ffuf from your distribution packages."
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,29 @@
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("nikto", ["-h", target, "-nointeractive"], { 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: `Nikto failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const lines = stdout.split("\n").map((line) => line.trim()).filter((line) => line.startsWith("+"));
21
+ if (code !== 0 && !lines.length) {
22
+ emit({ type: "error", message: `Nikto failed: ${stderr.trim() || `exited with ${code}`}` });
23
+ process.exitCode = 1;
24
+ return;
25
+ }
26
+ emit({ type: "result", summary: `Nikto reported ${lines.length} lines for ${target}.`, data: { target, findings: lines.slice(0, 200) } });
27
+ emit({ type: "done", summary: "Nikto scan finished." });
28
+ });
29
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "web/nikto",
4
+ "name": "Nikto",
5
+ "version": "0.1.0",
6
+ "category": "web",
7
+ "kind": "wrapper",
8
+ "risk": "medium",
9
+ "description": "Runs a Nikto web server scan against a target URL.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": [],
14
+ "external_tools": [
15
+ {
16
+ "name": "Nikto",
17
+ "command": "nikto",
18
+ "install_hint": "Install nikto from your distribution packages."
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,34 @@
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("sqlmap", ["-u", target, "--batch", "--level=1", "--risk=1"], { 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: `sqlmap failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const lines = stdout.split("\n").map((line) => line.trim()).filter(Boolean);
21
+ const interesting = lines.filter((line) => /injectable|vulnerable|parameter|back-end DBMS/i.test(line));
22
+ if (code !== 0 && !lines.length) {
23
+ emit({ type: "error", message: `sqlmap failed: ${stderr.trim() || `exited with ${code}`}` });
24
+ process.exitCode = 1;
25
+ return;
26
+ }
27
+ emit({
28
+ type: "result",
29
+ summary: interesting.length ? `sqlmap reported ${interesting.length} interesting lines for ${target}.` : `sqlmap finished for ${target} with no injectable parameter reported.`,
30
+ data: { target, findings: interesting.slice(0, 100) },
31
+ });
32
+ emit({ type: "done", summary: "sqlmap scan finished." });
33
+ });
34
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "web/sqlmap",
4
+ "name": "sqlmap",
5
+ "version": "0.1.0",
6
+ "category": "web",
7
+ "kind": "wrapper",
8
+ "risk": "high",
9
+ "description": "Runs sqlmap against a target URL in batch mode.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": [],
14
+ "external_tools": [
15
+ {
16
+ "name": "sqlmap",
17
+ "command": "sqlmap",
18
+ "install_hint": "Install sqlmap from your distribution packages."
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,33 @@
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("whatweb", ["--log-json=-", 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: `WhatWeb failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ let plugins = [];
21
+ try {
22
+ const parsed = JSON.parse(stdout);
23
+ plugins = Object.keys(parsed[0]?.plugins ?? {});
24
+ } catch {}
25
+ if (code !== 0 && !plugins.length) {
26
+ emit({ type: "error", message: `WhatWeb failed: ${stderr.trim() || `exited with ${code}`}` });
27
+ process.exitCode = 1;
28
+ return;
29
+ }
30
+ emit({ type: "result", summary: `WhatWeb detected ${plugins.length} technologies on ${target}.`, data: { target, technologies: plugins } });
31
+ emit({ type: "done", summary: "WhatWeb scan finished." });
32
+ });
33
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "recon/whatweb",
4
+ "name": "WhatWeb",
5
+ "version": "0.1.0",
6
+ "category": "recon",
7
+ "kind": "wrapper",
8
+ "risk": "low",
9
+ "description": "Fingerprints web technologies with WhatWeb.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": [],
14
+ "external_tools": [
15
+ {
16
+ "name": "WhatWeb",
17
+ "command": "whatweb",
18
+ "install_hint": "Install whatweb from your distribution packages."
19
+ }
20
+ ]
21
+ }
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "release:notes": "node scripts/release-notes.mjs"
20
20
  },
21
21
  "type": "module",
22
- "version": "1.1.0",
22
+ "version": "1.3.0",
23
23
  "workspaces": [
24
24
  "packages/*"
25
25
  ],
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
11
11
  process.exit(0);
12
12
  throw error;
13
13
  });
14
- const VERSION = "1.1.0";
14
+ const VERSION = "1.3.0";
15
15
  const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
16
16
  function banner() {
17
17
  return (process.stdout.columns ?? 80) >= 72 ? BANNER : COMPACT_BANNER;
@@ -78,8 +78,8 @@ export function createGuiServer(root) {
78
78
  }
79
79
  }
80
80
  sendJson(response, 200, {
81
- version: "1.1.0",
82
- update_message: (await checkForUpdate("1.1.0")).message,
81
+ version: "1.3.0",
82
+ update_message: (await checkForUpdate("1.3.0")).message,
83
83
  categories: CATEGORIES,
84
84
  modules: modules.map(({ manifest }) => manifest),
85
85
  external_tools: [...tools.values()],