@memrov2/pentcloud-file-analysis 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 +21 -0
- package/README.md +15 -2
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/package.json +36 -4
- package/src/index.d.mts +4 -0
- package/src/index.mjs +23 -0
- package/src/worker.d.mts +14 -0
- package/src/worker.mjs +3 -0
- package/tools.lock.json +141 -0
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
|
-
#
|
|
1
|
+
# PentCloud file-analysis
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Offline Binwalk in a separate native Cloudflare runtime. **Version 0.1.0 SDK.** Uses pinned distro Binwalk 2.4.3; extraction and recursion are excluded.
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
export { FileRunner } from '@memrov2/pentcloud-file-analysis/worker';
|
|
7
|
+
const runner = env.TOOL.getByName(runId);
|
|
8
|
+
try {
|
|
9
|
+
const result = await runner.run({tool:'binwalk',view:'signatures'}, {input:fileBytes});
|
|
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-file-analysis",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1-dev.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "Cloudflare-native file-analysis tool pack",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/Memrov/PentCloud-tools.git",
|
|
10
|
+
"directory": "packages/file-analysis"
|
|
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
|
+
}
|
package/src/index.d.mts
ADDED
package/src/index.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import lock from "../tools.lock.json" with { type: "json" };
|
|
2
|
+
export { lock };
|
|
3
|
+
export function buildCommand(input) {
|
|
4
|
+
if (
|
|
5
|
+
!input ||
|
|
6
|
+
Object.keys(input).some((k) => !["tool", "view"].includes(k)) ||
|
|
7
|
+
input.tool !== "binwalk" ||
|
|
8
|
+
!["signatures", "entropy"].includes(input.view ?? "signatures")
|
|
9
|
+
)
|
|
10
|
+
throw new TypeError("Select an offline file view");
|
|
11
|
+
return {
|
|
12
|
+
argv: [
|
|
13
|
+
"/opt/pentcloud-file-analysis/bin/binwalk",
|
|
14
|
+
...(input.view === "entropy"
|
|
15
|
+
? ["--entropy", "--nplot"]
|
|
16
|
+
: ["--signature"]),
|
|
17
|
+
"/tmp/pentcloud-file-analysis/input.bin",
|
|
18
|
+
],
|
|
19
|
+
stdin: "",
|
|
20
|
+
timeoutMs: 75000,
|
|
21
|
+
requiredFiles: ["input"],
|
|
22
|
+
};
|
|
23
|
+
}
|
package/src/worker.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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 FileRunner extends DurableObject {
|
|
5
|
+
ready(): Promise<{ image: string; instance: "lite"; readyMs: number }>;
|
|
6
|
+
run(input: PackRequest, files: { input: Uint8Array }): Promise<ToolResult>;
|
|
7
|
+
retire(): Promise<{ stopped: boolean; retired: true }>;
|
|
8
|
+
stop(): Promise<{ stopped: boolean }>;
|
|
9
|
+
capabilities(): Promise<{
|
|
10
|
+
platform: string;
|
|
11
|
+
architecture: string;
|
|
12
|
+
rawPacketSocket: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
package/src/worker.mjs
ADDED
package/tools.lock.json
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packId": "file-analysis",
|
|
4
|
+
"packVersion": "0.1.0",
|
|
5
|
+
"platform": "linux/amd64",
|
|
6
|
+
"baseImage": "docker.io/library/debian@sha256:a72b4433de1cf7d6bae0c4cee74d0547f58601a643b3375f070c51600d63b6b2",
|
|
7
|
+
"tools": [
|
|
8
|
+
{
|
|
9
|
+
"tool": "binwalk",
|
|
10
|
+
"version": "2.4.3"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"assets": [],
|
|
14
|
+
"debs": [
|
|
15
|
+
{
|
|
16
|
+
"package": "libexpat1",
|
|
17
|
+
"version": "2.9.0-1~deb13u1",
|
|
18
|
+
"url": "https://deb.debian.org/debian-security/pool/updates/main/e/expat/libexpat1_2.9.0-1%7edeb13u1_amd64.deb",
|
|
19
|
+
"sha256": "feff874772cae904ae4d24e917b35664952bec4b4ae9100a4edda5a7fa746832",
|
|
20
|
+
"format": "deb"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"package": "libpython3.13-minimal",
|
|
24
|
+
"version": "3.13.5-2+deb13u5",
|
|
25
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3.13/libpython3.13-minimal_3.13.5-2%2bdeb13u5_amd64.deb",
|
|
26
|
+
"sha256": "a4aa6a9a8c77f87bfe545e1d14ec42c001d189ace90e3aa75deec882b39dee49",
|
|
27
|
+
"format": "deb"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"package": "python3.13-minimal",
|
|
31
|
+
"version": "3.13.5-2+deb13u5",
|
|
32
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3.13/python3.13-minimal_3.13.5-2%2bdeb13u5_amd64.deb",
|
|
33
|
+
"sha256": "c1fda9e7b1bf15b2fa75a238d8a8710e142fe14c722fc650c5fc614f078c9073",
|
|
34
|
+
"format": "deb"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"package": "python3-minimal",
|
|
38
|
+
"version": "3.13.5-1",
|
|
39
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3-defaults/python3-minimal_3.13.5-1_amd64.deb",
|
|
40
|
+
"sha256": "a5d2371bebf3689f676e3f3bae800371bcc4392a8a51269e23d528249b399615",
|
|
41
|
+
"format": "deb"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"package": "media-types",
|
|
45
|
+
"version": "13.0.0",
|
|
46
|
+
"url": "https://deb.debian.org/debian/pool/main/m/media-types/media-types_13.0.0_all.deb",
|
|
47
|
+
"sha256": "0788e4b0b72db1bcf74a19cb24c3511e7770ad0b341f0f30e361701c3072f53e",
|
|
48
|
+
"format": "deb"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"package": "netbase",
|
|
52
|
+
"version": "6.5",
|
|
53
|
+
"url": "https://deb.debian.org/debian/pool/main/n/netbase/netbase_6.5_all.deb",
|
|
54
|
+
"sha256": "76bafa92947ebd37b0a6f9ec6570412041f56edebc1c66d323731216d318471e",
|
|
55
|
+
"format": "deb"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"package": "libffi8",
|
|
59
|
+
"version": "3.4.8-2",
|
|
60
|
+
"url": "https://deb.debian.org/debian/pool/main/libf/libffi/libffi8_3.4.8-2_amd64.deb",
|
|
61
|
+
"sha256": "0ebdc340de33333639c3c63874cd4b15ac2e83dfa1ef3053b7eefaf4919f4f68",
|
|
62
|
+
"format": "deb"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"package": "libncursesw6",
|
|
66
|
+
"version": "6.5+20250216-2",
|
|
67
|
+
"url": "https://deb.debian.org/debian/pool/main/n/ncurses/libncursesw6_6.5%2b20250216-2_amd64.deb",
|
|
68
|
+
"sha256": "47baa2e11579583654583a066b69bd5a5d2f22423081f707ed6c0c3ba6d538b7",
|
|
69
|
+
"format": "deb"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"package": "readline-common",
|
|
73
|
+
"version": "8.2-6",
|
|
74
|
+
"url": "https://deb.debian.org/debian/pool/main/r/readline/readline-common_8.2-6_all.deb",
|
|
75
|
+
"sha256": "f77e8aa0bf0de618f11cb0b21658a4ed60f177d63b3cf26d7fc3706b6d0eaaa9",
|
|
76
|
+
"format": "deb"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"package": "libreadline8t64",
|
|
80
|
+
"version": "8.2-6",
|
|
81
|
+
"url": "https://deb.debian.org/debian/pool/main/r/readline/libreadline8t64_8.2-6_amd64.deb",
|
|
82
|
+
"sha256": "eeadf2b5e755c9f183883feea2d9b5b28560284275d5f54d3e55d0923b1d0967",
|
|
83
|
+
"format": "deb"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"package": "libpython3.13-stdlib",
|
|
87
|
+
"version": "3.13.5-2+deb13u5",
|
|
88
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3.13/libpython3.13-stdlib_3.13.5-2%2bdeb13u5_amd64.deb",
|
|
89
|
+
"sha256": "db161322a3481d2c0c3b9a3b9a03c3ab0e2b1718f54b88755fb4a3f939165b84",
|
|
90
|
+
"format": "deb"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"package": "python3.13",
|
|
94
|
+
"version": "3.13.5-2+deb13u5",
|
|
95
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3.13/python3.13_3.13.5-2%2bdeb13u5_amd64.deb",
|
|
96
|
+
"sha256": "460c1fd72845516ac3ce9d1686916f3ab2e4c86f8a9746e14d26243a47e2b98d",
|
|
97
|
+
"format": "deb"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"package": "libpython3-stdlib",
|
|
101
|
+
"version": "3.13.5-1",
|
|
102
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3-defaults/libpython3-stdlib_3.13.5-1_amd64.deb",
|
|
103
|
+
"sha256": "7e142ed64a81ccdd39714f213467bd365736ef341adb2be11be981f638b9175f",
|
|
104
|
+
"format": "deb"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"package": "python3",
|
|
108
|
+
"version": "3.13.5-1",
|
|
109
|
+
"url": "https://deb.debian.org/debian/pool/main/p/python3-defaults/python3_3.13.5-1_amd64.deb",
|
|
110
|
+
"sha256": "c1388174dc7140e6c19a6dd39f8a0dcb38a835cd66c65644e0dded43d5223cb0",
|
|
111
|
+
"format": "deb"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"package": "python3-binwalk",
|
|
115
|
+
"version": "2.4.3+dfsg1-2+deb13u1",
|
|
116
|
+
"url": "https://deb.debian.org/debian/pool/main/b/binwalk/python3-binwalk_2.4.3%2bdfsg1-2%2bdeb13u1_all.deb",
|
|
117
|
+
"sha256": "b857724e8b9eab3859aca97605961633d9a051cc8e207bd230be2beb92f652c3",
|
|
118
|
+
"format": "deb"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"package": "binwalk",
|
|
122
|
+
"version": "2.4.3+dfsg1-2+deb13u1",
|
|
123
|
+
"url": "https://deb.debian.org/debian/pool/main/b/binwalk/binwalk_2.4.3%2bdfsg1-2%2bdeb13u1_all.deb",
|
|
124
|
+
"sha256": "645a6833e8ca714dec3368d59a60ba42b3d015acf0749ae4ff3d819b9d0ff9c4",
|
|
125
|
+
"format": "deb"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"executables": [
|
|
129
|
+
"binwalk"
|
|
130
|
+
],
|
|
131
|
+
"runtime": {
|
|
132
|
+
"enableInternet": false,
|
|
133
|
+
"vcpu": 1,
|
|
134
|
+
"memoryMib": 1024,
|
|
135
|
+
"diskMb": 3000
|
|
136
|
+
},
|
|
137
|
+
"files": true,
|
|
138
|
+
"links": {
|
|
139
|
+
"binwalk": "/usr/bin/binwalk"
|
|
140
|
+
}
|
|
141
|
+
}
|