cantarella-framework 1.14.0 → 1.16.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 (44) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/modules/api-websocket-checker/index.mjs +65 -0
  3. package/modules/api-websocket-checker/module.json +14 -0
  4. package/modules/reporting-html-report/index.mjs +56 -0
  5. package/modules/reporting-html-report/module.json +14 -0
  6. package/modules/reporting-sarif-export/index.mjs +53 -0
  7. package/modules/reporting-sarif-export/module.json +14 -0
  8. package/modules/wrapper-ansible-lint/index.mjs +48 -0
  9. package/modules/wrapper-ansible-lint/module.json +21 -0
  10. package/modules/wrapper-crunch/index.mjs +42 -0
  11. package/modules/wrapper-crunch/module.json +34 -0
  12. package/modules/wrapper-detect-secrets/index.mjs +46 -0
  13. package/modules/wrapper-detect-secrets/module.json +21 -0
  14. package/modules/wrapper-dnsrecon/index.mjs +41 -0
  15. package/modules/wrapper-dnsrecon/module.json +21 -0
  16. package/modules/wrapper-docker-bench/index.mjs +41 -0
  17. package/modules/wrapper-docker-bench/module.json +21 -0
  18. package/modules/wrapper-enum4linux/index.mjs +43 -0
  19. package/modules/wrapper-enum4linux/module.json +21 -0
  20. package/modules/wrapper-file-type/index.mjs +33 -0
  21. package/modules/wrapper-file-type/module.json +21 -0
  22. package/modules/wrapper-hcxdumptool/index.mjs +40 -0
  23. package/modules/wrapper-hcxdumptool/module.json +28 -0
  24. package/modules/wrapper-linpeas/index.mjs +39 -0
  25. package/modules/wrapper-linpeas/module.json +21 -0
  26. package/modules/wrapper-routersploit/index.mjs +42 -0
  27. package/modules/wrapper-routersploit/module.json +28 -0
  28. package/modules/wrapper-searchsploit/index.mjs +44 -0
  29. package/modules/wrapper-searchsploit/module.json +21 -0
  30. package/modules/wrapper-shellcheck/index.mjs +47 -0
  31. package/modules/wrapper-shellcheck/module.json +21 -0
  32. package/modules/wrapper-smbclient/index.mjs +41 -0
  33. package/modules/wrapper-smbclient/module.json +21 -0
  34. package/modules/wrapper-snmpwalk/index.mjs +42 -0
  35. package/modules/wrapper-snmpwalk/module.json +28 -0
  36. package/modules/wrapper-sysdig/index.mjs +39 -0
  37. package/modules/wrapper-sysdig/module.json +21 -0
  38. package/modules/wrapper-vagrant/index.mjs +42 -0
  39. package/modules/wrapper-vagrant/module.json +21 -0
  40. package/modules/wrapper-wifite/index.mjs +40 -0
  41. package/modules/wrapper-wifite/module.json +28 -0
  42. package/package.json +1 -1
  43. package/packages/cli/dist/cli.js +1 -1
  44. package/packages/gui/dist/server.js +2 -2
@@ -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("file", ["-b", 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: `file failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ const type = stdout.trim().split("\n")[0] ?? "";
21
+ if (code !== 0 || !type) {
22
+ emit({ type: "error", message: `file failed: ${stderr.trim() || `exited with ${code}`}` });
23
+ process.exitCode = 1;
24
+ return;
25
+ }
26
+ emit({
27
+ type: "result",
28
+ summary: `${target} is ${type}.`,
29
+ data: { target, type },
30
+ });
31
+ emit({ type: "done", summary: `file finished: ${type}.` });
32
+ });
33
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "forensics",
3
+ "core_api": "^0.1.0",
4
+ "description": "Identifies a file type with the file command and reports its description.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "file",
9
+ "install_hint": "Install file from your distribution packages.",
10
+ "name": "file"
11
+ }
12
+ ],
13
+ "id": "forensics/file-type",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "File Type",
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 iface = String(request.options?.interface ?? "wlan0mon");
11
+ const child = spawn("hcxdumptool", ["-i", iface, "--enable_status=1"], { 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: `hcxdumptool failed: ${error.message}` });
18
+ process.exitCode = 1;
19
+ });
20
+ child.on("close", (code) => {
21
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
22
+ const captures = [];
23
+ for (const line of plain.split("\n")) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed) continue;
26
+ if (/PMKID|EAPOL/i.test(trimmed)) captures.push(trimmed);
27
+ }
28
+ if (code !== 0 && !captures.length && !plain.trim()) {
29
+ emit({ type: "error", message: `hcxdumptool failed: ${stderr.trim() || `exited with ${code}`}` });
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: `hcxdumptool captured ${captures.length} handshakes on ${iface}.`,
36
+ data: { target, interface: iface, captures: captures.slice(0, 100) },
37
+ });
38
+ emit({ type: "done", summary: `hcxdumptool finished: ${captures.length} captures.` });
39
+ });
40
+ });
@@ -0,0 +1,28 @@
1
+ {
2
+ "category": "wireless",
3
+ "core_api": "^0.1.0",
4
+ "description": "Captures WPA handshakes and PMKIDs with hcxdumptool and reports what it captured.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "hcxdumptool",
9
+ "install_hint": "Install hcxdumptool from your distribution packages.",
10
+ "name": "hcxdumptool"
11
+ }
12
+ ],
13
+ "id": "wireless/hcxdumptool",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "hcxdumptool",
17
+ "options": [
18
+ {
19
+ "default": "wlan0mon",
20
+ "description": "Wireless interface in monitor mode.",
21
+ "name": "interface",
22
+ "type": "string"
23
+ }
24
+ ],
25
+ "risk": "high",
26
+ "schema_version": 1,
27
+ "version": "0.1.0"
28
+ }
@@ -0,0 +1,39 @@
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("linpeas.sh", [], { 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: `linpeas 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 sections = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ if (trimmed.startsWith("[+]")) sections.push(trimmed.replace(/^\[\+\]\s*/, ""));
26
+ }
27
+ if (code !== 0 && !sections.length && !plain.trim()) {
28
+ emit({ type: "error", message: `linpeas failed: ${stderr.trim() || `exited with ${code}`}` });
29
+ process.exitCode = 1;
30
+ return;
31
+ }
32
+ emit({
33
+ type: "result",
34
+ summary: `linpeas found ${sections.length} interesting sections.`,
35
+ data: { target, sections: sections.slice(0, 100) },
36
+ });
37
+ emit({ type: "done", summary: `linpeas finished: ${sections.length} sections.` });
38
+ });
39
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "exploitation",
3
+ "core_api": "^0.1.0",
4
+ "description": "Runs linpeas.sh privilege escalation enumeration and reports the sections it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "linpeas.sh",
9
+ "install_hint": "Install linpeas.sh from the PEASS-ng releases.",
10
+ "name": "linpeas"
11
+ }
12
+ ],
13
+ "id": "exploitation/linpeas",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "linpeas",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -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 moduleName = String(request.options?.module ?? "exploits/routers/dlink/dir_645_unauth_rce");
11
+ const child = spawn("rsf.py", [], { stdio: ["pipe", "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: `RouterSploit failed: ${error.message}` });
18
+ process.exitCode = 1;
19
+ });
20
+ child.stdin.write(`use ${moduleName}\nset target ${target}\nrun\nexit\n`);
21
+ child.stdin.end();
22
+ child.on("close", (code) => {
23
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
24
+ const findings = [];
25
+ for (const line of plain.split("\n")) {
26
+ const trimmed = line.trim();
27
+ if (!trimmed) continue;
28
+ if (/vulnerable/i.test(trimmed)) findings.push(trimmed);
29
+ }
30
+ if (code !== 0 && !findings.length && !plain.trim()) {
31
+ emit({ type: "error", message: `RouterSploit failed: ${stderr.trim() || `exited with ${code}`}` });
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ emit({
36
+ type: "result",
37
+ summary: findings.length ? `RouterSploit found ${target} vulnerable via ${moduleName}.` : `RouterSploit did not find ${target} vulnerable.`,
38
+ data: { target, module: moduleName, vulnerable: findings.length > 0, findings: findings.slice(0, 100) },
39
+ });
40
+ emit({ type: "done", summary: findings.length ? `RouterSploit finished: ${target} vulnerable.` : "RouterSploit finished: not vulnerable." });
41
+ });
42
+ });
@@ -0,0 +1,28 @@
1
+ {
2
+ "category": "exploitation",
3
+ "core_api": "^0.1.0",
4
+ "description": "Runs a RouterSploit module against a target and reports whether it is vulnerable.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "rsf.py",
9
+ "install_hint": "Install RouterSploit from your distribution packages or with pipx install routersploit.",
10
+ "name": "RouterSploit"
11
+ }
12
+ ],
13
+ "id": "exploitation/routersploit",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "RouterSploit",
17
+ "options": [
18
+ {
19
+ "default": "exploits/routers/dlink/dir_645_unauth_rce",
20
+ "description": "RouterSploit module to run.",
21
+ "name": "module",
22
+ "type": "string"
23
+ }
24
+ ],
25
+ "risk": "high",
26
+ "schema_version": 1,
27
+ "version": "0.1.0"
28
+ }
@@ -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("searchsploit", [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: `searchsploit 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 exploits = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ if (!trimmed.includes(" | ")) continue;
26
+ if (/^Exploit Title/i.test(trimmed)) continue;
27
+ if (/^-+$/.test(trimmed.replace(/\|/g, "").trim())) continue;
28
+ const parts = trimmed.split(" | ");
29
+ if (parts.length < 2) continue;
30
+ exploits.push({ title: parts[0].trim(), path: parts[1].trim() });
31
+ }
32
+ if (code !== 0 && !exploits.length) {
33
+ emit({ type: "error", message: `searchsploit failed: ${stderr.trim() || `exited with ${code}`}` });
34
+ process.exitCode = 1;
35
+ return;
36
+ }
37
+ emit({
38
+ type: "result",
39
+ summary: `searchsploit found ${exploits.length} exploits for ${target}.`,
40
+ data: { target, exploits: exploits.slice(0, 100) },
41
+ });
42
+ emit({ type: "done", summary: `searchsploit finished: ${exploits.length} exploits.` });
43
+ });
44
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "exploitation",
3
+ "core_api": "^0.1.0",
4
+ "description": "Searches Exploit-DB with searchsploit and reports matching exploits.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "searchsploit",
9
+ "install_hint": "Install searchsploit from your distribution packages (exploitdb).",
10
+ "name": "searchsploit"
11
+ }
12
+ ],
13
+ "id": "exploitation/searchsploit",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "searchsploit",
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("shellcheck", ["--format=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: `ShellCheck 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 comments = [];
27
+ const raw = Array.isArray(report?.comments) ? report.comments : [];
28
+ for (const comment of raw) {
29
+ comments.push({ line: comment.line ?? null, column: comment.column ?? null, level: comment.level ?? "", code: comment.code ?? "", message: comment.message ?? "" });
30
+ }
31
+ if (code !== 0 && !comments.length && !report) {
32
+ emit({ type: "error", message: `ShellCheck failed: ${stderr.trim() || `exited with ${code}`}` });
33
+ process.exitCode = 1;
34
+ return;
35
+ }
36
+ const byLevel = {};
37
+ for (const comment of comments) {
38
+ byLevel[comment.level] = (byLevel[comment.level] ?? 0) + 1;
39
+ }
40
+ emit({
41
+ type: "result",
42
+ summary: `ShellCheck found ${comments.length} comments in ${target}.`,
43
+ data: { target, total: comments.length, by_level: byLevel, comments: comments.slice(0, 100) },
44
+ });
45
+ emit({ type: "done", summary: `ShellCheck finished: ${comments.length} comments.` });
46
+ });
47
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "code-audit",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lints a shell script with ShellCheck and reports the warnings.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "shellcheck",
9
+ "install_hint": "Install ShellCheck from your distribution packages.",
10
+ "name": "ShellCheck"
11
+ }
12
+ ],
13
+ "id": "code-audit/shellcheck",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "ShellCheck",
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("smbclient", ["-L", target, "-N"], { 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: `smbclient 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 shares = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const match = trimmed.match(/^(\S+)\s+(Disk|Printer|IPC)\s*(.*)$/);
26
+ if (!match) continue;
27
+ shares.push({ name: match[1], type: match[2], comment: match[3].trim() });
28
+ }
29
+ if (code !== 0 && !shares.length) {
30
+ emit({ type: "error", message: `smbclient failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `smbclient found ${shares.length} shares on ${target}.`,
37
+ data: { target, shares: shares.slice(0, 100) },
38
+ });
39
+ emit({ type: "done", summary: `smbclient finished: ${shares.length} shares.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "internal",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lists SMB shares on a host with smbclient and reports what it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "smbclient",
9
+ "install_hint": "Install smbclient from your distribution packages (samba-client).",
10
+ "name": "smbclient"
11
+ }
12
+ ],
13
+ "id": "internal/smbclient",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "smbclient",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -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 community = String(request.options?.community ?? "public");
11
+ const child = spawn("snmpwalk", ["-v2c", "-c", community, target], { 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: `snmpwalk failed: ${error.message}` });
18
+ process.exitCode = 1;
19
+ });
20
+ child.on("close", (code) => {
21
+ const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
22
+ const entries = [];
23
+ for (const line of plain.split("\n")) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed) continue;
26
+ const match = trimmed.match(/^(\S+)\s+=\s+(\w+):\s*(.*)$/);
27
+ if (!match) continue;
28
+ entries.push({ oid: match[1], type: match[2], value: match[3].trim() });
29
+ }
30
+ if (code !== 0 && !entries.length) {
31
+ emit({ type: "error", message: `snmpwalk failed: ${stderr.trim() || `exited with ${code}`}` });
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ emit({
36
+ type: "result",
37
+ summary: `snmpwalk returned ${entries.length} entries from ${target}.`,
38
+ data: { target, community, entries: entries.slice(0, 200) },
39
+ });
40
+ emit({ type: "done", summary: `snmpwalk finished: ${entries.length} entries.` });
41
+ });
42
+ });
@@ -0,0 +1,28 @@
1
+ {
2
+ "category": "network",
3
+ "core_api": "^0.1.0",
4
+ "description": "Walks an SNMP agent with snmpwalk and reports the entries it returns.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "snmpwalk",
9
+ "install_hint": "Install snmpwalk from your distribution packages (net-snmp).",
10
+ "name": "snmpwalk"
11
+ }
12
+ ],
13
+ "id": "network/snmpwalk",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "snmpwalk",
17
+ "options": [
18
+ {
19
+ "default": "public",
20
+ "description": "SNMP community string to use.",
21
+ "name": "community",
22
+ "type": "string"
23
+ }
24
+ ],
25
+ "risk": "low",
26
+ "schema_version": 1,
27
+ "version": "0.1.0"
28
+ }
@@ -0,0 +1,39 @@
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("sysdig", ["-n", "10", "-p", "%proc.name %evt.type"], { 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: `sysdig 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 events = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ events.push(trimmed);
26
+ }
27
+ if (code !== 0 && !events.length) {
28
+ emit({ type: "error", message: `sysdig failed: ${stderr.trim() || `exited with ${code}`}` });
29
+ process.exitCode = 1;
30
+ return;
31
+ }
32
+ emit({
33
+ type: "result",
34
+ summary: `sysdig captured ${events.length} events.`,
35
+ data: { target, events: events.slice(0, 100) },
36
+ });
37
+ emit({ type: "done", summary: `sysdig finished: ${events.length} events.` });
38
+ });
39
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "incident-response",
3
+ "core_api": "^0.1.0",
4
+ "description": "Captures a short burst of system calls with sysdig and reports the events.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "sysdig",
9
+ "install_hint": "Install sysdig from your distribution packages.",
10
+ "name": "sysdig"
11
+ }
12
+ ],
13
+ "id": "incident-response/sysdig",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "sysdig",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -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("vagrant", ["status", "--machine-readable"], { 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: `Vagrant 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 machines = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const parts = trimmed.split(",");
26
+ if (parts.length < 4) continue;
27
+ if (parts[2] !== "state") continue;
28
+ machines.push({ name: parts[1], state: parts[3] });
29
+ }
30
+ if (code !== 0 && !machines.length && !plain.trim()) {
31
+ emit({ type: "error", message: `Vagrant failed: ${stderr.trim() || `exited with ${code}`}` });
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ emit({
36
+ type: "result",
37
+ summary: `Vagrant found ${machines.length} machines.`,
38
+ data: { target, machines: machines.slice(0, 100) },
39
+ });
40
+ emit({ type: "done", summary: `Vagrant finished: ${machines.length} machines.` });
41
+ });
42
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "automation",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lists Vagrant machines and their states.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "vagrant",
9
+ "install_hint": "Install Vagrant from your distribution packages or the HashiCorp releases.",
10
+ "name": "Vagrant"
11
+ }
12
+ ],
13
+ "id": "automation/vagrant",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Vagrant Status",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }