cantarella-framework 1.5.0 → 1.7.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/lab-subnet-calculator/index.mjs +81 -0
- package/modules/lab-subnet-calculator/module.json +14 -0
- package/modules/lab-wordlist-generator/index.mjs +52 -0
- package/modules/lab-wordlist-generator/module.json +27 -0
- package/modules/wrapper-aircrack-ng/index.mjs +36 -0
- package/modules/wrapper-aircrack-ng/module.json +28 -0
- package/modules/wrapper-jadx/index.mjs +54 -0
- package/modules/wrapper-jadx/module.json +21 -0
- package/modules/wrapper-metasploit/index.mjs +41 -0
- package/modules/wrapper-metasploit/module.json +28 -0
- package/modules/wrapper-netexec/index.mjs +41 -0
- package/modules/wrapper-netexec/module.json +28 -0
- package/modules/wrapper-prowler/index.mjs +41 -0
- package/modules/wrapper-prowler/module.json +21 -0
- package/modules/wrapper-volatility/index.mjs +42 -0
- package/modules/wrapper-volatility/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.7.0
|
|
4
|
+
|
|
5
|
+
- New modules: JADX APK decompilation, Metasploit module search, Volatility 3 memory analysis, and wordlist generation.
|
|
6
|
+
|
|
7
|
+
## 1.6.0
|
|
8
|
+
|
|
9
|
+
- New modules: Aircrack-ng handshake cracking, NetExec internal enumeration, Prowler cloud audit, and IPv4 subnet calculator.
|
|
10
|
+
|
|
3
11
|
## 1.5.0
|
|
4
12
|
|
|
5
13
|
- New modules: Lynis system audit, Semgrep static analysis, ExifTool metadata reader, and CVSS 3.1 base score calculator.
|
|
@@ -0,0 +1,81 @@
|
|
|
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 = calculate(String(request.target ?? ""));
|
|
9
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
10
|
+
emit({ type: "done", summary: `Subnet calculation finished: ${result.data.cidr}.` });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
emit({ type: "error", message: error.message });
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function parseIpv4(text) {
|
|
18
|
+
const parts = text.split(".");
|
|
19
|
+
if (parts.length !== 4) return null;
|
|
20
|
+
const octets = [];
|
|
21
|
+
for (const part of parts) {
|
|
22
|
+
if (!/^\d+$/.test(part)) return null;
|
|
23
|
+
const value = Number(part);
|
|
24
|
+
if (value < 0 || value > 255) return null;
|
|
25
|
+
octets.push(value);
|
|
26
|
+
}
|
|
27
|
+
return ((octets[0] * 256 ** 3 + octets[1] * 256 ** 2 + octets[2] * 256 + octets[3]) >>> 0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function toDotted(value) {
|
|
31
|
+
return [(value >>> 24) & 255, (value >>> 16) & 255, (value >>> 8) & 255, value & 255].join(".");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function calculate(target) {
|
|
35
|
+
const clean = target.trim();
|
|
36
|
+
const [address, prefixText] = clean.split("/");
|
|
37
|
+
const ip = parseIpv4(address ?? "");
|
|
38
|
+
if (ip === null) throw new Error(`Invalid input: expected an IPv4 CIDR such as 192.168.1.0/24, got ${clean}.`);
|
|
39
|
+
let prefix = 32;
|
|
40
|
+
if (prefixText !== undefined) {
|
|
41
|
+
if (!/^\d+$/.test(prefixText)) throw new Error(`Invalid input: bad prefix in ${clean}.`);
|
|
42
|
+
prefix = Number(prefixText);
|
|
43
|
+
if (prefix < 0 || prefix > 32) throw new Error(`Invalid input: prefix out of range in ${clean}.`);
|
|
44
|
+
}
|
|
45
|
+
const mask = prefix === 0 ? 0 : (0xffffffff << (32 - prefix)) >>> 0;
|
|
46
|
+
const network = (ip & mask) >>> 0;
|
|
47
|
+
const broadcast = (network | (~mask >>> 0)) >>> 0;
|
|
48
|
+
const total = 2 ** (32 - prefix);
|
|
49
|
+
let usable;
|
|
50
|
+
let firstHost;
|
|
51
|
+
let lastHost;
|
|
52
|
+
if (prefix === 32) {
|
|
53
|
+
usable = 1;
|
|
54
|
+
firstHost = network;
|
|
55
|
+
lastHost = network;
|
|
56
|
+
} else if (prefix === 31) {
|
|
57
|
+
usable = 2;
|
|
58
|
+
firstHost = network;
|
|
59
|
+
lastHost = broadcast;
|
|
60
|
+
} else {
|
|
61
|
+
usable = total - 2;
|
|
62
|
+
firstHost = (network + 1) >>> 0;
|
|
63
|
+
lastHost = (broadcast - 1) >>> 0;
|
|
64
|
+
}
|
|
65
|
+
const cidr = `${toDotted(network)}/${prefix}`;
|
|
66
|
+
return {
|
|
67
|
+
summary: `${cidr}: network ${toDotted(network)}, broadcast ${toDotted(broadcast)}, ${usable} usable hosts.`,
|
|
68
|
+
data: {
|
|
69
|
+
input: clean,
|
|
70
|
+
cidr,
|
|
71
|
+
network: toDotted(network),
|
|
72
|
+
broadcast: toDotted(broadcast),
|
|
73
|
+
netmask: toDotted(mask),
|
|
74
|
+
wildcard: toDotted(~mask >>> 0),
|
|
75
|
+
first_host: toDotted(firstHost),
|
|
76
|
+
last_host: toDotted(lastHost),
|
|
77
|
+
total_hosts: total,
|
|
78
|
+
usable_hosts: usable,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "lab",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Calculates network, broadcast, range, and host counts for an IPv4 CIDR.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "lab/subnet-calculator",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Subnet Calculator",
|
|
10
|
+
"options": [],
|
|
11
|
+
"risk": "info",
|
|
12
|
+
"schema_version": 1,
|
|
13
|
+
"version": "0.1.0"
|
|
14
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 = generate(request);
|
|
9
|
+
emit({ type: "result", summary: result.summary, data: result.data });
|
|
10
|
+
emit({ type: "done", summary: `Wordlist generation finished: ${result.data.count} words.` });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
emit({ type: "error", message: error.message });
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const LEET = { a: "4", e: "3", i: "1", o: "0", s: "5", t: "7", A: "4", E: "3", I: "1", O: "0", S: "5", T: "7" };
|
|
18
|
+
|
|
19
|
+
function capitalize(word) {
|
|
20
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function leet(word) {
|
|
24
|
+
return word.split("").map((char) => LEET[char] ?? char).join("");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function generate(request) {
|
|
28
|
+
const target = String(request.target ?? "");
|
|
29
|
+
const bases = target.split(",").map((word) => word.trim()).filter(Boolean);
|
|
30
|
+
if (!bases.length) throw new Error("Invalid input: expected one or more base words, for example test or hunter,admin.");
|
|
31
|
+
const years = String(request.options?.years ?? "2024,2025,2026").split(",").map((year) => year.trim()).filter(Boolean);
|
|
32
|
+
const max = Number(request.options?.max ?? 500);
|
|
33
|
+
if (!Number.isFinite(max) || max < 1) throw new Error("Invalid input: max must be a positive number.");
|
|
34
|
+
const words = new Set();
|
|
35
|
+
for (const base of bases) {
|
|
36
|
+
const capped = capitalize(base);
|
|
37
|
+
const variants = [base, capped, leet(base), `${base}123`, `${base}!`, `${capped}!`];
|
|
38
|
+
for (const year of years) {
|
|
39
|
+
variants.push(`${base}${year}`, `${capped}${year}`);
|
|
40
|
+
}
|
|
41
|
+
for (const variant of variants) {
|
|
42
|
+
if (words.size >= max) break;
|
|
43
|
+
words.add(variant);
|
|
44
|
+
}
|
|
45
|
+
if (words.size >= max) break;
|
|
46
|
+
}
|
|
47
|
+
const list = [...words];
|
|
48
|
+
return {
|
|
49
|
+
summary: `Generated ${list.length} wordlist entries from ${bases.length} base words.`,
|
|
50
|
+
data: { base_words: bases, years, count: list.length, words: list },
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "lab",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Generates a small wordlist from base words with year, capitalization, and leetspeak mutations.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"id": "lab/wordlist-generator",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"maintenance": "active",
|
|
9
|
+
"name": "Wordlist Generator",
|
|
10
|
+
"options": [
|
|
11
|
+
{
|
|
12
|
+
"default": "2024,2025,2026",
|
|
13
|
+
"description": "Comma-separated years appended to each base word.",
|
|
14
|
+
"name": "years",
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"default": 500,
|
|
19
|
+
"description": "Maximum number of words to generate.",
|
|
20
|
+
"name": "max",
|
|
21
|
+
"type": "number"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"risk": "info",
|
|
25
|
+
"schema_version": 1,
|
|
26
|
+
"version": "0.1.0"
|
|
27
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 wordlist = String(request.options?.wordlist ?? "/usr/share/wordlists/rockyou.txt");
|
|
11
|
+
const child = spawn("aircrack-ng", ["-w", wordlist, 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: `Aircrack-ng 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 match = plain.match(/KEY FOUND!\s*\[\s*(.+?)\s*\]/);
|
|
23
|
+
const keyFound = Boolean(match);
|
|
24
|
+
if (code !== 0 && !keyFound) {
|
|
25
|
+
emit({ type: "error", message: `Aircrack-ng failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
emit({
|
|
30
|
+
type: "result",
|
|
31
|
+
summary: keyFound ? `Aircrack-ng found the key for ${target}.` : `Aircrack-ng did not find the key for ${target}.`,
|
|
32
|
+
data: { target, wordlist, key_found: keyFound, key: match ? match[1] : null },
|
|
33
|
+
});
|
|
34
|
+
emit({ type: "done", summary: `Aircrack-ng finished: key ${keyFound ? "found" : "not found"}.` });
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "wireless",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Cracks a Wi-Fi handshake capture with Aircrack-ng and reports the key when found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "aircrack-ng",
|
|
9
|
+
"install_hint": "Install aircrack-ng from your distribution packages.",
|
|
10
|
+
"name": "Aircrack-ng"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "wireless/aircrack-ng",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Aircrack-ng",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "/usr/share/wordlists/rockyou.txt",
|
|
20
|
+
"description": "Wordlist used to crack the handshake.",
|
|
21
|
+
"name": "wordlist",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "medium",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdtemp, readdir, rm } 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: `JADX 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-jadx-"));
|
|
21
|
+
try {
|
|
22
|
+
const child = spawn("jadx", ["-d", outDir, target], { 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
|
+
const javaFiles = [];
|
|
32
|
+
try {
|
|
33
|
+
const entries = await readdir(outDir, { recursive: true });
|
|
34
|
+
for (const entry of entries) {
|
|
35
|
+
if (typeof entry === "string" && entry.endsWith(".java")) javaFiles.push(entry);
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
// No output directory means JADX produced nothing.
|
|
39
|
+
}
|
|
40
|
+
if (code !== 0 && !javaFiles.length) {
|
|
41
|
+
emit({ type: "error", message: `JADX failed: ${stderr.trim() || stdout.trim() || `exited with ${code}`}` });
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
emit({
|
|
46
|
+
type: "result",
|
|
47
|
+
summary: `JADX decompiled ${target} into ${javaFiles.length} Java sources.`,
|
|
48
|
+
data: { target, java_files: javaFiles.length, samples: javaFiles.slice(0, 20) },
|
|
49
|
+
});
|
|
50
|
+
emit({ type: "done", summary: `JADX finished: ${javaFiles.length} Java sources.` });
|
|
51
|
+
} finally {
|
|
52
|
+
await rm(outDir, { recursive: true, force: true });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "mobile",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Decompiles an Android APK with JADX and reports how many Java sources were produced.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "jadx",
|
|
9
|
+
"install_hint": "Install jadx from your distribution packages or from the JADX releases.",
|
|
10
|
+
"name": "JADX"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "mobile/jadx",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "JADX",
|
|
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 type = String(request.options?.type ?? "exploit");
|
|
11
|
+
const child = spawn("msfconsole", ["-q", "-x", `search type:${type} ${target}; exit`], { 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: `Metasploit 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 modules = [];
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
const match = trimmed.match(/^(exploit|auxiliary|post|payload|encoder|evasion|nops)\/(\S+)\s+(.*)$/);
|
|
26
|
+
if (!match) continue;
|
|
27
|
+
modules.push({ module: `${match[1]}/${match[2]}`, description: match[3].trim() });
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !modules.length) {
|
|
30
|
+
emit({ type: "error", message: `Metasploit failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `Metasploit found ${modules.length} modules matching ${target}.`,
|
|
37
|
+
data: { target, type, modules: modules.slice(0, 100) },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `Metasploit search finished: ${modules.length} modules.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "exploitation",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Searches the Metasploit module database and reports matching exploit modules.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "msfconsole",
|
|
9
|
+
"install_hint": "Install Metasploit Framework from your distribution packages or the Rapid7 installer.",
|
|
10
|
+
"name": "Metasploit Framework"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "exploitation/metasploit",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Metasploit",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "exploit",
|
|
20
|
+
"description": "Module type to search, for example exploit, auxiliary, or post.",
|
|
21
|
+
"name": "type",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "high",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -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 protocol = String(request.options?.protocol ?? "smb");
|
|
11
|
+
const child = spawn("nxc", [protocol, 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: `NetExec 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
|
+
const match = trimmed.match(/^([A-Z]+)\s+(\d+\.\d+\.\d+\.\d+)\s+(\d+)\s+(\S+)(?:\s+\[\*\]\s*(.*))?$/);
|
|
26
|
+
if (!match) continue;
|
|
27
|
+
hosts.push({ protocol: match[1], host: match[2], port: Number(match[3]), name: match[4], info: (match[5] ?? "").trim() });
|
|
28
|
+
}
|
|
29
|
+
if (code !== 0 && !hosts.length) {
|
|
30
|
+
emit({ type: "error", message: `NetExec failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `NetExec found ${hosts.length} hosts on ${target}.`,
|
|
37
|
+
data: { target, protocol, hosts: hosts.slice(0, 200) },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `NetExec finished: ${hosts.length} hosts.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "internal",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Enumerates internal network services with NetExec and reports the hosts found.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "nxc",
|
|
9
|
+
"install_hint": "Install NetExec from your distribution packages or with pipx install netexec.",
|
|
10
|
+
"name": "NetExec"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "internal/netexec",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "NetExec",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "smb",
|
|
20
|
+
"description": "NetExec protocol to enumerate, for example smb, ldap, ssh, or winrm.",
|
|
21
|
+
"name": "protocol",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "medium",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
|
@@ -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 child = spawn("prowler", ["aws", "--output-formats", "json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
10
|
+
let stdout = "";
|
|
11
|
+
let stderr = "";
|
|
12
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
13
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
14
|
+
child.on("error", (error) => {
|
|
15
|
+
emit({ type: "error", message: `Prowler failed: ${error.message}` });
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
});
|
|
18
|
+
child.on("close", (code) => {
|
|
19
|
+
const plain = stdout.replace(/\x1b\[[0-9;]*m/g, "");
|
|
20
|
+
const findings = [];
|
|
21
|
+
for (const line of plain.split("\n")) {
|
|
22
|
+
const trimmed = line.trim();
|
|
23
|
+
const match = trimmed.match(/^(PASS|FAIL|MUTED)\s+(.+)$/);
|
|
24
|
+
if (!match) continue;
|
|
25
|
+
findings.push({ status: match[1], check: match[2].trim() });
|
|
26
|
+
}
|
|
27
|
+
if (code !== 0 && !findings.length) {
|
|
28
|
+
emit({ type: "error", message: `Prowler failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const passed = findings.filter((finding) => finding.status === "PASS").length;
|
|
33
|
+
const failed = findings.filter((finding) => finding.status === "FAIL").length;
|
|
34
|
+
emit({
|
|
35
|
+
type: "result",
|
|
36
|
+
summary: `Prowler reported ${failed} failing and ${passed} passing checks.`,
|
|
37
|
+
data: { passed, failed, findings: findings.slice(0, 200) },
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: `Prowler audit finished: ${failed} failing, ${passed} passing.` });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "cloud",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs a Prowler cloud security audit and reports passing and failing checks.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "prowler",
|
|
9
|
+
"install_hint": "Install prowler from your distribution packages or with pipx install prowler.",
|
|
10
|
+
"name": "Prowler"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "cloud/prowler",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Prowler",
|
|
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 plugin = String(request.options?.plugin ?? "windows.info");
|
|
11
|
+
const child = spawn("vol", ["-f", target, plugin], { 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: `Volatility 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 lines = [];
|
|
23
|
+
for (const line of plain.split("\n")) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed) continue;
|
|
26
|
+
if (/^Volatility\b/i.test(trimmed)) continue;
|
|
27
|
+
if (/^Progress:/i.test(trimmed)) continue;
|
|
28
|
+
lines.push(trimmed);
|
|
29
|
+
}
|
|
30
|
+
if (code !== 0 && !lines.length) {
|
|
31
|
+
emit({ type: "error", message: `Volatility failed: ${stderr.trim() || `exited with ${code}`}` });
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
emit({
|
|
36
|
+
type: "result",
|
|
37
|
+
summary: `Volatility ${plugin} returned ${lines.length} lines for ${target}.`,
|
|
38
|
+
data: { target, plugin, lines: lines.slice(0, 100) },
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: `Volatility ${plugin} finished: ${lines.length} lines.` });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"category": "incident-response",
|
|
3
|
+
"core_api": "^0.1.0",
|
|
4
|
+
"description": "Runs a Volatility 3 plugin against a memory image and reports the results.",
|
|
5
|
+
"entry": "index.mjs",
|
|
6
|
+
"external_tools": [
|
|
7
|
+
{
|
|
8
|
+
"command": "vol",
|
|
9
|
+
"install_hint": "Install Volatility 3 from your distribution packages or with pipx install volatility3.",
|
|
10
|
+
"name": "Volatility 3"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"id": "incident-response/volatility",
|
|
14
|
+
"kind": "wrapper",
|
|
15
|
+
"maintenance": "active",
|
|
16
|
+
"name": "Volatility",
|
|
17
|
+
"options": [
|
|
18
|
+
{
|
|
19
|
+
"default": "windows.info",
|
|
20
|
+
"description": "Volatility 3 plugin to run, for example windows.info or linux.pslist.",
|
|
21
|
+
"name": "plugin",
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"risk": "low",
|
|
26
|
+
"schema_version": 1,
|
|
27
|
+
"version": "0.1.0"
|
|
28
|
+
}
|
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.7.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.7.0",
|
|
82
|
+
update_message: (await checkForUpdate("1.7.0")).message,
|
|
83
83
|
categories: CATEGORIES,
|
|
84
84
|
modules: modules.map(({ manifest }) => manifest),
|
|
85
85
|
external_tools: [...tools.values()],
|