cantarella-framework 1.12.0 → 1.14.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 +8 -0
- package/modules/api-graphql-checker/index.mjs +44 -0
- package/modules/api-graphql-checker/module.json +14 -0
- package/modules/api-soap-checker/index.mjs +34 -0
- package/modules/api-soap-checker/module.json +14 -0
- package/modules/recon-crtsh/index.mjs +48 -0
- package/modules/recon-crtsh/module.json +14 -0
- package/modules/threat-intel-greynoise/index.mjs +43 -0
- package/modules/threat-intel-greynoise/module.json +14 -0
- package/modules/wrapper-arp-scan/index.mjs +41 -0
- package/modules/wrapper-arp-scan/module.json +21 -0
- package/modules/wrapper-brakeman/index.mjs +47 -0
- package/modules/wrapper-brakeman/module.json +21 -0
- package/modules/wrapper-cewl/index.mjs +40 -0
- package/modules/wrapper-cewl/module.json +21 -0
- package/modules/wrapper-chkrootkit/index.mjs +40 -0
- package/modules/wrapper-chkrootkit/module.json +21 -0
- package/modules/wrapper-gosec/index.mjs +47 -0
- package/modules/wrapper-gosec/module.json +21 -0
- package/modules/wrapper-hadolint/index.mjs +48 -0
- package/modules/wrapper-hadolint/module.json +21 -0
- package/modules/wrapper-kubectl/index.mjs +47 -0
- package/modules/wrapper-kubectl/module.json +21 -0
- package/modules/wrapper-medusa/index.mjs +44 -0
- package/modules/wrapper-medusa/module.json +40 -0
- package/modules/wrapper-onesixtyone/index.mjs +42 -0
- package/modules/wrapper-onesixtyone/module.json +28 -0
- package/modules/wrapper-pdf-parser/index.mjs +43 -0
- package/modules/wrapper-pdf-parser/module.json +21 -0
- package/modules/wrapper-rkhunter/index.mjs +39 -0
- package/modules/wrapper-rkhunter/module.json +21 -0
- package/modules/wrapper-snyk/index.mjs +47 -0
- package/modules/wrapper-snyk/module.json +21 -0
- package/modules/wrapper-sublist3r/index.mjs +41 -0
- package/modules/wrapper-sublist3r/module.json +21 -0
- package/modules/wrapper-terrascan/index.mjs +47 -0
- package/modules/wrapper-terrascan/module.json +21 -0
- package/modules/wrapper-xsstrike/index.mjs +39 -0
- package/modules/wrapper-xsstrike/module.json +21 -0
- package/modules/wrapper-yara/index.mjs +42 -0
- package/modules/wrapper-yara/module.json +28 -0
- package/package.json +1 -1
- package/packages/cli/dist/cli.js +1 -1
- package/packages/gui/dist/server.js +2 -2
|
@@ -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,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 user = String(request.options?.user ?? "root");
|
|
11
|
+
const wordlist = String(request.options?.wordlist ?? "wordlist.txt");
|
|
12
|
+
const service = String(request.options?.module ?? "ssh");
|
|
13
|
+
const child = spawn("medusa", ["-h", target, "-u", user, "-P", wordlist, "-M", service], { stdio: ["ignore", "pipe", "pipe"] });
|
|
14
|
+
let stdout = "";
|
|
15
|
+
let stderr = "";
|
|
16
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
17
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
18
|
+
child.on("error", (error) => {
|
|
19
|
+
emit({ type: "error", message: `Medusa failed: ${error.message}` });
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
});
|
|
22
|
+
child.on("close", (code) => {
|
|
23
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
24
|
+
const accounts = [];
|
|
25
|
+
for (const line of plain.split("\n")) {
|
|
26
|
+
const trimmed = line.trim();
|
|
27
|
+
if (!trimmed) continue;
|
|
28
|
+
if (!/ACCOUNT FOUND/i.test(trimmed)) continue;
|
|
29
|
+
const match = trimmed.match(/User:\s*(\S+)\s+Password:\s*(\S+)/);
|
|
30
|
+
if (match) accounts.push({ user: match[1], password: match[2] });
|
|
31
|
+
}
|
|
32
|
+
if (code !== 0 && !accounts.length && !plain.trim()) {
|
|
33
|
+
emit({ type: "error", message: `Medusa failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
emit({
|
|
38
|
+
type: "result",
|
|
39
|
+
summary: accounts.length ? `Medusa found ${accounts.length} valid credentials on ${target}.` : `Medusa found no valid credentials on ${target}.`,
|
|
40
|
+
data: { target, module: service, accounts: accounts.slice(0, 100) },
|
|
41
|
+
});
|
|
42
|
+
emit({ type: "done", summary: accounts.length ? `Medusa finished: ${accounts.length} valid credentials.` : "Medusa finished: no valid credentials." });
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "password",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Tests logins with Medusa and reports any valid credentials it finds.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "medusa",
|
|
9
|
+
"install_hint": "Install Medusa from your distribution packages.",
|
|
10
|
+
"name": "Medusa"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "password/medusa",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Medusa",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "root",
|
|
20
|
+
"description": "Username to test.",
|
|
21
|
+
"name": "user",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"default": "wordlist.txt",
|
|
26
|
+
"description": "Password wordlist file.",
|
|
27
|
+
"name": "wordlist",
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"default": "ssh",
|
|
32
|
+
"description": "Service module to test.",
|
|
33
|
+
"name": "module",
|
|
34
|
+
"type": "string"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"risk": "medium",
|
|
38
|
+
"schema_version": 1,
|
|
39
|
+
"version": "0.1.0"
|
|
40
|
+
}
|
|
@@ -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("onesixtyone", ["-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: `onesixtyone 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 hosts = [];
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed) continue;
|
|
26
|
+
const match = trimmed.match(/^(\d+\.\d+\.\d+\.\d+)\s+\[([^\]]+)\]/);
|
|
27
|
+
if (!match) continue;
|
|
28
|
+
hosts.push({ ip: match[1], community: match[2] });
|
|
29
|
+
}
|
|
30
|
+
if (code !== 0 && !hosts.length) {
|
|
31
|
+
emit({ type: "error", message: `onesixtyone failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
emit({
|
|
36
|
+
type: "result",
|
|
37
|
+
summary: `onesixtyone found ${hosts.length} SNMP hosts on ${target}.`,
|
|
38
|
+
data: { target, community, hosts: hosts.slice(0, 200) },
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: `onesixtyone finished: ${hosts.length} hosts.` });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "network",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans SNMP communities with onesixtyone and reports the hosts that answer.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "onesixtyone",
|
|
9
|
+
"install_hint": "Install onesixtyone from your distribution packages.",
|
|
10
|
+
"name": "onesixtyone"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "network/onesixtyone",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "onesixtyone",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "public",
|
|
20
|
+
"description": "SNMP community string to try.",
|
|
21
|
+
"name": "community",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "low",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -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("pdf-parser.py", [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: `pdf-parser failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
21
|
+
let objects = 0;
|
|
22
|
+
const suspicious = new Set();
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed) continue;
|
|
26
|
+
if (/^obj\s+\d+\s+\d+/.test(trimmed)) objects += 1;
|
|
27
|
+
for (const keyword of ["/JS", "/JavaScript", "/EmbeddedFile", "/Launch", "/OpenAction", "/AA"]) {
|
|
28
|
+
if (trimmed.includes(keyword)) suspicious.add(keyword);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && objects === 0) {
|
|
32
|
+
emit({ type: "error", message: `pdf-parser failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
emit({
|
|
37
|
+
type: "result",
|
|
38
|
+
summary: `pdf-parser found ${objects} objects and ${suspicious.size} suspicious entries in ${target}.`,
|
|
39
|
+
data: { target, objects, suspicious: [...suspicious] },
|
|
40
|
+
});
|
|
41
|
+
emit({ type: "done", summary: `pdf-parser finished: ${objects} objects.` });
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "forensics",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Parses a PDF with pdf-parser and reports its objects and suspicious entries.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "pdf-parser.py",
|
|
9
|
+
"install_hint": "Install pdf-parser from your distribution packages or the Didier Stevens tools.",
|
|
10
|
+
"name": "pdf-parser"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "forensics/pdf-parser",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "PDF Parser",
|
|
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("rkhunter", ["--check", "--skip-keypress"], { 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: `rkhunter 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
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
if (/Warning/i.test(trimmed)) warnings.push(trimmed);
|
|
26
|
+
}
|
|
27
|
+
if (code !== 0 && !warnings.length && !plain.trim()) {
|
|
28
|
+
emit({ type: "error", message: `rkhunter failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
emit({
|
|
33
|
+
type: "result",
|
|
34
|
+
summary: warnings.length ? `rkhunter found ${warnings.length} warnings.` : "rkhunter found no warnings.",
|
|
35
|
+
data: { target, warnings: warnings.slice(0, 100) },
|
|
36
|
+
});
|
|
37
|
+
emit({ type: "done", summary: warnings.length ? `rkhunter finished: ${warnings.length} warnings.` : "rkhunter finished: clean." });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs rkhunter and reports any rootkit warnings.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "rkhunter",
|
|
9
|
+
"install_hint": "Install rkhunter from your distribution packages.",
|
|
10
|
+
"name": "rkhunter"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "incident-response/rkhunter",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "rkhunter",
|
|
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,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("sublist3r", ["-d", target], { stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
14
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
emit({ type: "error", message: `Sublist3r 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 found = new Set();
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(trimmed)) continue;
|
|
26
|
+
found.add(trimmed);
|
|
27
|
+
}
|
|
28
|
+
const subdomains = [...found].sort();
|
|
29
|
+
if (code !== 0 && !subdomains.length) {
|
|
30
|
+
emit({ type: "error", message: `Sublist3r failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `Sublist3r found ${subdomains.length} subdomains for ${target}.`,
|
|
37
|
+
data: { target, subdomains: subdomains.slice(0, 200) },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `Sublist3r finished: ${subdomains.length} subdomains.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "recon",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Enumerates subdomains of a domain with Sublist3r and reports the list.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "sublist3r",
|
|
9
|
+
"install_hint": "Install Sublist3r from your distribution packages or with pipx install sublist3r.",
|
|
10
|
+
"name": "Sublist3r"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "recon/sublist3r",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Sublist3r",
|
|
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("terrascan", ["scan", "-t", "terraform", "-d", target, "-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: `Terrascan 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 violations = [];
|
|
27
|
+
const raw = Array.isArray(report?.results?.violations) ? report.results.violations : [];
|
|
28
|
+
for (const violation of raw) {
|
|
29
|
+
violations.push({ rule: violation.rule_name ?? "", severity: violation.severity ?? "unknown", description: violation.description ?? "", resource: violation.resource_name ?? "" });
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !violations.length && !report) {
|
|
32
|
+
emit({ type: "error", message: `Terrascan failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const bySeverity = {};
|
|
37
|
+
for (const violation of violations) {
|
|
38
|
+
bySeverity[violation.severity] = (bySeverity[violation.severity] ?? 0) + 1;
|
|
39
|
+
}
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `Terrascan found ${violations.length} violations in ${target}.`,
|
|
43
|
+
data: { target, total: violations.length, by_severity: bySeverity, violations: violations.slice(0, 100) },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: `Terrascan finished: ${violations.length} violations.` });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans Terraform code with Terrascan and reports the policy violations.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "terrascan",
|
|
9
|
+
"install_hint": "Install Terrascan from your distribution packages or the Terrascan releases.",
|
|
10
|
+
"name": "Terrascan"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/terrascan",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Terrascan",
|
|
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
|
+
});
|