cantarella-framework 1.8.0 → 1.10.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 (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/modules/forensics-strings-extractor/index.mjs +44 -0
  3. package/modules/forensics-strings-extractor/module.json +21 -0
  4. package/modules/lab-base64-tool/index.mjs +40 -0
  5. package/modules/lab-base64-tool/module.json +27 -0
  6. package/modules/vuln-management-nessus-import/index.mjs +62 -0
  7. package/modules/vuln-management-nessus-import/module.json +14 -0
  8. package/modules/wrapper-amass/index.mjs +42 -0
  9. package/modules/wrapper-amass/module.json +21 -0
  10. package/modules/wrapper-apktool/index.mjs +61 -0
  11. package/modules/wrapper-apktool/module.json +21 -0
  12. package/modules/wrapper-bandit/index.mjs +56 -0
  13. package/modules/wrapper-bandit/module.json +21 -0
  14. package/modules/wrapper-binwalk/index.mjs +40 -0
  15. package/modules/wrapper-binwalk/module.json +21 -0
  16. package/modules/wrapper-checkov/index.mjs +47 -0
  17. package/modules/wrapper-checkov/module.json +21 -0
  18. package/modules/wrapper-clamscan/index.mjs +40 -0
  19. package/modules/wrapper-clamscan/module.json +21 -0
  20. package/modules/wrapper-dirsearch/index.mjs +40 -0
  21. package/modules/wrapper-dirsearch/module.json +21 -0
  22. package/modules/wrapper-gitleaks/index.mjs +64 -0
  23. package/modules/wrapper-gitleaks/module.json +21 -0
  24. package/modules/wrapper-hashcat/index.mjs +42 -0
  25. package/modules/wrapper-hashcat/module.json +34 -0
  26. package/modules/wrapper-hydra/index.mjs +43 -0
  27. package/modules/wrapper-hydra/module.json +40 -0
  28. package/modules/wrapper-john/index.mjs +46 -0
  29. package/modules/wrapper-john/module.json +28 -0
  30. package/modules/wrapper-masscan/index.mjs +42 -0
  31. package/modules/wrapper-masscan/module.json +34 -0
  32. package/modules/wrapper-subfinder/index.mjs +42 -0
  33. package/modules/wrapper-subfinder/module.json +21 -0
  34. package/modules/wrapper-theharvester/index.mjs +42 -0
  35. package/modules/wrapper-theharvester/module.json +21 -0
  36. package/modules/wrapper-waf-detector/index.mjs +36 -0
  37. package/modules/wrapper-waf-detector/module.json +21 -0
  38. package/modules/wrapper-waybackurls/index.mjs +40 -0
  39. package/modules/wrapper-waybackurls/module.json +21 -0
  40. package/modules/wrapper-wpscan/index.mjs +59 -0
  41. package/modules/wrapper-wpscan/module.json +28 -0
  42. package/package.json +1 -1
  43. package/packages/cli/dist/cli.js +1 -1
  44. package/packages/cli/dist/cli.js.map +1 -1
  45. package/packages/gui/dist/server.js +2 -2
  46. package/packages/gui/dist/server.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.0
4
+
5
+ - New modules: wafw00f WAF detection, Subfinder subdomain enumeration, Hashcat hash cracking, ClamAV malware scans, printable strings extraction, base64/hex/URL conversion, Gitleaks secret scanning, Nessus import, Apktool APK decoding, and waybackurls archived URL listing.
6
+
7
+ ## 1.9.0
8
+
9
+ - New modules: WPScan WordPress scans, Amass subdomain enumeration, Hydra credential testing, Binwalk firmware analysis, theHarvester OSINT gathering, Masscan fast port scans, Bandit Python audits, John the Ripper hash cracking, dirsearch path brute forcing, and Checkov infrastructure-as-code scans.
10
+
3
11
  ## 1.8.0
4
12
 
5
13
  - New modules: Ansible playbook runs, Trivy filesystem scans, Markdown report building, and OWASP Dependency-Check scans.
@@ -0,0 +1,44 @@
1
+ import { readFileSync } from "node:fs";
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
+ try {
10
+ const result = extract(request);
11
+ emit({ type: "result", summary: result.summary, data: result.data });
12
+ emit({ type: "done", summary: `Strings extraction finished: ${result.data.count} strings.` });
13
+ } catch (error) {
14
+ emit({ type: "error", message: error.message });
15
+ process.exitCode = 1;
16
+ }
17
+ });
18
+
19
+ function extract(request) {
20
+ const target = String(request.target ?? "");
21
+ const min = Number(request.options?.min ?? 4);
22
+ if (!Number.isFinite(min) || min < 1) throw new Error("Invalid input: min must be a positive number.");
23
+ let buffer;
24
+ try {
25
+ buffer = readFileSync(target);
26
+ } catch {
27
+ throw new Error(`Cannot read file: ${target}.`);
28
+ }
29
+ const strings = [];
30
+ let current = "";
31
+ for (const byte of buffer) {
32
+ if (byte >= 32 && byte <= 126) {
33
+ current += String.fromCharCode(byte);
34
+ } else {
35
+ if (current.length >= min) strings.push(current);
36
+ current = "";
37
+ }
38
+ }
39
+ if (current.length >= min) strings.push(current);
40
+ return {
41
+ summary: `Extracted ${strings.length} strings from ${target}.`,
42
+ data: { file: target, min, count: strings.length, strings: strings.slice(0, 200) },
43
+ };
44
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "forensics",
3
+ "core_api": "^0.1.0",
4
+ "description": "Extracts printable strings from a binary file for forensic triage.",
5
+ "entry": "index.mjs",
6
+ "id": "forensics/strings-extractor",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "Strings Extractor",
10
+ "options": [
11
+ {
12
+ "default": 4,
13
+ "description": "Minimum length of a string to report.",
14
+ "name": "min",
15
+ "type": "number"
16
+ }
17
+ ],
18
+ "risk": "info",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,40 @@
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
+ try {
8
+ const result = convert(request);
9
+ emit({ type: "result", summary: result.summary, data: result.data });
10
+ emit({ type: "done", summary: `Conversion finished: ${result.data.operation} ${result.data.format}.` });
11
+ } catch (error) {
12
+ emit({ type: "error", message: error.message });
13
+ process.exitCode = 1;
14
+ }
15
+ });
16
+
17
+ function convert(request) {
18
+ const text = String(request.target ?? "");
19
+ const operation = String(request.options?.operation ?? "encode");
20
+ const format = String(request.options?.format ?? "base64");
21
+ if (operation !== "encode" && operation !== "decode") throw new Error(`Invalid input: operation must be encode or decode, got ${operation}.`);
22
+ if (!["base64", "hex", "url"].includes(format)) throw new Error(`Invalid input: format must be base64, hex, or url, got ${format}.`);
23
+ let output;
24
+ try {
25
+ if (format === "base64") {
26
+ output = operation === "encode" ? Buffer.from(text, "utf8").toString("base64") : Buffer.from(text, "base64").toString("utf8");
27
+ } else if (format === "hex") {
28
+ output = operation === "encode" ? Buffer.from(text, "utf8").toString("hex") : Buffer.from(text, "hex").toString("utf8");
29
+ } else {
30
+ output = operation === "encode" ? encodeURIComponent(text) : decodeURIComponent(text);
31
+ }
32
+ } catch {
33
+ throw new Error(`Invalid input: cannot ${operation} as ${format}: ${text}.`);
34
+ }
35
+ const shown = output.length > 80 ? `${output.slice(0, 80)}...` : output;
36
+ return {
37
+ summary: `${operation} ${format}: ${shown}`,
38
+ data: { input: text, operation, format, output },
39
+ };
40
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "category": "lab",
3
+ "core_api": "^0.1.0",
4
+ "description": "Encodes and decodes text in base64, hex, and URL formats.",
5
+ "entry": "index.mjs",
6
+ "id": "lab/base64-tool",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "Base64 Tool",
10
+ "options": [
11
+ {
12
+ "default": "encode",
13
+ "description": "Operation to perform: encode or decode.",
14
+ "name": "operation",
15
+ "type": "string"
16
+ },
17
+ {
18
+ "default": "base64",
19
+ "description": "Format to use: base64, hex, or url.",
20
+ "name": "format",
21
+ "type": "string"
22
+ }
23
+ ],
24
+ "risk": "info",
25
+ "schema_version": 1,
26
+ "version": "0.1.0"
27
+ }
@@ -0,0 +1,62 @@
1
+ import { readFileSync } from "node:fs";
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
+ try {
10
+ const result = importNessus(String(request.target ?? ""));
11
+ emit({ type: "result", summary: result.summary, data: result.data });
12
+ emit({ type: "done", summary: `Nessus import finished: ${result.data.total} findings.` });
13
+ } catch (error) {
14
+ emit({ type: "error", message: error.message });
15
+ process.exitCode = 1;
16
+ }
17
+ });
18
+
19
+ const SEVERITY_NAMES = { 0: "info", 1: "low", 2: "medium", 3: "high", 4: "critical" };
20
+
21
+ function importNessus(target) {
22
+ let raw;
23
+ try {
24
+ raw = readFileSync(target, "utf8");
25
+ } catch {
26
+ throw new Error(`Cannot read file: ${target}.`);
27
+ }
28
+ const hosts = new Set();
29
+ const findings = [];
30
+ const hostBlocks = raw.match(/<ReportHost[^>]*name="([^"]+)"[^>]*>([\s\S]*?)<\/ReportHost>/g) ?? [];
31
+ if (!hostBlocks.length) throw new Error(`Invalid input: no Nessus ReportHost entries found in ${target}.`);
32
+ for (const block of hostBlocks) {
33
+ const hostMatch = block.match(/<ReportHost[^>]*name="([^"]+)"/);
34
+ const host = hostMatch ? hostMatch[1] : "";
35
+ if (host) hosts.add(host);
36
+ const items = block.match(/<ReportItem[^>]*>([\s\S]*?)<\/ReportItem>/g) ?? [];
37
+ for (const item of items) {
38
+ const attrs = item.match(/<ReportItem([^>]*)>/);
39
+ const attrText = attrs ? attrs[1] : "";
40
+ const getAttr = (name) => {
41
+ const found = attrText.match(new RegExp(`${name}="([^"]*)"`));
42
+ return found ? found[1] : "";
43
+ };
44
+ const severity = Number(getAttr("severity") || 0);
45
+ findings.push({
46
+ host,
47
+ port: getAttr("port"),
48
+ plugin_id: getAttr("pluginID"),
49
+ severity: SEVERITY_NAMES[severity] ?? "unknown",
50
+ plugin_name: getAttr("pluginName"),
51
+ });
52
+ }
53
+ }
54
+ const bySeverity = {};
55
+ for (const finding of findings) {
56
+ bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;
57
+ }
58
+ return {
59
+ summary: `Nessus import found ${findings.length} findings across ${hosts.size} hosts.`,
60
+ data: { file: target, hosts: [...hosts], total: findings.length, by_severity: bySeverity, findings: findings.slice(0, 200) },
61
+ };
62
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category": "vuln-management",
3
+ "core_api": "^0.1.0",
4
+ "description": "Imports a Nessus scan file and reports the hosts and findings it contains.",
5
+ "entry": "index.mjs",
6
+ "id": "vuln-management/nessus-import",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "Nessus Import",
10
+ "options": [],
11
+ "risk": "low",
12
+ "schema_version": 1,
13
+ "version": "0.1.0"
14
+ }
@@ -0,0 +1,42 @@
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("amass", ["enum", "-d", 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: `Amass 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 subdomains = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ if (!/^[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(trimmed)) continue;
26
+ if (trimmed === target) continue;
27
+ if (!trimmed.endsWith(`.${target}`) && trimmed !== target) continue;
28
+ subdomains.push(trimmed);
29
+ }
30
+ if (code !== 0 && !subdomains.length) {
31
+ emit({ type: "error", message: `Amass failed: ${stderr.trim() || `exited with ${code}`}` });
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ emit({
36
+ type: "result",
37
+ summary: `Amass found ${subdomains.length} subdomains for ${target}.`,
38
+ data: { target, subdomains: [...new Set(subdomains)].slice(0, 500) },
39
+ });
40
+ emit({ type: "done", summary: `Amass finished: ${subdomains.length} subdomains.` });
41
+ });
42
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "recon",
3
+ "core_api": "^0.1.0",
4
+ "description": "Enumerates subdomains for a domain with Amass and reports the subdomains found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "amass",
9
+ "install_hint": "Install Amass from your distribution packages or the OWASP Amass releases.",
10
+ "name": "Amass"
11
+ }
12
+ ],
13
+ "id": "recon/amass",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Amass",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,61 @@
1
+ import { spawn } from "node:child_process";
2
+ import { mkdtemp, readdir, rm, stat } 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", () => {
10
+ const request = JSON.parse(input || "{}");
11
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
12
+ const target = String(request.target ?? "");
13
+ run(request, target, emit).catch((error) => {
14
+ emit({ type: "error", message: `Apktool failed: ${error.message}` });
15
+ process.exitCode = 1;
16
+ });
17
+ });
18
+
19
+ async function run(request, target, emit) {
20
+ const outDir = await mkdtemp(join(tmpdir(), "cantarella-apktool-"));
21
+ try {
22
+ const child = spawn("apktool", ["d", target, "-o", outDir, "-f"], { stdio: ["ignore", "pipe", "pipe"] });
23
+ let stdout = "";
24
+ let stderr = "";
25
+ child.stdout.on("data", (chunk) => (stdout += chunk));
26
+ child.stderr.on("data", (chunk) => (stderr += chunk));
27
+ const code = await new Promise((resolve, reject) => {
28
+ child.on("error", reject);
29
+ child.on("close", resolve);
30
+ });
31
+ let entries = [];
32
+ try {
33
+ entries = await readdir(outDir, { recursive: true });
34
+ } catch {
35
+ entries = [];
36
+ }
37
+ const fileList = [];
38
+ for (const entry of entries) {
39
+ if (typeof entry !== "string") continue;
40
+ try {
41
+ if ((await stat(join(outDir, entry))).isFile()) fileList.push(entry);
42
+ } catch {
43
+ // Entry disappeared; skip it.
44
+ }
45
+ }
46
+ const manifest = fileList.some((entry) => entry.endsWith("AndroidManifest.xml"));
47
+ if (code !== 0 && !fileList.length) {
48
+ emit({ type: "error", message: `Apktool failed: ${stderr.trim() || stdout.trim() || `exited with ${code}`}` });
49
+ process.exitCode = 1;
50
+ return;
51
+ }
52
+ emit({
53
+ type: "result",
54
+ summary: `Apktool decoded ${target} into ${fileList.length} files.`,
55
+ data: { target, files: fileList.length, manifest, samples: fileList.slice(0, 20) },
56
+ });
57
+ emit({ type: "done", summary: `Apktool finished: ${fileList.length} files.` });
58
+ } finally {
59
+ await rm(outDir, { recursive: true, force: true });
60
+ }
61
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "mobile",
3
+ "core_api": "^0.1.0",
4
+ "description": "Decodes an Android APK with Apktool and reports the files it contains.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "apktool",
9
+ "install_hint": "Install Apktool from your distribution packages or from the Apktool releases.",
10
+ "name": "Apktool"
11
+ }
12
+ ],
13
+ "id": "mobile/apktool",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Apktool",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,56 @@
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("bandit", ["-r", target, "-f", "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: `Bandit failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ let report = null;
21
+ try {
22
+ report = JSON.parse(stdout);
23
+ } catch {
24
+ report = null;
25
+ }
26
+ const findings = [];
27
+ if (report && Array.isArray(report.results)) {
28
+ for (const result of report.results) {
29
+ findings.push({
30
+ test_id: result.test_id ?? "",
31
+ test_name: result.test_name ?? "",
32
+ severity: result.issue_severity ?? "UNKNOWN",
33
+ confidence: result.issue_confidence ?? "UNKNOWN",
34
+ file: result.filename ?? "",
35
+ line: result.line_number ?? null,
36
+ issue: result.issue_text ?? "",
37
+ });
38
+ }
39
+ }
40
+ if (code !== 0 && !findings.length && !report) {
41
+ emit({ type: "error", message: `Bandit failed: ${stderr.trim() || `exited with ${code}`}` });
42
+ process.exitCode = 1;
43
+ return;
44
+ }
45
+ const bySeverity = {};
46
+ for (const finding of findings) {
47
+ bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;
48
+ }
49
+ emit({
50
+ type: "result",
51
+ summary: `Bandit found ${findings.length} issues in ${target}.`,
52
+ data: { target, total: findings.length, by_severity: bySeverity, findings: findings.slice(0, 100) },
53
+ });
54
+ emit({ type: "done", summary: `Bandit finished: ${findings.length} issues.` });
55
+ });
56
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "code-audit",
3
+ "core_api": "^0.1.0",
4
+ "description": "Audits Python code with Bandit and reports the security issues found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "bandit",
9
+ "install_hint": "Install Bandit from your distribution packages or with pipx install bandit.",
10
+ "name": "Bandit"
11
+ }
12
+ ],
13
+ "id": "code-audit/bandit",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Bandit",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,40 @@
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("binwalk", [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: `Binwalk 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 signatures = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ const match = trimmed.match(/^(\d+)\s+0x[0-9A-Fa-f]+\s+(.+)$/);
25
+ if (!match) continue;
26
+ signatures.push({ offset: Number(match[1]), description: match[2].trim() });
27
+ }
28
+ if (code !== 0 && !signatures.length) {
29
+ emit({ type: "error", message: `Binwalk failed: ${stderr.trim() || `exited with ${code}`}` });
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: `Binwalk found ${signatures.length} signatures in ${target}.`,
36
+ data: { target, signatures: signatures.slice(0, 200) },
37
+ });
38
+ emit({ type: "done", summary: `Binwalk finished: ${signatures.length} signatures.` });
39
+ });
40
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "forensics",
3
+ "core_api": "^0.1.0",
4
+ "description": "Analyzes a binary or firmware file with Binwalk and reports the embedded signatures found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "binwalk",
9
+ "install_hint": "Install Binwalk from your distribution packages or with pipx install binwalk.",
10
+ "name": "Binwalk"
11
+ }
12
+ ],
13
+ "id": "forensics/binwalk",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Binwalk",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,47 @@
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("checkov", ["-d", target, "--framework", "terraform", "--output", "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: `Checkov failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ let report = null;
21
+ try {
22
+ report = JSON.parse(stdout);
23
+ } catch {
24
+ report = null;
25
+ }
26
+ const results = report?.results ?? report ?? {};
27
+ const passed = Array.isArray(results.passed_checks) ? results.passed_checks : [];
28
+ const failedRaw = Array.isArray(results.failed_checks) ? results.failed_checks : [];
29
+ const failed = failedRaw.map((check) => ({
30
+ check_id: check.check_id ?? "",
31
+ check_name: check.check_name ?? "",
32
+ file: check.file_path ?? "",
33
+ resource: check.resource ?? "",
34
+ }));
35
+ if (code !== 0 && !passed.length && !failed.length && !report) {
36
+ emit({ type: "error", message: `Checkov failed: ${stderr.trim() || `exited with ${code}`}` });
37
+ process.exitCode = 1;
38
+ return;
39
+ }
40
+ emit({
41
+ type: "result",
42
+ summary: `Checkov reported ${failed.length} failed and ${passed.length} passed checks in ${target}.`,
43
+ data: { target, passed: passed.length, failed: failed.length, failed_checks: failed.slice(0, 100) },
44
+ });
45
+ emit({ type: "done", summary: `Checkov finished: ${failed.length} failed, ${passed.length} passed.` });
46
+ });
47
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "cloud",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans infrastructure as code with Checkov and reports failed policy checks.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "checkov",
9
+ "install_hint": "Install Checkov from your distribution packages or with pipx install checkov.",
10
+ "name": "Checkov"
11
+ }
12
+ ],
13
+ "id": "cloud/checkov",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Checkov",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,40 @@
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("clamscan", ["-r", 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: `ClamAV 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 infected = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ const match = trimmed.match(/^(.+?):\s+(.+?)\s+FOUND$/);
25
+ if (!match) continue;
26
+ infected.push({ file: match[1], signature: match[2] });
27
+ }
28
+ if (code !== 0 && !infected.length && !/Infected files:/.test(plain)) {
29
+ emit({ type: "error", message: `ClamAV failed: ${stderr.trim() || `exited with ${code}`}` });
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: `ClamAV found ${infected.length} infected files in ${target}.`,
36
+ data: { target, infected_count: infected.length, infected: infected.slice(0, 100) },
37
+ });
38
+ emit({ type: "done", summary: `ClamAV scan finished: ${infected.length} infected files.` });
39
+ });
40
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "blue-team",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans files for malware with ClamAV and reports the infected files found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "clamscan",
9
+ "install_hint": "Install ClamAV from your distribution packages.",
10
+ "name": "ClamAV"
11
+ }
12
+ ],
13
+ "id": "blue-team/clamscan",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "ClamAV Scan",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }