cantarella-framework 1.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.16.0
4
+
5
+ - New modules: ansible-lint playbook linting, Vagrant machine status, searchsploit Exploit-DB search, linpeas privilege escalation enumeration, smbclient share listing, enum4linux user and group enumeration, HTML report export, SARIF export, hcxdumptool handshake capture, and wifite wireless attacks.
6
+
3
7
  ## 1.15.0
4
8
 
5
9
  - 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.
@@ -0,0 +1,56 @@
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 = build(String(request.target ?? ""));
11
+ emit({ type: "result", summary: result.summary, data: result.data });
12
+ emit({ type: "done", summary: `HTML report finished: ${result.data.events} events.` });
13
+ } catch (error) {
14
+ emit({ type: "error", message: error.message });
15
+ process.exitCode = 1;
16
+ }
17
+ });
18
+
19
+ function escapeHtml(value) {
20
+ return String(value ?? "")
21
+ .replace(/&/g, "&")
22
+ .replace(/</g, "&lt;")
23
+ .replace(/>/g, "&gt;")
24
+ .replace(/"/g, "&quot;");
25
+ }
26
+
27
+ function build(target) {
28
+ let raw;
29
+ try {
30
+ raw = readFileSync(target, "utf8");
31
+ } catch {
32
+ throw new Error(`Cannot read results file: ${target}.`);
33
+ }
34
+ let parsed;
35
+ try {
36
+ parsed = JSON.parse(raw);
37
+ } catch {
38
+ throw new Error(`Invalid results file: ${target} is not valid JSON.`);
39
+ }
40
+ const events = Array.isArray(parsed.events) ? parsed.events : [];
41
+ const rows = [];
42
+ let count = 0;
43
+ for (const event of events) {
44
+ if (event.type !== "result" && event.type !== "error") continue;
45
+ const summary = event.type === "result" ? (event.summary ?? "") : (event.message ?? "");
46
+ const eventTarget = event.data?.target ?? "";
47
+ rows.push(`<tr><td>${escapeHtml(event.type)}</td><td>${escapeHtml(summary)}</td><td>${escapeHtml(eventTarget)}</td></tr>`);
48
+ count += 1;
49
+ }
50
+ const moduleId = parsed.module?.id ?? "unknown";
51
+ const html = `<!DOCTYPE html><html><head><title>Cantarella Report</title></head><body><h1>Cantarella Report: ${escapeHtml(moduleId)}</h1><table><tr><th>Type</th><th>Summary</th><th>Target</th></tr>${rows.join("")}</table></body></html>`;
52
+ return {
53
+ summary: `HTML report built: ${count} events from ${target}.`,
54
+ data: { source: target, events: count, html },
55
+ };
56
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category": "reporting",
3
+ "core_api": "^0.1.0",
4
+ "description": "Converts a Cantarella run results file into a readable HTML report.",
5
+ "entry": "index.mjs",
6
+ "id": "reporting/html-report",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "HTML Report",
10
+ "options": [],
11
+ "risk": "info",
12
+ "schema_version": 1,
13
+ "version": "0.1.0"
14
+ }
@@ -0,0 +1,53 @@
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 = build(String(request.target ?? ""));
11
+ emit({ type: "result", summary: result.summary, data: result.data });
12
+ emit({ type: "done", summary: `SARIF export finished: ${result.data.results} results.` });
13
+ } catch (error) {
14
+ emit({ type: "error", message: error.message });
15
+ process.exitCode = 1;
16
+ }
17
+ });
18
+
19
+ function build(target) {
20
+ let raw;
21
+ try {
22
+ raw = readFileSync(target, "utf8");
23
+ } catch {
24
+ throw new Error(`Cannot read results file: ${target}.`);
25
+ }
26
+ let parsed;
27
+ try {
28
+ parsed = JSON.parse(raw);
29
+ } catch {
30
+ throw new Error(`Invalid results file: ${target} is not valid JSON.`);
31
+ }
32
+ const events = Array.isArray(parsed.events) ? parsed.events : [];
33
+ const results = [];
34
+ for (const event of events) {
35
+ if (event.type !== "result" && event.type !== "error") continue;
36
+ const message = event.type === "result" ? (event.summary ?? "") : (event.message ?? "");
37
+ results.push({ ruleId: "cantarella/result", level: "note", message: { text: message } });
38
+ }
39
+ const sarif = {
40
+ version: "2.1.0",
41
+ $schema: "https://json.schemastore.org/sarif-2.1.0.json",
42
+ runs: [
43
+ {
44
+ tool: { driver: { name: "Cantarella", version: "1.16.0", rules: [{ id: "cantarella/result", name: "CantarellaResult", shortDescription: { text: "A Cantarella run result." } }] } },
45
+ results,
46
+ },
47
+ ],
48
+ };
49
+ return {
50
+ summary: `SARIF export built: ${results.length} results from ${target}.`,
51
+ data: { source: target, results: results.length, sarif },
52
+ };
53
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category": "reporting",
3
+ "core_api": "^0.1.0",
4
+ "description": "Converts a Cantarella run results file into SARIF format for code scanning tools.",
5
+ "entry": "index.mjs",
6
+ "id": "reporting/sarif-export",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "SARIF Export",
10
+ "options": [],
11
+ "risk": "info",
12
+ "schema_version": 1,
13
+ "version": "0.1.0"
14
+ }
@@ -0,0 +1,48 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ let input = "";
4
+ process.stdin.setEncoding("utf8");
5
+ process.stdin.on("data", (chunk) => (input += chunk));
6
+ process.stdin.on("end", () => {
7
+ const request = JSON.parse(input || "{}");
8
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
9
+ const target = String(request.target ?? "");
10
+ const child = spawn("ansible-lint", ["--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: `ansible-lint failed: ${error.message}` });
17
+ process.exitCode = 1;
18
+ });
19
+ child.on("close", (code) => {
20
+ let findings = null;
21
+ try {
22
+ findings = JSON.parse(stdout);
23
+ } catch {
24
+ findings = null;
25
+ }
26
+ const items = [];
27
+ if (Array.isArray(findings)) {
28
+ for (const finding of findings) {
29
+ items.push({ file: finding.filename ?? "", line: finding.line ?? null, tag: finding.tag ?? "", severity: finding.severity ?? "", message: finding.message ?? "" });
30
+ }
31
+ }
32
+ if (code !== 0 && !items.length && !findings) {
33
+ emit({ type: "error", message: `ansible-lint failed: ${stderr.trim() || `exited with ${code}`}` });
34
+ process.exitCode = 1;
35
+ return;
36
+ }
37
+ const bySeverity = {};
38
+ for (const item of items) {
39
+ bySeverity[item.severity] = (bySeverity[item.severity] ?? 0) + 1;
40
+ }
41
+ emit({
42
+ type: "result",
43
+ summary: `ansible-lint found ${items.length} findings in ${target}.`,
44
+ data: { target, total: items.length, by_severity: bySeverity, findings: items.slice(0, 100) },
45
+ });
46
+ emit({ type: "done", summary: `ansible-lint finished: ${items.length} findings.` });
47
+ });
48
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "automation",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lints Ansible playbooks with ansible-lint and reports the findings.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "ansible-lint",
9
+ "install_hint": "Install ansible-lint from your distribution packages or with pipx install ansible-lint.",
10
+ "name": "ansible-lint"
11
+ }
12
+ ],
13
+ "id": "automation/ansible-lint",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "ansible-lint",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -0,0 +1,43 @@
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("enum4linux", ["-a", 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: `enum4linux 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 users = new Set();
22
+ const groups = new Set();
23
+ for (const line of plain.split("\n")) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed) continue;
26
+ const userMatch = trimmed.match(/user:\[([^\]]+)\]/);
27
+ if (userMatch) users.add(userMatch[1]);
28
+ const groupMatch = trimmed.match(/group:\[([^\]]+)\]/);
29
+ if (groupMatch) groups.add(groupMatch[1]);
30
+ }
31
+ if (code !== 0 && !users.size && !groups.size && !plain.trim()) {
32
+ emit({ type: "error", message: `enum4linux failed: ${stderr.trim() || `exited with ${code}`}` });
33
+ process.exitCode = 1;
34
+ return;
35
+ }
36
+ emit({
37
+ type: "result",
38
+ summary: `enum4linux found ${users.size} users and ${groups.size} groups on ${target}.`,
39
+ data: { target, users: [...users].sort(), groups: [...groups].sort() },
40
+ });
41
+ emit({ type: "done", summary: `enum4linux finished: ${users.size} users, ${groups.size} groups.` });
42
+ });
43
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "internal",
3
+ "core_api": "^0.1.0",
4
+ "description": "Enumerates users, groups, and shares on a Windows host with enum4linux.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "enum4linux",
9
+ "install_hint": "Install enum4linux from your distribution packages.",
10
+ "name": "enum4linux"
11
+ }
12
+ ],
13
+ "id": "internal/enum4linux",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "enum4linux",
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,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,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 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
+ }
@@ -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 wordlist = String(request.options?.wordlist ?? "wordlist.txt");
11
+ const child = spawn("wifite", ["--all", "--dict", wordlist], { 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: `wifite 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 cracked = [];
23
+ for (const line of plain.split("\n")) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed) continue;
26
+ if (/Cracked/i.test(trimmed)) cracked.push(trimmed);
27
+ }
28
+ if (code !== 0 && !cracked.length && !plain.trim()) {
29
+ emit({ type: "error", message: `wifite failed: ${stderr.trim() || `exited with ${code}`}` });
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: cracked.length ? `wifite cracked ${cracked.length} networks.` : "wifite cracked no networks.",
36
+ data: { target, wordlist, cracked: cracked.slice(0, 100) },
37
+ });
38
+ emit({ type: "done", summary: cracked.length ? `wifite finished: ${cracked.length} cracked.` : "wifite finished: none cracked." });
39
+ });
40
+ });
@@ -0,0 +1,28 @@
1
+ {
2
+ "category": "wireless",
3
+ "core_api": "^0.1.0",
4
+ "description": "Attacks wireless networks with wifite and reports the networks it cracked.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "wifite",
9
+ "install_hint": "Install wifite from your distribution packages.",
10
+ "name": "wifite"
11
+ }
12
+ ],
13
+ "id": "wireless/wifite",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "wifite",
17
+ "options": [
18
+ {
19
+ "default": "wordlist.txt",
20
+ "description": "Password wordlist file.",
21
+ "name": "wordlist",
22
+ "type": "string"
23
+ }
24
+ ],
25
+ "risk": "high",
26
+ "schema_version": 1,
27
+ "version": "0.1.0"
28
+ }
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.15.0",
22
+ "version": "1.16.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.15.0";
14
+ const VERSION = "1.16.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.15.0",
82
- update_message: (await checkForUpdate("1.15.0")).message,
81
+ version: "1.16.0",
82
+ update_message: (await checkForUpdate("1.16.0")).message,
83
83
  categories: CATEGORIES,
84
84
  modules: modules.map(({ manifest }) => manifest),
85
85
  external_tools: [...tools.values()],