cantarella-framework 0.10.0 → 0.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 +4 -0
- package/modules/internal-service-banner/index.mjs +41 -0
- package/modules/internal-service-banner/module.json +21 -0
- package/modules/mobile-apk-info/index.mjs +42 -0
- package/modules/mobile-apk-info/module.json +14 -0
- package/modules/vuln-management-cve-lookup/index.mjs +44 -0
- package/modules/vuln-management-cve-lookup/module.json +14 -0
- package/modules/wireless-wifi-scan/index.mjs +40 -0
- package/modules/wireless-wifi-scan/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
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
- New modules: APK info, Wi-Fi scan through nmcli, service banner grabber, and CVE lookup through NVD.
|
|
6
|
+
|
|
3
7
|
## 0.10.0
|
|
4
8
|
|
|
5
9
|
- New native modules: package audit, bug bounty scope checker, incident timeline builder, and cloud config checker.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import net from "node:net";
|
|
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 raw = String(request.target ?? "").replace(/^https?:\/\//, "").split("/")[0];
|
|
10
|
+
const [host, portText] = raw.split(":");
|
|
11
|
+
const port = Number(portText ?? 80);
|
|
12
|
+
let banner = "";
|
|
13
|
+
let finished = false;
|
|
14
|
+
const finish = () => {
|
|
15
|
+
if (finished) return;
|
|
16
|
+
finished = true;
|
|
17
|
+
const clean = banner.replace(/[^\x20-\x7e\r\n\t]/g, ".").trim().slice(0, 500);
|
|
18
|
+
emit({
|
|
19
|
+
type: "result",
|
|
20
|
+
summary: clean ? `${host}:${port} banner: ${clean.split("\n")[0]}` : `${host}:${port} sent no banner.`,
|
|
21
|
+
data: { host, port, banner: clean },
|
|
22
|
+
});
|
|
23
|
+
emit({ type: "done", summary: "Service banner check finished." });
|
|
24
|
+
socket.destroy();
|
|
25
|
+
};
|
|
26
|
+
const socket = net.connect({ host, port, timeout: 5000 }, () => {
|
|
27
|
+
if (request.options?.send) socket.write(`${request.options.send}\r\n`);
|
|
28
|
+
setTimeout(finish, 800);
|
|
29
|
+
});
|
|
30
|
+
socket.on("data", (chunk) => (banner += chunk.toString("utf8")));
|
|
31
|
+
socket.on("timeout", () => {
|
|
32
|
+
emit({ type: "error", message: `Connection to ${host}:${port} timed out.` });
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
socket.destroy();
|
|
35
|
+
});
|
|
36
|
+
socket.on("error", (error) => {
|
|
37
|
+
if (finished) return;
|
|
38
|
+
emit({ type: "error", message: `Service banner failed: ${error.message}` });
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "internal/service-banner",
|
|
4
|
+
"name": "Service Banner",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "internal",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"description": "Connects to a host and port and records the service banner.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": [
|
|
14
|
+
{
|
|
15
|
+
"name": "send",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Optional text to send after connecting.",
|
|
18
|
+
"default": ""
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", async () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
try {
|
|
10
|
+
const [data, info] = await Promise.all([readFile(request.target), stat(request.target)]);
|
|
11
|
+
const entries = [];
|
|
12
|
+
for (let offset = 0; offset + 30 <= data.length; offset += 1) {
|
|
13
|
+
if (data.readUInt32LE(offset) !== 0x04034b50) continue;
|
|
14
|
+
const nameLength = data.readUInt16LE(offset + 26);
|
|
15
|
+
const extraLength = data.readUInt16LE(offset + 28);
|
|
16
|
+
const name = data.subarray(offset + 30, offset + 30 + nameLength).toString("utf8");
|
|
17
|
+
if (name) entries.push(name);
|
|
18
|
+
offset += 29 + nameLength + extraLength;
|
|
19
|
+
}
|
|
20
|
+
const unique = [...new Set(entries)];
|
|
21
|
+
const dex = unique.filter((name) => /^classes\d*\.dex$/.test(name));
|
|
22
|
+
const nativeLibraries = unique.filter((name) => name.startsWith("lib/") && name.endsWith(".so"));
|
|
23
|
+
const signingFiles = unique.filter((name) => /^META-INF\/.*\.(RSA|DSA|EC|SF)$/i.test(name));
|
|
24
|
+
emit({
|
|
25
|
+
type: "result",
|
|
26
|
+
summary: `${request.target}: ${unique.length} entries, ${dex.length} DEX files, ${nativeLibraries.length} native libraries.`,
|
|
27
|
+
data: {
|
|
28
|
+
file: request.target,
|
|
29
|
+
size_bytes: info.size,
|
|
30
|
+
entries: unique.length,
|
|
31
|
+
has_manifest: unique.includes("AndroidManifest.xml"),
|
|
32
|
+
dex_files: dex,
|
|
33
|
+
native_libraries: nativeLibraries.slice(0, 100),
|
|
34
|
+
signing_files: signingFiles,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
emit({ type: "done", summary: "APK inspection finished." });
|
|
38
|
+
} catch (error) {
|
|
39
|
+
emit({ type: "error", message: `APK inspection failed: ${error.message}` });
|
|
40
|
+
process.exitCode = 1;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "mobile/apk-info",
|
|
4
|
+
"name": "APK Info",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "mobile",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"description": "Inspects a local APK archive structure, DEX files, native libraries, and signing files.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", async () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
const id = String(request.target ?? "").trim().toUpperCase();
|
|
8
|
+
if (!/^CVE-\d{4}-\d{4,}$/.test(id)) {
|
|
9
|
+
emit({ type: "error", message: "Target must be a CVE ID such as CVE-2024-3094." });
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const response = await fetch(`https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=${id}`, {
|
|
15
|
+
signal: AbortSignal.timeout(10000),
|
|
16
|
+
});
|
|
17
|
+
if (!response.ok) throw new Error(`NVD returned HTTP ${response.status}`);
|
|
18
|
+
const body = await response.json();
|
|
19
|
+
const cve = body.vulnerabilities?.[0]?.cve;
|
|
20
|
+
if (!cve) throw new Error(`${id} was not found in NVD`);
|
|
21
|
+
const description = cve.descriptions?.find((item) => item.lang === "en")?.value;
|
|
22
|
+
const metric =
|
|
23
|
+
cve.metrics?.cvssMetricV31?.[0]?.cvssData ??
|
|
24
|
+
cve.metrics?.cvssMetricV30?.[0]?.cvssData ??
|
|
25
|
+
cve.metrics?.cvssMetricV2?.[0]?.cvssData;
|
|
26
|
+
emit({
|
|
27
|
+
type: "result",
|
|
28
|
+
summary: `${id}: CVSS ${metric?.baseScore ?? "unknown"} (${metric?.baseSeverity ?? "unknown severity"}).`,
|
|
29
|
+
data: {
|
|
30
|
+
id,
|
|
31
|
+
published: cve.published,
|
|
32
|
+
last_modified: cve.lastModified,
|
|
33
|
+
description,
|
|
34
|
+
cvss: metric ?? null,
|
|
35
|
+
weaknesses: cve.weaknesses?.flatMap((item) => item.description?.map((entry) => entry.value) ?? []),
|
|
36
|
+
references: cve.references?.slice(0, 20).map((item) => item.url),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
emit({ type: "done", summary: "CVE lookup finished." });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
emit({ type: "error", message: `CVE lookup failed: ${error.message}` });
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "vuln-management/cve-lookup",
|
|
4
|
+
"name": "CVE Lookup",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "vuln-management",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "info",
|
|
9
|
+
"description": "Looks up a CVE in the NVD database and summarizes severity and references.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -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
|
+
JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const child = spawn("nmcli", ["-t", "-f", "SSID,SIGNAL,SECURITY,CHAN", "dev", "wifi", "list"], {
|
|
10
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
11
|
+
});
|
|
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: `Wi-Fi scan failed: ${error.message}` });
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
});
|
|
20
|
+
child.on("close", (code) => {
|
|
21
|
+
if (code !== 0) {
|
|
22
|
+
emit({ type: "error", message: `Wi-Fi scan failed: ${stderr.trim() || `nmcli exited with ${code}`}` });
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const networks = stdout
|
|
27
|
+
.split("\n")
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.map((line) => {
|
|
30
|
+
const [ssid, signal, security, channel] = line.split(":");
|
|
31
|
+
return { ssid, signal: Number(signal), security, channel: Number(channel) };
|
|
32
|
+
});
|
|
33
|
+
emit({
|
|
34
|
+
type: "result",
|
|
35
|
+
summary: `Found ${networks.length} nearby Wi-Fi networks.`,
|
|
36
|
+
data: { networks },
|
|
37
|
+
});
|
|
38
|
+
emit({ type: "done", summary: "Wi-Fi scan finished." });
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "wireless/wifi-scan",
|
|
4
|
+
"name": "Wi-Fi Scan",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "wireless",
|
|
7
|
+
"kind": "wrapper",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"description": "Lists nearby Wi-Fi networks through NetworkManager nmcli.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": [],
|
|
14
|
+
"external_tools": [
|
|
15
|
+
{
|
|
16
|
+
"name": "NetworkManager",
|
|
17
|
+
"command": "nmcli",
|
|
18
|
+
"install_hint": "Install NetworkManager (nmcli) from your distribution packages."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
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 = "0.
|
|
14
|
+
const VERSION = "0.11.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: "0.
|
|
82
|
-
update_message: (await checkForUpdate("0.
|
|
81
|
+
version: "0.11.0",
|
|
82
|
+
update_message: (await checkForUpdate("0.11.0")).message,
|
|
83
83
|
categories: CATEGORIES,
|
|
84
84
|
modules: modules.map(({ manifest }) => manifest),
|
|
85
85
|
external_tools: [...tools.values()],
|