cantarella-framework 1.14.0 → 1.15.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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.15.0
4
+
5
+ - New modules: RouterSploit router exploits, WebSocket upgrade checks, dnsrecon DNS enumeration, ShellCheck script linting, Docker Bench security checks, detect-secrets secret scanning, file type identification, sysdig event capture, crunch wordlist generation, and snmpwalk SNMP enumeration.
6
+
3
7
  ## 1.14.0
4
8
 
5
9
  - New modules: SOAP endpoint checks, Sublist3r subdomain enumeration, gosec Go audits, Terrascan IaC scans, Hadolint Dockerfile linting, pdf-parser PDF analysis, rkhunter rootkit checks, Medusa credential testing, onesixtyone SNMP scans, and GreyNoise IP lookups.
@@ -0,0 +1,65 @@
1
+ import http from "node:http";
2
+ import https from "node:https";
3
+
4
+ let input = "";
5
+ process.stdin.setEncoding("utf8");
6
+ process.stdin.on("data", (chunk) => (input += chunk));
7
+ process.stdin.on("end", () => {
8
+ const request = JSON.parse(input || "{}");
9
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
10
+ check(String(request.target ?? ""), emit).catch((error) => {
11
+ emit({ type: "error", message: error.message });
12
+ process.exitCode = 1;
13
+ });
14
+ });
15
+
16
+ function check(target, emit) {
17
+ return new Promise((resolve, reject) => {
18
+ let url;
19
+ try {
20
+ url = new URL(target);
21
+ } catch {
22
+ reject(new Error(`WebSocket check failed: invalid URL ${target}.`));
23
+ return;
24
+ }
25
+ const lib = url.protocol === "https:" || url.protocol === "wss:" ? https : http;
26
+ const request = lib.request(url, {
27
+ method: "GET",
28
+ headers: {
29
+ Connection: "Upgrade",
30
+ Upgrade: "websocket",
31
+ "Sec-WebSocket-Key": "dGhlIHNhbXBsZSBub25jZQ==",
32
+ "Sec-WebSocket-Version": "13",
33
+ },
34
+ });
35
+ const timer = setTimeout(() => {
36
+ request.destroy(new Error("timeout"));
37
+ }, 5000);
38
+ request.on("upgrade", (response) => {
39
+ clearTimeout(timer);
40
+ emit({
41
+ type: "result",
42
+ summary: `${target} accepts WebSocket upgrades.`,
43
+ data: { target, websocket: true, status: response.statusCode },
44
+ });
45
+ emit({ type: "done", summary: "WebSocket check finished: upgrade accepted." });
46
+ resolve();
47
+ });
48
+ request.on("response", (response) => {
49
+ clearTimeout(timer);
50
+ emit({
51
+ type: "result",
52
+ summary: `${target} does not accept WebSocket upgrades (HTTP ${response.statusCode}).`,
53
+ data: { target, websocket: false, status: response.statusCode },
54
+ });
55
+ emit({ type: "done", summary: "WebSocket check finished: no upgrade." });
56
+ response.resume();
57
+ resolve();
58
+ });
59
+ request.on("error", (error) => {
60
+ clearTimeout(timer);
61
+ reject(new Error(`WebSocket check failed: cannot reach ${target}: ${error.message}`));
62
+ });
63
+ request.end();
64
+ });
65
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category": "api",
3
+ "core_api": "^0.1.0",
4
+ "description": "Checks whether an endpoint accepts a WebSocket upgrade and reports the result.",
5
+ "entry": "index.mjs",
6
+ "id": "api/websocket-checker",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "WebSocket Checker",
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 min = String(request.options?.min ?? "1");
11
+ const max = String(request.options?.max ?? "3");
12
+ const child = spawn("crunch", [min, max, 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: `crunch 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 words = [];
24
+ for (const line of plain.split("\n")) {
25
+ const trimmed = line.trim();
26
+ if (!trimmed) continue;
27
+ if (trimmed.startsWith("Crunch")) continue;
28
+ words.push(trimmed);
29
+ }
30
+ if (code !== 0 && !words.length) {
31
+ emit({ type: "error", message: `crunch failed: ${stderr.trim() || `exited with ${code}`}` });
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ emit({
36
+ type: "result",
37
+ summary: `crunch generated ${words.length} words from ${target}.`,
38
+ data: { target, min, max, words: words.length, sample: words.slice(0, 20) },
39
+ });
40
+ emit({ type: "done", summary: `crunch finished: ${words.length} words.` });
41
+ });
42
+ });
@@ -0,0 +1,34 @@
1
+ {
2
+ "category": "password",
3
+ "core_api": "^0.1.0",
4
+ "description": "Generates a wordlist with crunch and reports the words it produced.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "crunch",
9
+ "install_hint": "Install crunch from your distribution packages.",
10
+ "name": "crunch"
11
+ }
12
+ ],
13
+ "id": "password/crunch",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "crunch",
17
+ "options": [
18
+ {
19
+ "default": "1",
20
+ "description": "Minimum word length.",
21
+ "name": "min",
22
+ "type": "string"
23
+ },
24
+ {
25
+ "default": "3",
26
+ "description": "Maximum word length.",
27
+ "name": "max",
28
+ "type": "string"
29
+ }
30
+ ],
31
+ "risk": "low",
32
+ "schema_version": 1,
33
+ "version": "0.1.0"
34
+ }
@@ -0,0 +1,46 @@
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("detect-secrets", ["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: `detect-secrets 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 secrets = [];
27
+ const results = report?.results && typeof report.results === "object" ? report.results : {};
28
+ for (const [file, entries] of Object.entries(results)) {
29
+ if (!Array.isArray(entries)) continue;
30
+ for (const entry of entries) {
31
+ secrets.push({ file, type: entry.type ?? "", line: entry.line_number ?? null });
32
+ }
33
+ }
34
+ if (code !== 0 && !secrets.length && !report) {
35
+ emit({ type: "error", message: `detect-secrets failed: ${stderr.trim() || `exited with ${code}`}` });
36
+ process.exitCode = 1;
37
+ return;
38
+ }
39
+ emit({
40
+ type: "result",
41
+ summary: `detect-secrets found ${secrets.length} secrets in ${target}.`,
42
+ data: { target, total: secrets.length, secrets: secrets.slice(0, 100) },
43
+ });
44
+ emit({ type: "done", summary: `detect-secrets finished: ${secrets.length} secrets.` });
45
+ });
46
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "devsecops",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans a directory for leaked secrets with detect-secrets and reports what it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "detect-secrets",
9
+ "install_hint": "Install detect-secrets from your distribution packages or with pipx install detect-secrets.",
10
+ "name": "detect-secrets"
11
+ }
12
+ ],
13
+ "id": "devsecops/detect-secrets",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "detect-secrets",
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("dnsrecon", ["-d", target, "-t", "std"], { 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: `dnsrecon 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 records = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const match = trimmed.match(/^\[\*\]\s+(\w+)\s+(\S+)\s+(.+)$/);
26
+ if (!match) continue;
27
+ records.push({ type: match[1], name: match[2], value: match[3].trim() });
28
+ }
29
+ if (code !== 0 && !records.length) {
30
+ emit({ type: "error", message: `dnsrecon failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `dnsrecon found ${records.length} DNS records for ${target}.`,
37
+ data: { target, records: records.slice(0, 200) },
38
+ });
39
+ emit({ type: "done", summary: `dnsrecon finished: ${records.length} records.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "recon",
3
+ "core_api": "^0.1.0",
4
+ "description": "Enumerates DNS records of a domain with dnsrecon and reports what it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "dnsrecon",
9
+ "install_hint": "Install dnsrecon from your distribution packages or with pipx install dnsrecon.",
10
+ "name": "dnsrecon"
11
+ }
12
+ ],
13
+ "id": "recon/dnsrecon",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "dnsrecon",
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("docker-bench-security", [], { 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: `Docker Bench 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 warnings = [];
22
+ let passes = 0;
23
+ for (const line of plain.split("\n")) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed) continue;
26
+ if (/\[WARN\]/.test(trimmed)) warnings.push(trimmed);
27
+ else if (/\[PASS\]/.test(trimmed)) passes += 1;
28
+ }
29
+ if (code !== 0 && !warnings.length && !plain.trim()) {
30
+ emit({ type: "error", message: `Docker Bench failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `Docker Bench found ${warnings.length} warnings and ${passes} passes.`,
37
+ data: { target, warnings: warnings.slice(0, 100), passes },
38
+ });
39
+ emit({ type: "done", summary: `Docker Bench finished: ${warnings.length} warnings.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "cloud",
3
+ "core_api": "^0.1.0",
4
+ "description": "Runs the Docker Bench for Security and reports the warnings it finds.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "docker-bench-security",
9
+ "install_hint": "Install Docker Bench for Security from the Docker Bench repository.",
10
+ "name": "Docker Bench"
11
+ }
12
+ ],
13
+ "id": "cloud/docker-bench",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Docker Bench",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
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("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,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,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,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
+ }
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.14.0",
22
+ "version": "1.15.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.14.0";
14
+ const VERSION = "1.15.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.14.0",
82
- update_message: (await checkForUpdate("1.14.0")).message,
81
+ version: "1.15.0",
82
+ update_message: (await checkForUpdate("1.15.0")).message,
83
83
  categories: CATEGORIES,
84
84
  modules: modules.map(({ manifest }) => manifest),
85
85
  external_tools: [...tools.values()],