cantarella-framework 1.12.0 → 1.13.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.13.0
4
+
5
+ - New modules: XSStrike XSS scans, GraphQL introspection checks, crt.sh subdomain lookups, Brakeman Rails audits, kubectl pod listings, Snyk dependency tests, YARA rule scans, chkrootkit rootkit checks, CeWL wordlist building, and arp-scan host discovery.
6
+
3
7
  ## 1.12.0
4
8
 
5
9
  - New modules: ldapsearch LDAP rootDSE queries, Terraform plan summaries, Reaver WPS attacks, MobSFScan mobile code scans, osquery SQL queries, robots.txt checks, Shodan host lookups, URLhaus blocklist checks, OpenVAS import, and CSV export of run results.
@@ -0,0 +1,44 @@
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
+ check(String(request.target ?? ""), emit).catch((error) => {
8
+ emit({ type: "error", message: error.message });
9
+ process.exitCode = 1;
10
+ });
11
+ });
12
+
13
+ async function check(target, emit) {
14
+ const base = target.replace(/\/$/, "");
15
+ const url = `${base}/graphql`;
16
+ let response;
17
+ try {
18
+ response = await fetch(url, {
19
+ method: "POST",
20
+ headers: { "content-type": "application/json" },
21
+ body: JSON.stringify({ query: "{ __schema { types { name } } }" }),
22
+ });
23
+ } catch (error) {
24
+ throw new Error(`GraphQL check failed: cannot reach ${url}: ${error.message}`);
25
+ }
26
+ if (!response.ok) {
27
+ throw new Error(`GraphQL check failed: HTTP ${response.status} for ${url}.`);
28
+ }
29
+ let report;
30
+ try {
31
+ report = await response.json();
32
+ } catch {
33
+ throw new Error(`GraphQL check failed: ${url} did not return JSON.`);
34
+ }
35
+ const types = report.data?.__schema?.types;
36
+ const enabled = Array.isArray(types);
37
+ const typeNames = enabled ? types.map((type) => type.name).filter(Boolean) : [];
38
+ emit({
39
+ type: "result",
40
+ summary: enabled ? `GraphQL introspection is enabled on ${target}: ${typeNames.length} types.` : `GraphQL introspection is disabled on ${target}.`,
41
+ data: { target, introspection: enabled, types: typeNames.length, type_names: typeNames.slice(0, 50) },
42
+ });
43
+ emit({ type: "done", summary: enabled ? `GraphQL check finished: introspection enabled, ${typeNames.length} types.` : "GraphQL check finished: introspection disabled." });
44
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category": "api",
3
+ "core_api": "^0.1.0",
4
+ "description": "Probes a GraphQL endpoint for an enabled introspection query and lists its types.",
5
+ "entry": "index.mjs",
6
+ "id": "api/graphql-checker",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "GraphQL Checker",
10
+ "options": [],
11
+ "risk": "low",
12
+ "schema_version": 1,
13
+ "version": "0.1.0"
14
+ }
@@ -0,0 +1,48 @@
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
+ lookup(String(request.target ?? ""), emit).catch((error) => {
8
+ emit({ type: "error", message: error.message });
9
+ process.exitCode = 1;
10
+ });
11
+ });
12
+
13
+ async function lookup(target, emit) {
14
+ const base = (process.env.CANTA_CRTSH_API_URL ?? "https://crt.sh").replace(/\/$/, "");
15
+ const url = `${base}/?q=${encodeURIComponent(target)}&output=json`;
16
+ let response;
17
+ try {
18
+ response = await fetch(url);
19
+ } catch (error) {
20
+ throw new Error(`crt.sh lookup failed: cannot reach ${base}: ${error.message}`);
21
+ }
22
+ if (!response.ok) {
23
+ throw new Error(`crt.sh lookup failed: HTTP ${response.status} for ${target}.`);
24
+ }
25
+ let entries;
26
+ try {
27
+ entries = await response.json();
28
+ } catch {
29
+ throw new Error(`crt.sh lookup failed: ${base} did not return JSON.`);
30
+ }
31
+ if (!Array.isArray(entries)) {
32
+ throw new Error(`crt.sh lookup failed: unexpected response for ${target}.`);
33
+ }
34
+ const subdomains = new Set();
35
+ for (const entry of entries) {
36
+ const value = String(entry.name_value ?? "");
37
+ for (const name of value.split("\n")) {
38
+ const clean = name.trim().replace(/^\*\./, "");
39
+ if (clean) subdomains.add(clean);
40
+ }
41
+ }
42
+ emit({
43
+ type: "result",
44
+ summary: `crt.sh found ${entries.length} certificates and ${subdomains.size} subdomains for ${target}.`,
45
+ data: { target, certificates: entries.length, subdomains: [...subdomains].sort().slice(0, 200) },
46
+ });
47
+ emit({ type: "done", summary: `crt.sh lookup finished: ${subdomains.size} subdomains.` });
48
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category": "recon",
3
+ "core_api": "^0.1.0",
4
+ "description": "Queries crt.sh certificate transparency logs and lists subdomains for a domain.",
5
+ "entry": "index.mjs",
6
+ "id": "recon/crtsh",
7
+ "kind": "native",
8
+ "maintenance": "active",
9
+ "name": "crt.sh Lookup",
10
+ "options": [],
11
+ "risk": "low",
12
+ "schema_version": 1,
13
+ "version": "0.1.0"
14
+ }
@@ -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("arp-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: `arp-scan 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 hosts = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ const match = trimmed.match(/^(\d+\.\d+\.\d+\.\d+)\t([0-9a-fA-F:]+)\t(.*)$/);
26
+ if (!match) continue;
27
+ hosts.push({ ip: match[1], mac: match[2], vendor: match[3].trim() });
28
+ }
29
+ if (code !== 0 && !hosts.length) {
30
+ emit({ type: "error", message: `arp-scan failed: ${stderr.trim() || `exited with ${code}`}` });
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ emit({
35
+ type: "result",
36
+ summary: `arp-scan found ${hosts.length} live hosts on ${target}.`,
37
+ data: { target, hosts: hosts.slice(0, 200) },
38
+ });
39
+ emit({ type: "done", summary: `arp-scan finished: ${hosts.length} hosts.` });
40
+ });
41
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "network",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans a network range with arp-scan and reports the live hosts and their MAC addresses.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "arp-scan",
9
+ "install_hint": "Install arp-scan from your distribution packages.",
10
+ "name": "arp-scan"
11
+ }
12
+ ],
13
+ "id": "network/arp-scan",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "arp-scan",
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("brakeman", ["--format", "json", "--no-pager", 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: `Brakeman 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 warnings = [];
27
+ const raw = Array.isArray(report?.warnings) ? report.warnings : [];
28
+ for (const warning of raw) {
29
+ warnings.push({ type: warning.warning_type ?? "", message: warning.message ?? "", file: warning.file ?? "", line: warning.line ?? null, confidence: warning.confidence ?? "" });
30
+ }
31
+ if (code !== 0 && !warnings.length && !report) {
32
+ emit({ type: "error", message: `Brakeman failed: ${stderr.trim() || `exited with ${code}`}` });
33
+ process.exitCode = 1;
34
+ return;
35
+ }
36
+ const byConfidence = {};
37
+ for (const warning of warnings) {
38
+ byConfidence[warning.confidence] = (byConfidence[warning.confidence] ?? 0) + 1;
39
+ }
40
+ emit({
41
+ type: "result",
42
+ summary: `Brakeman found ${warnings.length} warnings in ${target}.`,
43
+ data: { target, total: warnings.length, by_confidence: byConfidence, warnings: warnings.slice(0, 100) },
44
+ });
45
+ emit({ type: "done", summary: `Brakeman finished: ${warnings.length} warnings.` });
46
+ });
47
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "code-audit",
3
+ "core_api": "^0.1.0",
4
+ "description": "Audits Ruby on Rails code with Brakeman and reports the security warnings.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "brakeman",
9
+ "install_hint": "Install Brakeman from your distribution packages or with gem install brakeman.",
10
+ "name": "Brakeman"
11
+ }
12
+ ],
13
+ "id": "code-audit/brakeman",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Brakeman",
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("cewl", ["-m", "3", 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: `CeWL 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 words = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ if (!/^[a-zA-Z0-9_-]+$/.test(trimmed)) continue;
26
+ words.push(trimmed);
27
+ }
28
+ if (code !== 0 && !words.length) {
29
+ emit({ type: "error", message: `CeWL failed: ${stderr.trim() || `exited with ${code}`}` });
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: `CeWL collected ${words.length} words from ${target}.`,
36
+ data: { target, words: words.length, sample: words.slice(0, 20) },
37
+ });
38
+ emit({ type: "done", summary: `CeWL finished: ${words.length} words.` });
39
+ });
40
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "password",
3
+ "core_api": "^0.1.0",
4
+ "description": "Builds a wordlist from a website with CeWL and reports the words it found.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "cewl",
9
+ "install_hint": "Install CeWL from your distribution packages or with gem install cewl.",
10
+ "name": "CeWL"
11
+ }
12
+ ],
13
+ "id": "password/cewl",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "CeWL",
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("chkrootkit", ["-q"], { 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: `chkrootkit 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
+ if (!trimmed) continue;
25
+ if (/not infected/i.test(trimmed)) continue;
26
+ if (/INFECTED/i.test(trimmed)) infected.push(trimmed);
27
+ }
28
+ if (code !== 0 && !infected.length && !plain.trim()) {
29
+ emit({ type: "error", message: `chkrootkit failed: ${stderr.trim() || `exited with ${code}`}` });
30
+ process.exitCode = 1;
31
+ return;
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: infected.length ? `chkrootkit found ${infected.length} infected checks.` : "chkrootkit found no infected checks.",
36
+ data: { target, infected: infected.slice(0, 100), clean: infected.length === 0 },
37
+ });
38
+ emit({ type: "done", summary: infected.length ? `chkrootkit finished: ${infected.length} infected checks.` : "chkrootkit finished: clean." });
39
+ });
40
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "incident-response",
3
+ "core_api": "^0.1.0",
4
+ "description": "Runs chkrootkit and reports any infected system checks.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "chkrootkit",
9
+ "install_hint": "Install chkrootkit from your distribution packages.",
10
+ "name": "chkrootkit"
11
+ }
12
+ ],
13
+ "id": "incident-response/chkrootkit",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "chkrootkit",
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("kubectl", ["get", "pods", "--all-namespaces", "-o", "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: `kubectl 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 items = Array.isArray(report?.items) ? report.items : [];
27
+ if (code !== 0 && !report) {
28
+ emit({ type: "error", message: `kubectl failed: ${stderr.trim() || `exited with ${code}`}` });
29
+ process.exitCode = 1;
30
+ return;
31
+ }
32
+ const byNamespace = {};
33
+ const byPhase = {};
34
+ for (const item of items) {
35
+ const namespace = item.metadata?.namespace ?? "unknown";
36
+ const phase = item.status?.phase ?? "unknown";
37
+ byNamespace[namespace] = (byNamespace[namespace] ?? 0) + 1;
38
+ byPhase[phase] = (byPhase[phase] ?? 0) + 1;
39
+ }
40
+ emit({
41
+ type: "result",
42
+ summary: `kubectl found ${items.length} pods across ${Object.keys(byNamespace).length} namespaces.`,
43
+ data: { target, pods: items.length, by_namespace: byNamespace, by_phase: byPhase },
44
+ });
45
+ emit({ type: "done", summary: `kubectl finished: ${items.length} pods.` });
46
+ });
47
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "cloud",
3
+ "core_api": "^0.1.0",
4
+ "description": "Lists Kubernetes pods across all namespaces with kubectl and reports their status.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "kubectl",
9
+ "install_hint": "Install kubectl from your distribution packages or the Kubernetes releases.",
10
+ "name": "kubectl"
11
+ }
12
+ ],
13
+ "id": "cloud/kubectl",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "kubectl Pods",
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("snyk", ["test", "--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: `Snyk 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 vulnerabilities = [];
27
+ const raw = Array.isArray(report?.vulnerabilities) ? report.vulnerabilities : [];
28
+ for (const vuln of raw) {
29
+ vulnerabilities.push({ id: vuln.id ?? "", title: vuln.title ?? "", severity: vuln.severity ?? "unknown", package: vuln.packageName ?? "" });
30
+ }
31
+ if (code !== 0 && !vulnerabilities.length && !report) {
32
+ emit({ type: "error", message: `Snyk failed: ${stderr.trim() || `exited with ${code}`}` });
33
+ process.exitCode = 1;
34
+ return;
35
+ }
36
+ const bySeverity = {};
37
+ for (const vuln of vulnerabilities) {
38
+ bySeverity[vuln.severity] = (bySeverity[vuln.severity] ?? 0) + 1;
39
+ }
40
+ emit({
41
+ type: "result",
42
+ summary: `Snyk found ${vulnerabilities.length} vulnerabilities in ${target}.`,
43
+ data: { target, total: vulnerabilities.length, by_severity: bySeverity, vulnerabilities: vulnerabilities.slice(0, 100) },
44
+ });
45
+ emit({ type: "done", summary: `Snyk finished: ${vulnerabilities.length} vulnerabilities.` });
46
+ });
47
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "devsecops",
3
+ "core_api": "^0.1.0",
4
+ "description": "Tests a project for known vulnerable dependencies with Snyk and reports the findings.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "snyk",
9
+ "install_hint": "Install Snyk from your distribution packages or with npm install -g snyk.",
10
+ "name": "Snyk"
11
+ }
12
+ ],
13
+ "id": "devsecops/snyk",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "Snyk Test",
17
+ "options": [],
18
+ "risk": "low",
19
+ "schema_version": 1,
20
+ "version": "0.1.0"
21
+ }
@@ -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("xsstrike", ["-u", 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: `XSStrike 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 findings = [];
22
+ for (const line of plain.split("\n")) {
23
+ const trimmed = line.trim();
24
+ if (!trimmed) continue;
25
+ if (/vulnerable/i.test(trimmed)) findings.push(trimmed);
26
+ }
27
+ if (code !== 0 && !findings.length && !plain.trim()) {
28
+ emit({ type: "error", message: `XSStrike failed: ${stderr.trim() || `exited with ${code}`}` });
29
+ process.exitCode = 1;
30
+ return;
31
+ }
32
+ emit({
33
+ type: "result",
34
+ summary: findings.length ? `XSStrike found ${findings.length} vulnerable reflections on ${target}.` : `XSStrike found no XSS on ${target}.`,
35
+ data: { target, vulnerable: findings.length > 0, findings: findings.slice(0, 100) },
36
+ });
37
+ emit({ type: "done", summary: findings.length ? `XSStrike finished: ${findings.length} vulnerable reflections.` : "XSStrike finished: no XSS found." });
38
+ });
39
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "category": "web",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans a URL for cross-site scripting with XSStrike and reports vulnerable reflections.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "xsstrike",
9
+ "install_hint": "Install XSStrike from your distribution packages or with pipx install xsstrike.",
10
+ "name": "XSStrike"
11
+ }
12
+ ],
13
+ "id": "web/xsstrike",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "XSStrike",
17
+ "options": [],
18
+ "risk": "medium",
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 rules = String(request.options?.rules ?? "rules.yar");
11
+ const child = spawn("yara", [rules, 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: `YARA 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 matches = [];
23
+ for (const line of plain.split("\n")) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed) continue;
26
+ const parts = trimmed.split(/\s+/);
27
+ if (parts.length < 2) continue;
28
+ matches.push({ rule: parts[0], file: parts.slice(1).join(" ") });
29
+ }
30
+ if (code !== 0 && !matches.length) {
31
+ emit({ type: "error", message: `YARA failed: ${stderr.trim() || `exited with ${code}`}` });
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ emit({
36
+ type: "result",
37
+ summary: `YARA found ${matches.length} rule matches in ${target}.`,
38
+ data: { target, rules, matches: matches.slice(0, 100) },
39
+ });
40
+ emit({ type: "done", summary: `YARA finished: ${matches.length} matches.` });
41
+ });
42
+ });
@@ -0,0 +1,28 @@
1
+ {
2
+ "category": "forensics",
3
+ "core_api": "^0.1.0",
4
+ "description": "Scans a file with YARA rules and reports the rules that match.",
5
+ "entry": "index.mjs",
6
+ "external_tools": [
7
+ {
8
+ "command": "yara",
9
+ "install_hint": "Install YARA from your distribution packages.",
10
+ "name": "YARA"
11
+ }
12
+ ],
13
+ "id": "forensics/yara",
14
+ "kind": "wrapper",
15
+ "maintenance": "active",
16
+ "name": "YARA Scan",
17
+ "options": [
18
+ {
19
+ "default": "rules.yar",
20
+ "description": "Path to the YARA rules file.",
21
+ "name": "rules",
22
+ "type": "string"
23
+ }
24
+ ],
25
+ "risk": "low",
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.12.0",
22
+ "version": "1.13.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.12.0";
14
+ const VERSION = "1.13.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.12.0",
82
- update_message: (await checkForUpdate("1.12.0")).message,
81
+ version: "1.13.0",
82
+ update_message: (await checkForUpdate("1.13.0")).message,
83
83
  categories: CATEGORIES,
84
84
  modules: modules.map(({ manifest }) => manifest),
85
85
  external_tools: [...tools.values()],