cantarella-framework 0.7.0 → 0.8.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ - New native modules: HTTP security headers, DNS records, hash identifier, and username checker.
6
+
3
7
  ## 0.7.0
4
8
 
5
9
  - Self-update: `canta update core` checks npm and installs the latest release; the GUI banner reports real update status. GitHub Actions workflow publishes tagged releases to npm.
@@ -0,0 +1,45 @@
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 username = encodeURIComponent(String(request.target ?? "").trim());
8
+ if (!username) {
9
+ emit({ type: "error", message: "A username is required." });
10
+ process.exitCode = 1;
11
+ return;
12
+ }
13
+ const sites = [
14
+ ["GitHub", `https://github.com/${username}`],
15
+ ["GitLab", `https://gitlab.com/${username}`],
16
+ ["Reddit", `https://www.reddit.com/user/${username}`],
17
+ ["HackerOne", `https://hackerone.com/${username}`],
18
+ ["TryHackMe", `https://tryhackme.com/p/${username}`],
19
+ ];
20
+ const results = [];
21
+ await Promise.all(
22
+ sites.map(async ([site, url]) => {
23
+ try {
24
+ const response = await fetch(url, {
25
+ method: "HEAD",
26
+ redirect: "manual",
27
+ signal: AbortSignal.timeout(8000),
28
+ });
29
+ results.push({ site, url, status: response.status, likely_exists: response.status === 200 });
30
+ } catch (error) {
31
+ results.push({ site, url, status: null, likely_exists: false, error: error.message });
32
+ }
33
+ }),
34
+ );
35
+ results.sort((a, b) => a.site.localeCompare(b.site));
36
+ const found = results.filter((item) => item.likely_exists);
37
+ emit({
38
+ type: "result",
39
+ summary: found.length
40
+ ? `Username likely exists on: ${found.map((item) => item.site).join(", ")}.`
41
+ : "Username was not found on the checked sites.",
42
+ data: { username: decodeURIComponent(username), results },
43
+ });
44
+ emit({ type: "done", summary: "Username check finished." });
45
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "osint/username-checker",
4
+ "name": "Username Checker",
5
+ "version": "0.1.0",
6
+ "category": "osint",
7
+ "kind": "native",
8
+ "risk": "low",
9
+ "description": "Checks whether a username appears on a small set of public sites.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,33 @@
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
+ const hash = String(request.target ?? "").trim();
8
+ const candidates = [];
9
+ if (/^\$2[aby]\$\d{2}\$/.test(hash)) candidates.push("bcrypt");
10
+ if (/^\$argon2/.test(hash)) candidates.push("Argon2");
11
+ if (/^\$6\$/.test(hash)) candidates.push("SHA-512 crypt");
12
+ if (/^\$5\$/.test(hash)) candidates.push("SHA-256 crypt");
13
+ if (/^\$1\$/.test(hash)) candidates.push("MD5 crypt");
14
+ if (/^[a-f0-9]+$/i.test(hash)) {
15
+ const byLength = {
16
+ 32: ["MD5", "NTLM"],
17
+ 40: ["SHA-1"],
18
+ 56: ["SHA-224"],
19
+ 64: ["SHA-256"],
20
+ 96: ["SHA-384"],
21
+ 128: ["SHA-512"],
22
+ };
23
+ candidates.push(...(byLength[hash.length] ?? []));
24
+ }
25
+ emit({
26
+ type: "result",
27
+ summary: candidates.length
28
+ ? `Likely hash type: ${candidates.join(" or ")}.`
29
+ : "Hash type not recognized from format alone.",
30
+ data: { length: hash.length, candidates },
31
+ });
32
+ emit({ type: "done", summary: "Hash identification finished." });
33
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "password/hash-identifier",
4
+ "name": "Hash Identifier",
5
+ "version": "0.1.0",
6
+ "category": "password",
7
+ "kind": "native",
8
+ "risk": "info",
9
+ "description": "Identifies likely hash types from length and format.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
@@ -0,0 +1,35 @@
1
+ import { promises as dns } from "node:dns";
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
+ const domain = String(request.target ?? "").replace(/^https?:\/\//, "").split("/")[0];
10
+ const lookups = {
11
+ A: () => dns.resolve4(domain),
12
+ AAAA: () => dns.resolve6(domain),
13
+ MX: () => dns.resolveMx(domain),
14
+ NS: () => dns.resolveNs(domain),
15
+ TXT: () => dns.resolveTxt(domain),
16
+ CNAME: () => dns.resolveCname(domain),
17
+ SOA: () => dns.resolveSoa(domain),
18
+ };
19
+ const records = {};
20
+ for (const [type, lookup] of Object.entries(lookups)) {
21
+ try {
22
+ const values = await lookup();
23
+ if (values && (Array.isArray(values) ? values.length : true)) records[type] = values;
24
+ } catch {
25
+ // No records of this type.
26
+ }
27
+ }
28
+ const count = Object.keys(records).length;
29
+ emit({
30
+ type: "result",
31
+ summary: `Found ${count} DNS record types for ${domain}: ${Object.keys(records).join(", ") || "none"}.`,
32
+ data: { domain, records },
33
+ });
34
+ emit({ type: "done", summary: `DNS lookup finished for ${domain}.` });
35
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "recon/dns-records",
4
+ "name": "DNS Records",
5
+ "version": "0.1.0",
6
+ "category": "recon",
7
+ "kind": "native",
8
+ "risk": "low",
9
+ "description": "Collects A, AAAA, MX, NS, TXT, CNAME, and SOA records for a domain.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
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", async () => {
5
+ const request = JSON.parse(input || "{}");
6
+ const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
7
+ const url = /^https?:\/\//.test(request.target ?? "") ? request.target : `https://${request.target}`;
8
+ try {
9
+ const response = await fetch(url, { redirect: "manual", signal: AbortSignal.timeout(8000) });
10
+ const checks = [
11
+ "strict-transport-security",
12
+ "content-security-policy",
13
+ "x-content-type-options",
14
+ "x-frame-options",
15
+ "referrer-policy",
16
+ "permissions-policy",
17
+ ];
18
+ const present = {};
19
+ const missing = [];
20
+ for (const header of checks) {
21
+ const value = response.headers.get(header);
22
+ if (value) present[header] = value;
23
+ else missing.push(header);
24
+ }
25
+ if (missing.length) {
26
+ emit({
27
+ type: "finding",
28
+ title: "Missing HTTP security headers",
29
+ severity: "low",
30
+ description: `Missing: ${missing.join(", ")}.`,
31
+ });
32
+ }
33
+ emit({
34
+ type: "result",
35
+ summary: `${url} returned HTTP ${response.status}; ${checks.length - missing.length}/${checks.length} security headers present.`,
36
+ data: { url, status: response.status, present, missing },
37
+ });
38
+ emit({ type: "done", summary: `Header check finished for ${url}.` });
39
+ } catch (error) {
40
+ emit({ type: "error", message: `Could not fetch ${url}: ${error.message}` });
41
+ process.exitCode = 1;
42
+ }
43
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "web/http-headers",
4
+ "name": "HTTP Security Headers",
5
+ "version": "0.1.0",
6
+ "category": "web",
7
+ "kind": "native",
8
+ "risk": "low",
9
+ "description": "Checks a URL for common HTTP security headers.",
10
+ "entry": "index.mjs",
11
+ "core_api": "^0.1.0",
12
+ "maintenance": "active",
13
+ "options": []
14
+ }
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "prepublishOnly": "npm test"
19
19
  },
20
20
  "type": "module",
21
- "version": "0.7.0",
21
+ "version": "0.8.0",
22
22
  "workspaces": [
23
23
  "packages/*"
24
24
  ],
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
11
11
  process.exit(0);
12
12
  throw error;
13
13
  });
14
- const VERSION = "0.7.0";
14
+ const VERSION = "0.8.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.7.0",
82
- update_message: (await checkForUpdate("0.7.0")).message,
81
+ version: "0.8.0",
82
+ update_message: (await checkForUpdate("0.8.0")).message,
83
83
  categories: CATEGORIES,
84
84
  modules: modules.map(({ manifest }) => manifest),
85
85
  external_tools: [...tools.values()],