@memrov2/pentcloud-reference 0.0.0-stage → 0.1.1-dev.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PentCloud contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,16 @@
1
- # Temporary Holding Version
1
+ # PentCloud reference
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Searchsploit and pinned ExploitDB references in a separate native Cloudflare runtime. **Version 0.1.0 SDK.** readSource(path) returns bounded source bytes and SHA-256 from the same pinned revision, without execution.
4
+
5
+ ```js
6
+ export { ReferenceRunner } from '@memrov2/pentcloud-reference/worker';
7
+ const runner = env.TOOL.getByName(runId);
8
+ try {
9
+ const result = await runner.run({tool:'searchsploit',query:'2.4.49'});
10
+ // Save the result in your existing private assessment store.
11
+ } finally {
12
+ await runner.stop();
13
+ }
14
+ ```
15
+
16
+ Configure the matching named Container image. See [interfaces, build instructions, verification and limits](https://github.com/Memrov/PentCloud-tools/blob/main/docs/remaining-bundles.md) before integration. This package does not deploy or modify PentCloud.
@@ -0,0 +1,3 @@
1
+ # Third-party notices
2
+
3
+ The adapter is MIT licensed. Original runtime programs and data retain their upstream licenses and notices, preserved in the image. The package lock lists every pinned input. Unreleased candidate; no license grant for third-party redistribution is implied.
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@memrov2/pentcloud-reference",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1-dev.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "description": "Cloudflare-native reference tool pack",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Memrov/PentCloud-tools.git",
10
+ "directory": "packages/reference"
11
+ },
12
+ "engines": {
13
+ "node": ">=22"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./src/index.d.mts",
18
+ "import": "./src/index.mjs"
19
+ },
20
+ "./worker": {
21
+ "types": "./src/worker.d.mts",
22
+ "import": "./src/worker.mjs"
23
+ },
24
+ "./tools.lock.json": "./tools.lock.json"
25
+ },
26
+ "files": [
27
+ "src",
28
+ "tools.lock.json",
29
+ "LICENSE",
30
+ "THIRD_PARTY_NOTICES.md"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@memrov2/pentcloud-tool-runtime": "0.1.1-dev.0"
37
+ }
38
+ }
@@ -0,0 +1,16 @@
1
+ import type { ToolCommand, PackLock } from "@memrov2/pentcloud-tool-runtime";
2
+ export type PackRequest = { tool: "searchsploit"; query: string };
3
+ export declare const lock: PackLock;
4
+ export declare function buildCommand(input: PackRequest): ToolCommand;
5
+
6
+ export declare function fetchReference(
7
+ path: string,
8
+ fetcher?: typeof fetch,
9
+ ): Promise<{
10
+ path: string;
11
+ revision: string;
12
+ sha256: string;
13
+ bytes: Uint8Array;
14
+ }>;
15
+
16
+ export declare function referencePath(path: string): string;
package/src/index.mjs ADDED
@@ -0,0 +1,81 @@
1
+ import lock from "../tools.lock.json" with { type: "json" };
2
+ export { lock };
3
+ export function referencePath(path) {
4
+ if (typeof path === "string" && path.startsWith("/opt/exploitdb/"))
5
+ path = path.slice("/opt/exploitdb/".length);
6
+ if (
7
+ typeof path !== "string" ||
8
+ path.length > 240 ||
9
+ !/^(?:exploits|shellcodes)\/[a-z0-9_./-]+$/i.test(path) ||
10
+ path.split("/").some((p) => !p || p === "." || p === "..")
11
+ )
12
+ throw new TypeError("Select a pinned exploit reference path");
13
+ return path;
14
+ }
15
+ export async function fetchReference(path, fetcher = fetch) {
16
+ path = referencePath(path);
17
+ const url =
18
+ "https://gitlab.com/exploit-database/exploitdb/-/raw/" +
19
+ lock.dataRevision +
20
+ "/" +
21
+ path;
22
+ const response = await fetcher(url, {
23
+ redirect: "manual",
24
+ credentials: "omit",
25
+ signal: AbortSignal.timeout(15000),
26
+ });
27
+ if (
28
+ !response.ok ||
29
+ Number(response.headers.get("Content-Length") ?? 0) > 1048576
30
+ ) {
31
+ await response.body?.cancel();
32
+ throw new Error("Reference source unavailable or oversized");
33
+ }
34
+ const reader = response.body?.getReader();
35
+ if (!reader) throw new Error("Reference source body missing");
36
+ const chunks = [];
37
+ let length = 0;
38
+ while (true) {
39
+ const item = await reader.read();
40
+ if (item.done) break;
41
+ length += item.value.length;
42
+ if (length > 1048576) {
43
+ await reader.cancel();
44
+ throw new Error("Reference source exceeds one MiB");
45
+ }
46
+ chunks.push(item.value);
47
+ }
48
+ const bytes = new Uint8Array(length);
49
+ let offset = 0;
50
+ for (const chunk of chunks) {
51
+ bytes.set(chunk, offset);
52
+ offset += chunk.length;
53
+ }
54
+ const digest = await crypto.subtle.digest("SHA-256", bytes);
55
+ return {
56
+ path,
57
+ revision: lock.dataRevision,
58
+ sha256: [...new Uint8Array(digest)]
59
+ .map((x) => x.toString(16).padStart(2, "0"))
60
+ .join(""),
61
+ bytes,
62
+ };
63
+ }
64
+ export function buildCommand(input) {
65
+ if (
66
+ !input ||
67
+ Object.keys(input).some((k) => !["tool", "query"].includes(k)) ||
68
+ input.tool !== "searchsploit" ||
69
+ typeof input.query !== "string" ||
70
+ !input.query.trim() ||
71
+ input.query.length > 160 ||
72
+ input.query.startsWith("-") ||
73
+ !/^[a-z0-9 _./:+-]+$/i.test(input.query)
74
+ )
75
+ throw new TypeError("Use read-only search words");
76
+ return {
77
+ argv: ["/opt/pentcloud-reference/bin/searchsploit", "--json", input.query],
78
+ stdin: "",
79
+ timeoutMs: 75000,
80
+ };
81
+ }
@@ -0,0 +1,22 @@
1
+ import { DurableObject } from "cloudflare:workers";
2
+ import type { ToolResult } from "@memrov2/pentcloud-tool-runtime";
3
+ import type { PackRequest } from "./index.mjs";
4
+ export declare class ReferenceRunner extends DurableObject {
5
+ ready(): Promise<{ image: string; instance: "lite"; readyMs: number }>;
6
+ run(input: PackRequest): Promise<ToolResult>;
7
+ retire(): Promise<{ stopped: boolean; retired: true }>;
8
+ stop(): Promise<{ stopped: boolean }>;
9
+ readSource(
10
+ path: string,
11
+ ): Promise<{
12
+ path: string;
13
+ revision: string;
14
+ sha256: string;
15
+ bytes: Uint8Array;
16
+ }>;
17
+ capabilities(): Promise<{
18
+ platform: string;
19
+ architecture: string;
20
+ rawPacketSocket: boolean;
21
+ }>;
22
+ }
package/src/worker.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import { createRunner } from "@memrov2/pentcloud-tool-runtime/worker";
2
+ import { lock, buildCommand, fetchReference } from "./index.mjs";
3
+ const Runtime = createRunner(lock, buildCommand);
4
+ export class ReferenceRunner extends Runtime {
5
+ async readSource(path) {
6
+ if(await this.ctx.storage.get("retired"))throw new Error("Owned tool runtime is retired");
7
+ return fetchReference(path);
8
+ }
9
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "packId": "reference",
4
+ "packVersion": "0.1.0",
5
+ "platform": "linux/amd64",
6
+ "baseImage": "docker.io/library/debian@sha256:a72b4433de1cf7d6bae0c4cee74d0547f58601a643b3375f070c51600d63b6b2",
7
+ "tools": [
8
+ {
9
+ "tool": "searchsploit",
10
+ "version": "f08907b1"
11
+ }
12
+ ],
13
+ "assets": [
14
+ {
15
+ "url": "https://gitlab.com/exploit-database/exploitdb/-/raw/f08907b131f851c2ec3c052906f82ca83703ebef/searchsploit",
16
+ "path": "exploitdb/searchsploit",
17
+ "sha256": "16efc27312c6d3d9ea1be6e24ebc187e811c0606a33e52e80f1cbaabab77845f",
18
+ "executable": true
19
+ },
20
+ {
21
+ "url": "https://gitlab.com/exploit-database/exploitdb/-/raw/f08907b131f851c2ec3c052906f82ca83703ebef/.searchsploit_rc",
22
+ "path": "exploitdb/.searchsploit_rc",
23
+ "sha256": "a06c057c1bd2ce5c1ca42d04e1fe0b43127c9ba7dffeabc491681e5bf7ddad6c",
24
+ "executable": false
25
+ },
26
+ {
27
+ "url": "https://gitlab.com/exploit-database/exploitdb/-/raw/f08907b131f851c2ec3c052906f82ca83703ebef/files_exploits.csv",
28
+ "path": "exploitdb/files_exploits.csv",
29
+ "sha256": "10f31864b85c342c8a777a0248227dcd1e11ae50b246fcfa8bb8051bdc151062",
30
+ "executable": false
31
+ },
32
+ {
33
+ "url": "https://gitlab.com/exploit-database/exploitdb/-/raw/f08907b131f851c2ec3c052906f82ca83703ebef/files_shellcodes.csv",
34
+ "path": "exploitdb/files_shellcodes.csv",
35
+ "sha256": "d458fe46dff2144fa0a6f9ea5dcaa185f881b90d7ef5117740abb4ad5c2beb92",
36
+ "executable": false
37
+ },
38
+ {
39
+ "url": "https://gitlab.com/exploit-database/exploitdb/-/raw/f08907b131f851c2ec3c052906f82ca83703ebef/LICENSE.md",
40
+ "path": "exploitdb/LICENSE.md",
41
+ "sha256": "8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643",
42
+ "executable": false
43
+ }
44
+ ],
45
+ "debs": [
46
+ {
47
+ "package": "libonig5",
48
+ "version": "6.9.9-1+b1",
49
+ "url": "https://deb.debian.org/debian/pool/main/libo/libonig/libonig5_6.9.9-1%2bb1_amd64.deb",
50
+ "sha256": "3abee130696244050500bcc7870e3b4cb82ddd87149ece3fd55010c3d4e1d18c",
51
+ "format": "deb"
52
+ },
53
+ {
54
+ "package": "libjq1",
55
+ "version": "1.7.1-6+deb13u4",
56
+ "url": "https://deb.debian.org/debian-security/pool/updates/main/j/jq/libjq1_1.7.1-6%2bdeb13u4_amd64.deb",
57
+ "sha256": "70bb2cbd66d5ada4349067ae9f61d0560b3b359d4203f2c051ca5773153ae0ba",
58
+ "format": "deb"
59
+ },
60
+ {
61
+ "package": "jq",
62
+ "version": "1.7.1-6+deb13u4",
63
+ "url": "https://deb.debian.org/debian-security/pool/updates/main/j/jq/jq_1.7.1-6%2bdeb13u4_amd64.deb",
64
+ "sha256": "7350392f700e20e46b7ae174a57f54e4ea106dd559753646d629b4e618bf2bff",
65
+ "format": "deb"
66
+ }
67
+ ],
68
+ "executables": [
69
+ "searchsploit"
70
+ ],
71
+ "runtime": {
72
+ "enableInternet": false,
73
+ "vcpu": 1,
74
+ "memoryMib": 512,
75
+ "diskMb": 3000
76
+ },
77
+ "files": false,
78
+ "dataRevision": "f08907b131f851c2ec3c052906f82ca83703ebef",
79
+ "referenceFiles": {
80
+ "searchsploit": "exploitdb/searchsploit",
81
+ ".searchsploit_rc": "exploitdb/.searchsploit_rc",
82
+ "files_exploits.csv": "exploitdb/files_exploits.csv",
83
+ "files_shellcodes.csv": "exploitdb/files_shellcodes.csv",
84
+ "LICENSE.md": "exploitdb/LICENSE.md"
85
+ },
86
+ "links": {
87
+ "searchsploit": "/opt/exploitdb/searchsploit"
88
+ }
89
+ }