cantarella-framework 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/modules/api-websocket-checker/index.mjs +65 -0
- package/modules/api-websocket-checker/module.json +14 -0
- package/modules/reporting-html-report/index.mjs +56 -0
- package/modules/reporting-html-report/module.json +14 -0
- package/modules/reporting-sarif-export/index.mjs +53 -0
- package/modules/reporting-sarif-export/module.json +14 -0
- package/modules/wrapper-ansible-lint/index.mjs +48 -0
- package/modules/wrapper-ansible-lint/module.json +21 -0
- package/modules/wrapper-crunch/index.mjs +42 -0
- package/modules/wrapper-crunch/module.json +34 -0
- package/modules/wrapper-detect-secrets/index.mjs +46 -0
- package/modules/wrapper-detect-secrets/module.json +21 -0
- package/modules/wrapper-dnsrecon/index.mjs +41 -0
- package/modules/wrapper-dnsrecon/module.json +21 -0
- package/modules/wrapper-docker-bench/index.mjs +41 -0
- package/modules/wrapper-docker-bench/module.json +21 -0
- package/modules/wrapper-enum4linux/index.mjs +43 -0
- package/modules/wrapper-enum4linux/module.json +21 -0
- package/modules/wrapper-file-type/index.mjs +33 -0
- package/modules/wrapper-file-type/module.json +21 -0
- package/modules/wrapper-hcxdumptool/index.mjs +40 -0
- package/modules/wrapper-hcxdumptool/module.json +28 -0
- package/modules/wrapper-linpeas/index.mjs +39 -0
- package/modules/wrapper-linpeas/module.json +21 -0
- package/modules/wrapper-routersploit/index.mjs +42 -0
- package/modules/wrapper-routersploit/module.json +28 -0
- package/modules/wrapper-searchsploit/index.mjs +44 -0
- package/modules/wrapper-searchsploit/module.json +21 -0
- package/modules/wrapper-shellcheck/index.mjs +47 -0
- package/modules/wrapper-shellcheck/module.json +21 -0
- package/modules/wrapper-smbclient/index.mjs +41 -0
- package/modules/wrapper-smbclient/module.json +21 -0
- package/modules/wrapper-snmpwalk/index.mjs +42 -0
- package/modules/wrapper-snmpwalk/module.json +28 -0
- package/modules/wrapper-sysdig/index.mjs +39 -0
- package/modules/wrapper-sysdig/module.json +21 -0
- package/modules/wrapper-vagrant/index.mjs +42 -0
- package/modules/wrapper-vagrant/module.json +21 -0
- package/modules/wrapper-wifite/index.mjs +40 -0
- package/modules/wrapper-wifite/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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
7
|
+
## 1.15.0
|
|
8
|
+
|
|
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.
|
|
10
|
+
|
|
3
11
|
## 1.14.0
|
|
4
12
|
|
|
5
13
|
- 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,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, "<")
|
|
23
|
+
.replace(/>/g, ">")
|
|
24
|
+
.replace(/"/g, """);
|
|
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,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,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
|
+
}
|