cantarella-framework 1.9.0 → 1.11.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/forensics-strings-extractor/index.mjs +44 -0
- package/modules/forensics-strings-extractor/module.json +21 -0
- package/modules/incident-response-log-parser/index.mjs +42 -0
- package/modules/incident-response-log-parser/module.json +14 -0
- package/modules/lab-base64-tool/index.mjs +40 -0
- package/modules/lab-base64-tool/module.json +27 -0
- package/modules/lab-url-parser/index.mjs +40 -0
- package/modules/lab-url-parser/module.json +14 -0
- package/modules/threat-intel-otx/index.mjs +35 -0
- package/modules/threat-intel-otx/module.json +14 -0
- package/modules/vuln-management-nessus-import/index.mjs +62 -0
- package/modules/vuln-management-nessus-import/module.json +14 -0
- package/modules/wrapper-apktool/index.mjs +61 -0
- package/modules/wrapper-apktool/module.json +21 -0
- package/modules/wrapper-assetfinder/index.mjs +42 -0
- package/modules/wrapper-assetfinder/module.json +21 -0
- package/modules/wrapper-clamscan/index.mjs +40 -0
- package/modules/wrapper-clamscan/module.json +21 -0
- package/modules/wrapper-flawfinder/index.mjs +40 -0
- package/modules/wrapper-flawfinder/module.json +21 -0
- package/modules/wrapper-gau/index.mjs +40 -0
- package/modules/wrapper-gau/module.json +21 -0
- package/modules/wrapper-gitleaks/index.mjs +64 -0
- package/modules/wrapper-gitleaks/module.json +21 -0
- package/modules/wrapper-gobuster/index.mjs +41 -0
- package/modules/wrapper-gobuster/module.json +28 -0
- package/modules/wrapper-hashcat/index.mjs +42 -0
- package/modules/wrapper-hashcat/module.json +34 -0
- package/modules/wrapper-kube-bench/index.mjs +41 -0
- package/modules/wrapper-kube-bench/module.json +21 -0
- package/modules/wrapper-sleuthkit-fls/index.mjs +40 -0
- package/modules/wrapper-sleuthkit-fls/module.json +21 -0
- package/modules/wrapper-ssh-audit/index.mjs +39 -0
- package/modules/wrapper-ssh-audit/module.json +21 -0
- package/modules/wrapper-subfinder/index.mjs +42 -0
- package/modules/wrapper-subfinder/module.json +21 -0
- package/modules/wrapper-waf-detector/index.mjs +36 -0
- package/modules/wrapper-waf-detector/module.json +21 -0
- package/modules/wrapper-waybackurls/index.mjs +40 -0
- package/modules/wrapper-waybackurls/module.json +21 -0
- package/package.json +1 -1
- package/packages/cli/dist/cli.js +1 -1
- package/packages/cli/dist/cli.js.map +1 -1
- package/packages/gui/dist/server.js +2 -2
- package/packages/gui/dist/server.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.11.0
|
|
4
|
+
|
|
5
|
+
- New modules: Gobuster path brute forcing, Assetfinder subdomain enumeration, ssh-audit server audits, kube-bench Kubernetes benchmarks, Flawfinder C/C++ audits, AlienVault OTX threat lookups, URL parsing, gau archived URL listing, Sleuth Kit fls disk listings, and access log parsing.
|
|
6
|
+
|
|
7
|
+
## 1.10.0
|
|
8
|
+
|
|
9
|
+
- New modules: wafw00f WAF detection, Subfinder subdomain enumeration, Hashcat hash cracking, ClamAV malware scans, printable strings extraction, base64/hex/URL conversion, Gitleaks secret scanning, Nessus import, Apktool APK decoding, and waybackurls archived URL listing.
|
|
10
|
+
|
|
3
11
|
## 1.9.0
|
|
4
12
|
|
|
5
13
|
- New modules: WPScan WordPress scans, Amass subdomain enumeration, Hydra credential testing, Binwalk firmware analysis, theHarvester OSINT gathering, Masscan fast port scans, Bandit Python audits, John the Ripper hash cracking, dirsearch path brute forcing, and Checkov infrastructure-as-code scans.
|
|
@@ -0,0 +1,44 @@
|
|
|
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 = extract(request);
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `Strings extraction finished: ${result.data.count} strings.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function extract(request) {
|
|
20
|
+
const target = String(request.target ?? "");
|
|
21
|
+
const min = Number(request.options?.min ?? 4);
|
|
22
|
+
if (!Number.isFinite(min) || min < 1) throw new Error("Invalid input: min must be a positive number.");
|
|
23
|
+
let buffer;
|
|
24
|
+
try {
|
|
25
|
+
buffer = readFileSync(target);
|
|
26
|
+
} catch {
|
|
27
|
+
throw new Error(`Cannot read file: ${target}.`);
|
|
28
|
+
}
|
|
29
|
+
const strings = [];
|
|
30
|
+
let current = "";
|
|
31
|
+
for (const byte of buffer) {
|
|
32
|
+
if (byte >= 32 && byte <= 126) {
|
|
33
|
+
current += String.fromCharCode(byte);
|
|
34
|
+
} else {
|
|
35
|
+
if (current.length >= min) strings.push(current);
|
|
36
|
+
current = "";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (current.length >= min) strings.push(current);
|
|
40
|
+
return {
|
|
41
|
+
summary: `Extracted ${strings.length} strings from ${target}.`,
|
|
42
|
+
data: { file: target, min, count: strings.length, strings: strings.slice(0, 200) },
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "forensics",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Extracts printable strings from a binary file for forensic triage.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "forensics/strings-extractor",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Strings Extractor",
|
|
10
|
+
"options": [
|
|
11
|
+
{
|
|
12
|
+
"default": 4,
|
|
13
|
+
"description": "Minimum length of a string to report.",
|
|
14
|
+
"name": "min",
|
|
15
|
+
"type": "number"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"risk": "info",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 = parseLog(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `Log parsing finished: ${result.data.total} entries.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function parseLog(target) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = readFileSync(target, "utf8");
|
|
23
|
+
} catch {
|
|
24
|
+
throw new Error(`Cannot read log file: ${target}.`);
|
|
25
|
+
}
|
|
26
|
+
const entries = [];
|
|
27
|
+
const byStatus = { "2xx": 0, "3xx": 0, "4xx": 0, "5xx": 0, other: 0 };
|
|
28
|
+
for (const line of raw.split("\n")) {
|
|
29
|
+
const trimmed = line.trim();
|
|
30
|
+
if (!trimmed) continue;
|
|
31
|
+
const match = trimmed.match(/^(\S+) \S+ \S+ \[([^\]]+)\] "(\S+) (\S+) [^"]*" (\d{3}) (\S+)/);
|
|
32
|
+
if (!match) continue;
|
|
33
|
+
const status = Number(match[5]);
|
|
34
|
+
const bucket = status >= 200 && status < 300 ? "2xx" : status >= 300 && status < 400 ? "3xx" : status >= 400 && status < 500 ? "4xx" : status >= 500 && status < 600 ? "5xx" : "other";
|
|
35
|
+
byStatus[bucket] += 1;
|
|
36
|
+
entries.push({ ip: match[1], time: match[2], method: match[3], path: match[4], status, size: match[6] === "-" ? null : Number(match[6]) });
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
summary: `Parsed ${entries.length} log entries from ${target}.`,
|
|
40
|
+
data: { file: target, total: entries.length, by_status: byStatus, entries: entries.slice(0, 200) },
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Parses web server access log lines into structured entries with status counts.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "incident-response/log-parser",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Log Parser",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
try {
|
|
8
|
+
const result = convert(request);
|
|
9
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
10
|
+
emit({ type: "done", summary: `Conversion finished: ${result.data.operation} ${result.data.format}.` });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
emit({ type: "error", message: error.message });
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function convert(request) {
|
|
18
|
+
const text = String(request.target ?? "");
|
|
19
|
+
const operation = String(request.options?.operation ?? "encode");
|
|
20
|
+
const format = String(request.options?.format ?? "base64");
|
|
21
|
+
if (operation !== "encode" && operation !== "decode") throw new Error(`Invalid input: operation must be encode or decode, got ${operation}.`);
|
|
22
|
+
if (!["base64", "hex", "url"].includes(format)) throw new Error(`Invalid input: format must be base64, hex, or url, got ${format}.`);
|
|
23
|
+
let output;
|
|
24
|
+
try {
|
|
25
|
+
if (format === "base64") {
|
|
26
|
+
output = operation === "encode" ? Buffer.from(text, "utf8").toString("base64") : Buffer.from(text, "base64").toString("utf8");
|
|
27
|
+
} else if (format === "hex") {
|
|
28
|
+
output = operation === "encode" ? Buffer.from(text, "utf8").toString("hex") : Buffer.from(text, "hex").toString("utf8");
|
|
29
|
+
} else {
|
|
30
|
+
output = operation === "encode" ? encodeURIComponent(text) : decodeURIComponent(text);
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
throw new Error(`Invalid input: cannot ${operation} as ${format}: ${text}.`);
|
|
34
|
+
}
|
|
35
|
+
const shown = output.length > 80 ? `${output.slice(0, 80)}...` : output;
|
|
36
|
+
return {
|
|
37
|
+
summary: `${operation} ${format}: ${shown}`,
|
|
38
|
+
data: { input: text, operation, format, output },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "lab",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Encodes and decodes text in base64, hex, and URL formats.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "lab/base64-tool",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Base64 Tool",
|
|
10
|
+
"options": [
|
|
11
|
+
{
|
|
12
|
+
"default": "encode",
|
|
13
|
+
"description": "Operation to perform: encode or decode.",
|
|
14
|
+
"name": "operation",
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"default": "base64",
|
|
19
|
+
"description": "Format to use: base64, hex, or url.",
|
|
20
|
+
"name": "format",
|
|
21
|
+
"type": "string"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"risk": "info",
|
|
25
|
+
"schema_version": 1,
|
|
26
|
+
"version": "0.1.0"
|
|
27
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
try {
|
|
8
|
+
const result = parseUrl(String(request.target ?? ""));
|
|
9
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
10
|
+
emit({ type: "done", summary: `URL parsing finished: ${result.data.host}.` });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
emit({ type: "error", message: error.message });
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function parseUrl(target) {
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = new URL(target.trim());
|
|
21
|
+
} catch {
|
|
22
|
+
throw new Error(`Invalid input: expected a URL such as https://example.com/path, got ${target}.`);
|
|
23
|
+
}
|
|
24
|
+
const query = {};
|
|
25
|
+
for (const [key, value] of parsed.searchParams.entries()) {
|
|
26
|
+
query[key] = value;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
summary: `${parsed.protocol}//${parsed.host}${parsed.pathname}`,
|
|
30
|
+
data: {
|
|
31
|
+
input: target,
|
|
32
|
+
scheme: parsed.protocol.replace(":", ""),
|
|
33
|
+
host: parsed.hostname,
|
|
34
|
+
port: parsed.port ? Number(parsed.port) : null,
|
|
35
|
+
path: parsed.pathname,
|
|
36
|
+
query,
|
|
37
|
+
fragment: parsed.hash ? parsed.hash.slice(1) : "",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "lab",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Parses a URL into scheme, host, port, path, query parameters, and fragment.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "lab/url-parser",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "URL Parser",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 apiKey = process.env.CANTA_OTX_API_KEY ?? "";
|
|
15
|
+
if (!apiKey) {
|
|
16
|
+
throw new Error("OTX lookup needs an API key: set CANTA_OTX_API_KEY.");
|
|
17
|
+
}
|
|
18
|
+
const base = (process.env.CANTA_OTX_API_URL ?? "https://otx.alienvault.com/api/v1").replace(/\/$/, "");
|
|
19
|
+
const isIp = /^\d+\.\d+\.\d+\.\d+$/.test(target);
|
|
20
|
+
const kind = isIp ? "IPv4" : "domain";
|
|
21
|
+
const url = `${base}/indicators/${kind}/${encodeURIComponent(target)}/general`;
|
|
22
|
+
const response = await fetch(url, { headers: { "X-OTX-API-KEY": apiKey } });
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
throw new Error(`OTX lookup failed: HTTP ${response.status} for ${target}.`);
|
|
25
|
+
}
|
|
26
|
+
const report = await response.json();
|
|
27
|
+
const pulses = Array.isArray(report.pulse_info?.pulses) ? report.pulse_info.pulses : [];
|
|
28
|
+
const count = Number(report.pulse_info?.count ?? pulses.length);
|
|
29
|
+
emit({
|
|
30
|
+
type: "result",
|
|
31
|
+
summary: count ? `${target} appears in ${count} OTX pulses.` : `${target} appears in no OTX pulses.`,
|
|
32
|
+
data: { target, type: kind, pulses: count, pulse_names: pulses.slice(0, 20).map((pulse) => pulse.name ?? "") },
|
|
33
|
+
});
|
|
34
|
+
emit({ type: "done", summary: `OTX lookup finished: ${count} pulses.` });
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "threat-intel",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Looks up an IP or domain in AlienVault OTX and reports the threat pulses that mention it.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "threat-intel/otx",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "OTX Lookup",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 = importNessus(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `Nessus import finished: ${result.data.total} findings.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const SEVERITY_NAMES = { 0: "info", 1: "low", 2: "medium", 3: "high", 4: "critical" };
|
|
20
|
+
|
|
21
|
+
function importNessus(target) {
|
|
22
|
+
let raw;
|
|
23
|
+
try {
|
|
24
|
+
raw = readFileSync(target, "utf8");
|
|
25
|
+
} catch {
|
|
26
|
+
throw new Error(`Cannot read file: ${target}.`);
|
|
27
|
+
}
|
|
28
|
+
const hosts = new Set();
|
|
29
|
+
const findings = [];
|
|
30
|
+
const hostBlocks = raw.match(/<ReportHost[^>]*name="([^"]+)"[^>]*>([\s\S]*?)<\/ReportHost>/g) ?? [];
|
|
31
|
+
if (!hostBlocks.length) throw new Error(`Invalid input: no Nessus ReportHost entries found in ${target}.`);
|
|
32
|
+
for (const block of hostBlocks) {
|
|
33
|
+
const hostMatch = block.match(/<ReportHost[^>]*name="([^"]+)"/);
|
|
34
|
+
const host = hostMatch ? hostMatch[1] : "";
|
|
35
|
+
if (host) hosts.add(host);
|
|
36
|
+
const items = block.match(/<ReportItem[^>]*>([\s\S]*?)<\/ReportItem>/g) ?? [];
|
|
37
|
+
for (const item of items) {
|
|
38
|
+
const attrs = item.match(/<ReportItem([^>]*)>/);
|
|
39
|
+
const attrText = attrs ? attrs[1] : "";
|
|
40
|
+
const getAttr = (name) => {
|
|
41
|
+
const found = attrText.match(new RegExp(`${name}="([^"]*)"`));
|
|
42
|
+
return found ? found[1] : "";
|
|
43
|
+
};
|
|
44
|
+
const severity = Number(getAttr("severity") || 0);
|
|
45
|
+
findings.push({
|
|
46
|
+
host,
|
|
47
|
+
port: getAttr("port"),
|
|
48
|
+
plugin_id: getAttr("pluginID"),
|
|
49
|
+
severity: SEVERITY_NAMES[severity] ?? "unknown",
|
|
50
|
+
plugin_name: getAttr("pluginName"),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const bySeverity = {};
|
|
55
|
+
for (const finding of findings) {
|
|
56
|
+
bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
summary: `Nessus import found ${findings.length} findings across ${hosts.size} hosts.`,
|
|
60
|
+
data: { file: target, hosts: [...hosts], total: findings.length, by_severity: bySeverity, findings: findings.slice(0, 200) },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "vuln-management",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Imports a Nessus scan file and reports the hosts and findings it contains.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "vuln-management/nessus-import",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Nessus Import",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdtemp, readdir, rm, stat } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
|
|
6
|
+
let input = "";
|
|
7
|
+
process.stdin.setEncoding("utf8");
|
|
8
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
9
|
+
process.stdin.on("end", () => {
|
|
10
|
+
const request = JSON.parse(input || "{}");
|
|
11
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
12
|
+
const target = String(request.target ?? "");
|
|
13
|
+
run(request, target, emit).catch((error) => {
|
|
14
|
+
emit({ type: "error", message: `Apktool failed: ${error.message}` });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
async function run(request, target, emit) {
|
|
20
|
+
const outDir = await mkdtemp(join(tmpdir(), "cantarella-apktool-"));
|
|
21
|
+
try {
|
|
22
|
+
const child = spawn("apktool", ["d", target, "-o", outDir, "-f"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
23
|
+
let stdout = "";
|
|
24
|
+
let stderr = "";
|
|
25
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
26
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
27
|
+
const code = await new Promise((resolve, reject) => {
|
|
28
|
+
child.on("error", reject);
|
|
29
|
+
child.on("close", resolve);
|
|
30
|
+
});
|
|
31
|
+
let entries = [];
|
|
32
|
+
try {
|
|
33
|
+
entries = await readdir(outDir, { recursive: true });
|
|
34
|
+
} catch {
|
|
35
|
+
entries = [];
|
|
36
|
+
}
|
|
37
|
+
const fileList = [];
|
|
38
|
+
for (const entry of entries) {
|
|
39
|
+
if (typeof entry !== "string") continue;
|
|
40
|
+
try {
|
|
41
|
+
if ((await stat(join(outDir, entry))).isFile()) fileList.push(entry);
|
|
42
|
+
} catch {
|
|
43
|
+
// Entry disappeared; skip it.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const manifest = fileList.some((entry) => entry.endsWith("AndroidManifest.xml"));
|
|
47
|
+
if (code !== 0 && !fileList.length) {
|
|
48
|
+
emit({ type: "error", message: `Apktool failed: ${stderr.trim() || stdout.trim() || `exited with ${code}`}` });
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
emit({
|
|
53
|
+
type: "result",
|
|
54
|
+
summary: `Apktool decoded ${target} into ${fileList.length} files.`,
|
|
55
|
+
data: { target, files: fileList.length, manifest, samples: fileList.slice(0, 20) },
|
|
56
|
+
});
|
|
57
|
+
emit({ type: "done", summary: `Apktool finished: ${fileList.length} files.` });
|
|
58
|
+
} finally {
|
|
59
|
+
await rm(outDir, { recursive: true, force: true });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "mobile",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Decodes an Android APK with Apktool and reports the files it contains.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "apktool",
|
|
9
|
+
"install_hint": "Install Apktool from your distribution packages or from the Apktool releases.",
|
|
10
|
+
"name": "Apktool"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "mobile/apktool",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Apktool",
|
|
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("assetfinder", ["--subs-only", 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: `Assetfinder 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 subdomains = [];
|
|
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-z]{2,}$/.test(trimmed)) continue;
|
|
26
|
+
if (trimmed === target) continue;
|
|
27
|
+
if (!trimmed.endsWith(`.${target}`)) continue;
|
|
28
|
+
subdomains.push(trimmed);
|
|
29
|
+
}
|
|
30
|
+
if (code !== 0 && !subdomains.length) {
|
|
31
|
+
emit({ type: "error", message: `Assetfinder failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
emit({
|
|
36
|
+
type: "result",
|
|
37
|
+
summary: `Assetfinder found ${subdomains.length} subdomains for ${target}.`,
|
|
38
|
+
data: { target, subdomains: [...new Set(subdomains)].slice(0, 500) },
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: `Assetfinder finished: ${subdomains.length} subdomains.` });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "recon",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Enumerates subdomains for a domain with Assetfinder and reports the subdomains found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "assetfinder",
|
|
9
|
+
"install_hint": "Install Assetfinder with go install github.com/tomnomnom/assetfinder@latest.",
|
|
10
|
+
"name": "Assetfinder"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "recon/assetfinder",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Assetfinder",
|
|
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("clamscan", ["-r", 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: `ClamAV 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
|
+
const match = trimmed.match(/^(.+?):\s+(.+?)\s+FOUND$/);
|
|
25
|
+
if (!match) continue;
|
|
26
|
+
infected.push({ file: match[1], signature: match[2] });
|
|
27
|
+
}
|
|
28
|
+
if (code !== 0 && !infected.length && !/Infected files:/.test(plain)) {
|
|
29
|
+
emit({ type: "error", message: `ClamAV failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
emit({
|
|
34
|
+
type: "result",
|
|
35
|
+
summary: `ClamAV found ${infected.length} infected files in ${target}.`,
|
|
36
|
+
data: { target, infected_count: infected.length, infected: infected.slice(0, 100) },
|
|
37
|
+
});
|
|
38
|
+
emit({ type: "done", summary: `ClamAV scan finished: ${infected.length} infected files.` });
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "blue-team",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans files for malware with ClamAV and reports the infected files found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "clamscan",
|
|
9
|
+
"install_hint": "Install ClamAV from your distribution packages.",
|
|
10
|
+
"name": "ClamAV"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "blue-team/clamscan",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "ClamAV Scan",
|
|
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("flawfinder", [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: `Flawfinder 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
|
+
const match = trimmed.match(/^(.*?):(\d+):\s+\[(\d+)\]\s+\(([^)]+)\)\s+(.+)$/);
|
|
25
|
+
if (!match) continue;
|
|
26
|
+
findings.push({ file: match[1], line: Number(match[2]), level: Number(match[3]), category: match[4], description: match[5].trim() });
|
|
27
|
+
}
|
|
28
|
+
if (code !== 0 && !findings.length) {
|
|
29
|
+
emit({ type: "error", message: `Flawfinder failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
emit({
|
|
34
|
+
type: "result",
|
|
35
|
+
summary: `Flawfinder found ${findings.length} risky calls in ${target}.`,
|
|
36
|
+
data: { target, total: findings.length, findings: findings.slice(0, 100) },
|
|
37
|
+
});
|
|
38
|
+
emit({ type: "done", summary: `Flawfinder finished: ${findings.length} risky calls.` });
|
|
39
|
+
});
|
|
40
|
+
});
|