cantarella-framework 1.11.0 → 1.12.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 +4 -0
- package/modules/api-robots-checker/index.mjs +55 -0
- package/modules/api-robots-checker/module.json +14 -0
- package/modules/osint-shodan/index.mjs +43 -0
- package/modules/osint-shodan/module.json +14 -0
- package/modules/reporting-csv-export/index.mjs +51 -0
- package/modules/reporting-csv-export/module.json +14 -0
- package/modules/threat-intel-urlhaus/index.mjs +40 -0
- package/modules/threat-intel-urlhaus/module.json +14 -0
- package/modules/vuln-management-openvas-import/index.mjs +62 -0
- package/modules/vuln-management-openvas-import/module.json +14 -0
- package/modules/wrapper-ldapsearch/index.mjs +43 -0
- package/modules/wrapper-ldapsearch/module.json +21 -0
- package/modules/wrapper-mobsfscan/index.mjs +47 -0
- package/modules/wrapper-mobsfscan/module.json +21 -0
- package/modules/wrapper-osquery/index.mjs +39 -0
- package/modules/wrapper-osquery/module.json +21 -0
- package/modules/wrapper-reaver/index.mjs +39 -0
- package/modules/wrapper-reaver/module.json +28 -0
- package/modules/wrapper-terraform/index.mjs +46 -0
- package/modules/wrapper-terraform/module.json +21 -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,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.12.0
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
|
|
3
7
|
## 1.11.0
|
|
4
8
|
|
|
5
9
|
- 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.
|
|
@@ -0,0 +1,55 @@
|
|
|
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}/robots.txt`;
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await fetch(url);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`Robots check failed: cannot fetch ${url}: ${error.message}`);
|
|
21
|
+
}
|
|
22
|
+
if (response.status === 404) {
|
|
23
|
+
emit({
|
|
24
|
+
type: "result",
|
|
25
|
+
summary: `No robots.txt found on ${target}.`,
|
|
26
|
+
data: { target, exists: false, disallow: [], allow: [], sitemaps: [] },
|
|
27
|
+
});
|
|
28
|
+
emit({ type: "done", summary: "Robots check finished: no robots.txt." });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
throw new Error(`Robots check failed: HTTP ${response.status} for ${url}.`);
|
|
33
|
+
}
|
|
34
|
+
const text = await response.text();
|
|
35
|
+
const disallow = [];
|
|
36
|
+
const allow = [];
|
|
37
|
+
const sitemaps = [];
|
|
38
|
+
for (const line of text.split("\n")) {
|
|
39
|
+
const trimmed = line.trim();
|
|
40
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
41
|
+
const match = trimmed.match(/^(\S+):\s*(.*)$/);
|
|
42
|
+
if (!match) continue;
|
|
43
|
+
const directive = match[1].toLowerCase();
|
|
44
|
+
const value = match[2].trim();
|
|
45
|
+
if (directive === "disallow" && value) disallow.push(value);
|
|
46
|
+
else if (directive === "allow" && value) allow.push(value);
|
|
47
|
+
else if (directive === "sitemap" && value) sitemaps.push(value);
|
|
48
|
+
}
|
|
49
|
+
emit({
|
|
50
|
+
type: "result",
|
|
51
|
+
summary: `robots.txt for ${target}: ${disallow.length} disallowed paths.`,
|
|
52
|
+
data: { target, exists: true, disallow, allow, sitemaps },
|
|
53
|
+
});
|
|
54
|
+
emit({ type: "done", summary: `Robots check finished: ${disallow.length} disallowed paths.` });
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "api",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Fetches a site robots.txt and reports its disallowed paths and sitemaps.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "api/robots-checker",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Robots Checker",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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_SHODAN_API_KEY ?? "";
|
|
15
|
+
if (!apiKey) {
|
|
16
|
+
throw new Error("Shodan lookup needs an API key: set CANTA_SHODAN_API_KEY.");
|
|
17
|
+
}
|
|
18
|
+
const base = (process.env.CANTA_SHODAN_API_URL ?? "https://api.shodan.io").replace(/\/$/, "");
|
|
19
|
+
const url = `${base}/shodan/host/${encodeURIComponent(target)}?key=${encodeURIComponent(apiKey)}`;
|
|
20
|
+
let response;
|
|
21
|
+
try {
|
|
22
|
+
response = await fetch(url);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
throw new Error(`Shodan lookup failed: cannot reach ${base}: ${error.message}`);
|
|
25
|
+
}
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
throw new Error(`Shodan lookup failed: HTTP ${response.status} for ${target}.`);
|
|
28
|
+
}
|
|
29
|
+
const report = await response.json();
|
|
30
|
+
const ports = Array.isArray(report.ports) ? report.ports : [];
|
|
31
|
+
const services = [];
|
|
32
|
+
if (Array.isArray(report.data)) {
|
|
33
|
+
for (const entry of report.data) {
|
|
34
|
+
services.push({ port: entry.port ?? null, product: entry.product ?? "", transport: entry.transport ?? "" });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
emit({
|
|
38
|
+
type: "result",
|
|
39
|
+
summary: `Shodan found ${ports.length} open ports on ${target}.`,
|
|
40
|
+
data: { target, ip: report.ip_str ?? target, org: report.org ?? "", os: report.os ?? "", ports, services: services.slice(0, 100) },
|
|
41
|
+
});
|
|
42
|
+
emit({ type: "done", summary: `Shodan lookup finished: ${ports.length} open ports.` });
|
|
43
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "osint",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Looks up an IP in Shodan and reports its open ports, services, and organization.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "osint/shodan",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Shodan Lookup",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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: `CSV export finished: ${result.data.rows} rows.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function csvCell(value) {
|
|
20
|
+
const text = String(value ?? "");
|
|
21
|
+
return `"${text.replace(/"/g, '""')}"`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function build(target) {
|
|
25
|
+
let raw;
|
|
26
|
+
try {
|
|
27
|
+
raw = readFileSync(target, "utf8");
|
|
28
|
+
} catch {
|
|
29
|
+
throw new Error(`Cannot read results file: ${target}.`);
|
|
30
|
+
}
|
|
31
|
+
let parsed;
|
|
32
|
+
try {
|
|
33
|
+
parsed = JSON.parse(raw);
|
|
34
|
+
} catch {
|
|
35
|
+
throw new Error(`Invalid results file: ${target} is not valid JSON.`);
|
|
36
|
+
}
|
|
37
|
+
const events = Array.isArray(parsed.events) ? parsed.events : [];
|
|
38
|
+
const lines = ["type,summary,target"];
|
|
39
|
+
let rows = 0;
|
|
40
|
+
for (const event of events) {
|
|
41
|
+
if (event.type !== "result" && event.type !== "error") continue;
|
|
42
|
+
const summary = event.type === "result" ? (event.summary ?? "") : (event.message ?? "");
|
|
43
|
+
const eventTarget = event.data?.target ?? "";
|
|
44
|
+
lines.push([csvCell(event.type), csvCell(summary), csvCell(eventTarget)].join(","));
|
|
45
|
+
rows += 1;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
summary: `CSV export built: ${rows} rows from ${target}.`,
|
|
49
|
+
data: { source: target, rows, csv: lines.join("\n") },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "reporting",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Converts a Cantarella run results file into CSV rows.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "reporting/csv-export",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "CSV Export",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
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
|
+
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_URLHAUS_API_URL ?? "https://urlhaus-api.abuse.ch/v1/url/").replace(/\/$/, "");
|
|
15
|
+
const url = `${base}/`;
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await fetch(url, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
21
|
+
body: `url=${encodeURIComponent(target)}`,
|
|
22
|
+
});
|
|
23
|
+
} catch (error) {
|
|
24
|
+
throw new Error(`URLhaus lookup failed: cannot reach ${base}: ${error.message}`);
|
|
25
|
+
}
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
throw new Error(`URLhaus lookup failed: HTTP ${response.status} for ${target}.`);
|
|
28
|
+
}
|
|
29
|
+
const report = await response.json();
|
|
30
|
+
if (report.query_status === "invalid_url") {
|
|
31
|
+
throw new Error(`URLhaus lookup failed: invalid URL ${target}.`);
|
|
32
|
+
}
|
|
33
|
+
const listed = report.query_status === "ok";
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: listed ? `${target} is listed on URLhaus as ${report.threat ?? "malicious"}.` : `${target} is not listed on URLhaus.`,
|
|
37
|
+
data: { target, listed, threat: report.threat ?? null, query_status: report.query_status ?? "" },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: listed ? "URLhaus lookup finished: listed." : "URLhaus lookup finished: not listed." });
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "threat-intel",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Checks a URL against the URLhaus blocklist and reports whether it is listed as malicious.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "threat-intel/urlhaus",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "URLhaus 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 = importOpenvas(String(request.target ?? ""));
|
|
11
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
12
|
+
emit({ type: "done", summary: `OpenVAS import finished: ${result.data.total} findings.` });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
emit({ type: "error", message: error.message });
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function severityName(score) {
|
|
20
|
+
if (score >= 9) return "critical";
|
|
21
|
+
if (score >= 7) return "high";
|
|
22
|
+
if (score >= 4) return "medium";
|
|
23
|
+
if (score > 0) return "low";
|
|
24
|
+
return "info";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function importOpenvas(target) {
|
|
28
|
+
let raw;
|
|
29
|
+
try {
|
|
30
|
+
raw = readFileSync(target, "utf8");
|
|
31
|
+
} catch {
|
|
32
|
+
throw new Error(`Cannot read file: ${target}.`);
|
|
33
|
+
}
|
|
34
|
+
const hosts = new Set();
|
|
35
|
+
const findings = [];
|
|
36
|
+
const resultBlocks = raw.match(/<result[^>]*>([\s\S]*?)<\/result>/g) ?? [];
|
|
37
|
+
if (!resultBlocks.length) throw new Error(`Invalid input: no OpenVAS result entries found in ${target}.`);
|
|
38
|
+
for (const block of resultBlocks) {
|
|
39
|
+
const get = (tag) => {
|
|
40
|
+
const found = block.match(new RegExp(`<${tag}>([\\s\\S]*?)</${tag}>`));
|
|
41
|
+
return found ? found[1].trim() : "";
|
|
42
|
+
};
|
|
43
|
+
const host = get("host");
|
|
44
|
+
const severity = Number(get("severity") || 0);
|
|
45
|
+
const nvtName = block.match(/<nvt[^>]*>([\s\S]*?)<\/nvt>/);
|
|
46
|
+
let name = "";
|
|
47
|
+
if (nvtName) {
|
|
48
|
+
const nameMatch = nvtName[1].match(/<name>([\s\S]*?)<\/name>/);
|
|
49
|
+
name = nameMatch ? nameMatch[1].trim() : "";
|
|
50
|
+
}
|
|
51
|
+
if (host) hosts.add(host);
|
|
52
|
+
findings.push({ host, port: get("port"), severity: severityName(severity), score: severity, name });
|
|
53
|
+
}
|
|
54
|
+
const bySeverity = {};
|
|
55
|
+
for (const finding of findings) {
|
|
56
|
+
bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
summary: `OpenVAS 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 an OpenVAS scan file and reports the hosts and findings it contains.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "vuln-management/openvas-import",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "OpenVAS Import",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "low",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -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("ldapsearch", ["-x", "-H", `ldap://${target}`, "-b", "", "-s", "base", "(objectclass=*)"], { 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: `ldapsearch 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 attributes = [];
|
|
22
|
+
for (const line of plain.split("\n")) {
|
|
23
|
+
const trimmed = line.trim();
|
|
24
|
+
if (!trimmed) continue;
|
|
25
|
+
if (trimmed.startsWith("#")) continue;
|
|
26
|
+
const match = trimmed.match(/^([a-zA-Z][a-zA-Z0-9-]*):\s*(.*)$/);
|
|
27
|
+
if (!match) continue;
|
|
28
|
+
if (match[1] === "search" || match[1] === "result" || match[1] === "dn") continue;
|
|
29
|
+
attributes.push({ key: match[1], value: match[2].trim() });
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !attributes.length) {
|
|
32
|
+
emit({ type: "error", message: `ldapsearch failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
emit({
|
|
37
|
+
type: "result",
|
|
38
|
+
summary: `ldapsearch returned ${attributes.length} rootDSE attributes for ${target}.`,
|
|
39
|
+
data: { target, attributes: attributes.slice(0, 100) },
|
|
40
|
+
});
|
|
41
|
+
emit({ type: "done", summary: `ldapsearch finished: ${attributes.length} attributes.` });
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "internal",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Queries the LDAP rootDSE of a directory server with ldapsearch and reports its attributes.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "ldapsearch",
|
|
9
|
+
"install_hint": "Install ldapsearch from your distribution packages (openldap-clients).",
|
|
10
|
+
"name": "ldapsearch"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "internal/ldapsearch",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "ldapsearch",
|
|
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("mobsfscan", ["--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: `MobSFScan 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 findings = [];
|
|
27
|
+
const raw = Array.isArray(report?.results) ? report.results : [];
|
|
28
|
+
for (const finding of raw) {
|
|
29
|
+
findings.push({ title: finding.title ?? "", severity: finding.severity ?? "UNKNOWN", file: finding.file ?? "" });
|
|
30
|
+
}
|
|
31
|
+
if (code !== 0 && !findings.length && !report) {
|
|
32
|
+
emit({ type: "error", message: `MobSFScan failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const bySeverity = {};
|
|
37
|
+
for (const finding of findings) {
|
|
38
|
+
bySeverity[finding.severity] = (bySeverity[finding.severity] ?? 0) + 1;
|
|
39
|
+
}
|
|
40
|
+
emit({
|
|
41
|
+
type: "result",
|
|
42
|
+
summary: `MobSFScan found ${findings.length} findings in ${target}.`,
|
|
43
|
+
data: { target, total: findings.length, by_severity: bySeverity, findings: findings.slice(0, 100) },
|
|
44
|
+
});
|
|
45
|
+
emit({ type: "done", summary: `MobSFScan finished: ${findings.length} findings.` });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "mobile",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Scans mobile app code with MobSFScan and reports the security findings.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "mobsfscan",
|
|
9
|
+
"install_hint": "Install MobSFScan from your distribution packages or with pipx install mobsfscan.",
|
|
10
|
+
"name": "MobSFScan"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "mobile/mobsfscan",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "MobSFScan",
|
|
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("osqueryi", ["--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: `osquery failed: ${error.message}` });
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
});
|
|
19
|
+
child.on("close", (code) => {
|
|
20
|
+
let rows = null;
|
|
21
|
+
try {
|
|
22
|
+
rows = JSON.parse(stdout);
|
|
23
|
+
} catch {
|
|
24
|
+
rows = null;
|
|
25
|
+
}
|
|
26
|
+
if (code !== 0 && !Array.isArray(rows)) {
|
|
27
|
+
emit({ type: "error", message: `osquery failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!Array.isArray(rows)) rows = [];
|
|
32
|
+
emit({
|
|
33
|
+
type: "result",
|
|
34
|
+
summary: `osquery returned ${rows.length} rows.`,
|
|
35
|
+
data: { query: target, rows: rows.length, results: rows.slice(0, 50) },
|
|
36
|
+
});
|
|
37
|
+
emit({ type: "done", summary: `osquery finished: ${rows.length} rows.` });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "blue-team",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs an osquery SQL query and reports the rows it returns.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "osqueryi",
|
|
9
|
+
"install_hint": "Install osquery from your distribution packages or the osquery releases.",
|
|
10
|
+
"name": "osquery"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "blue-team/osquery",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "osquery",
|
|
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 iface = String(request.options?.interface ?? "wlan0mon");
|
|
11
|
+
const child = spawn("reaver", ["-i", iface, "-b", target, "-vv"], { 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: `Reaver 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 pinMatch = plain.match(/WPS PIN:\s*'(\d+)'/);
|
|
23
|
+
const pskMatch = plain.match(/WPA PSK:\s*'([^']+)'/);
|
|
24
|
+
const ssidMatch = plain.match(/AP SSID:\s*'([^']+)'/);
|
|
25
|
+
const psk = pskMatch ? pskMatch[1] : null;
|
|
26
|
+
const pin = pinMatch ? pinMatch[1] : null;
|
|
27
|
+
if (code !== 0 && !psk && !pin) {
|
|
28
|
+
emit({ type: "error", message: `Reaver failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
emit({
|
|
33
|
+
type: "result",
|
|
34
|
+
summary: psk ? `Reaver recovered the PSK for ${ssidMatch ? ssidMatch[1] : target}.` : `Reaver did not recover the PSK for ${target}.`,
|
|
35
|
+
data: { target, ssid: ssidMatch ? ssidMatch[1] : null, pin, psk, cracked: Boolean(psk) },
|
|
36
|
+
});
|
|
37
|
+
emit({ type: "done", summary: psk ? "Reaver finished: PSK recovered." : "Reaver finished: PSK not recovered." });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "wireless",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Attacks a WPS-enabled access point with Reaver and reports the recovered PIN and PSK.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "reaver",
|
|
9
|
+
"install_hint": "Install Reaver from your distribution packages.",
|
|
10
|
+
"name": "Reaver"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "wireless/reaver",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Reaver",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "wlan0mon",
|
|
20
|
+
"description": "Wireless interface in monitor mode.",
|
|
21
|
+
"name": "interface",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "high",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,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("terraform", ["plan", "-no-color", "-input=false"], { cwd: 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: `Terraform 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 add = 0;
|
|
22
|
+
let change = 0;
|
|
23
|
+
let destroy = 0;
|
|
24
|
+
let found = false;
|
|
25
|
+
const planMatch = plain.match(/Plan:\s+(\d+) to add, (\d+) to change, (\d+) to destroy/);
|
|
26
|
+
if (planMatch) {
|
|
27
|
+
add = Number(planMatch[1]);
|
|
28
|
+
change = Number(planMatch[2]);
|
|
29
|
+
destroy = Number(planMatch[3]);
|
|
30
|
+
found = true;
|
|
31
|
+
} else if (/No changes\./.test(plain)) {
|
|
32
|
+
found = true;
|
|
33
|
+
}
|
|
34
|
+
if (code !== 0 && !found) {
|
|
35
|
+
emit({ type: "error", message: `Terraform failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
emit({
|
|
40
|
+
type: "result",
|
|
41
|
+
summary: `Terraform plan: ${add} to add, ${change} to change, ${destroy} to destroy.`,
|
|
42
|
+
data: { target, add, change, destroy },
|
|
43
|
+
});
|
|
44
|
+
emit({ type: "done", summary: `Terraform plan finished: ${add} to add, ${change} to change, ${destroy} to destroy.` });
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "automation",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs terraform plan in a directory and reports the planned changes.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "terraform",
|
|
9
|
+
"install_hint": "Install Terraform from your distribution packages or the HashiCorp releases.",
|
|
10
|
+
"name": "Terraform"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "automation/terraform",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Terraform Plan",
|
|
17
|
+
"options": [],
|
|
18
|
+
"risk": "low",
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"version": "0.1.0"
|
|
21
|
+
}
|
package/package.json
CHANGED
package/packages/cli/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
|
|
|
11
11
|
process.exit(0);
|
|
12
12
|
throw error;
|
|
13
13
|
});
|
|
14
|
-
const VERSION = "1.
|
|
14
|
+
const VERSION = "1.12.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.
|
|
82
|
-
update_message: (await checkForUpdate("1.
|
|
81
|
+
version: "1.12.0",
|
|
82
|
+
update_message: (await checkForUpdate("1.12.0")).message,
|
|
83
83
|
categories: CATEGORIES,
|
|
84
84
|
modules: modules.map(({ manifest }) => manifest),
|
|
85
85
|
external_tools: [...tools.values()],
|