pentesting 0.100.5 β 0.100.10
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/ARCHITECTURE.md +523 -447
- package/LICENSE +28 -28
- package/README.md +257 -223
- package/bin/pentesting.mjs +36 -36
- package/lib/runtime.mjs +182 -183
- package/package.json +5 -5
- package/pentesting-logo.svg +13 -13
- package/scripts/postinstall.mjs +33 -33
package/LICENSE
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 agnusdei1207
|
|
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.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
Note: This MIT license covers the published `pentesting` npm wrapper (the
|
|
26
|
-
launcher in `bin/` and `lib/` plus its install scripts). The Builder runtime
|
|
27
|
-
engine that the wrapper downloads and executes is a separate, proprietary
|
|
28
|
-
component and is not licensed under these terms.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agnusdei1207
|
|
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.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Note: This MIT license covers the published `pentesting` npm wrapper (the
|
|
26
|
+
launcher in `bin/` and `lib/` plus its install scripts). The Builder runtime
|
|
27
|
+
engine that the wrapper downloads and executes is a separate, proprietary
|
|
28
|
+
component and is not licensed under these terms.
|
package/README.md
CHANGED
|
@@ -1,227 +1,261 @@
|
|
|
1
|
-
# Pentesting π
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
|
1
|
+
# Pentesting π
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://api.iconify.design/hugeicons:bash.svg" alt="pentesting bash icon" width="120" />
|
|
5
|
+
<h1>pentesting</h1>
|
|
6
|
+
<p>Security-Focused Agent Runtime</p>
|
|
7
|
+
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](https://www.npmjs.com/package/pentesting)
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## β
Capabilities
|
|
15
|
+
|
|
16
|
+
Agent-loop essentials plus a security-focused runtime layer.
|
|
17
|
+
|
|
18
|
+
| Area | What it does |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Model-driven loop | Streaming action/observation loop; model Stop ends a turn, while verified artifacts close a mission and the full turn trajectory is persisted with the outcome |
|
|
21
|
+
| Tool guardrails | Read-before-edit enforcement, repeat-call guard, policy-gated file/shell/network |
|
|
22
|
+
| Permissions | Allow / Deny / Confirm, with once/always decisions persisted |
|
|
23
|
+
| Context compaction | Automatic micro-pruning + model-triggered summarization, pre/post hooks |
|
|
24
|
+
| Interrupt & steering | ESC stops the current turn and auto loop; queued input uses revisioned FIFO amend/replace semantics and deterministic PTY Enter ownership |
|
|
25
|
+
| Reverse-shell control plane | Accept and track multiple authorized callbacks, tag/probe sessions, send/observe/run commands, verify PTY upgrades, and keep transcript/ledger/evidence records |
|
|
26
|
+
| PTY session control | One actor owns each socket/PTY/pipe, command queue, transcript, and child lifecycle, with resize gating, FD accounting, and deterministic close/revoke/gc reclamation |
|
|
27
|
+
| Frontier-guided exploration | Persistent lead ledger with explicit dispatch; breadth defaults to one and is hard-capped at four |
|
|
28
|
+
| Subagents | Explicit delegation to built-in specialists, including `crypto`, `rev`, and `pwn`; one selected agent can run up to four tasks concurrently |
|
|
29
|
+
| MCP & skills | Dynamic MCP tool discovery, layered markdown skills |
|
|
30
|
+
| Memory | Ebbinghaus-style decaying notes + hybrid lexical/semantic/graph retrieval |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
Delegation is explicit. One `task` call selects one agent and may run its tasks
|
|
35
|
+
concurrently; separate top-level calls are sequenced. `explore dispatch` instead
|
|
36
|
+
uses `builder` clones with category overlays and waits for the batch. Both paths
|
|
37
|
+
share permissions, budgets, lineage, and evidence checks.
|
|
38
|
+
|
|
39
|
+
### Core algorithms
|
|
40
|
+
|
|
41
|
+
| Area | Implementation | Time / space |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| Exploration | Score-ranked BFS/DFS guidance, parent backtracking, global reseeding; append-only leads folded into a `HashMap` | Snapshot/advice `O(R + L log L)` time, `O(L)` working and `O(R)` stored space |
|
|
44
|
+
| Knowledge | BM25 + 768-D cosine search + BFS over adjacency maps/visited sets, fused by RRF; fixed 20-round PageRank at index build | Query `O(M + N(Q + D + log N) + V log V + E)` time and `O(N + V + D)` working space; index storage `O(M + ND + V + E)` |
|
|
45
|
+
| Runtime control | FIFO queues plus semaphore-bounded `join_all` fan-out | `O(T)` scheduling/result state, at most four active children per batch |
|
|
46
|
+
|
|
47
|
+
`R` is lead records, `L` live leads, `M` searchable text, `N` notes, `Q` query
|
|
48
|
+
terms, `D = 768`, and `V/E` graph nodes/links. Memory decay is constant-time per
|
|
49
|
+
note. Kruskal, Prim, and a generic divide-and-conquer engine are not runtime
|
|
50
|
+
components; agents may apply them to a target when useful.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## π Quick Start
|
|
55
|
+
|
|
56
|
+
Install globally, or run once with a Node package runner:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g pentesting && pentesting # install
|
|
60
|
+
npx pentesting # or run once, no install
|
|
61
|
+
pnpm dlx pentesting
|
|
62
|
+
yarn dlx pentesting
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Requires Node.js 18.18+. Use npm/npx/pnpm/yarn; Bun and Deno runners are not supported.
|
|
66
|
+
|
|
67
|
+
### Docker-only development builds
|
|
68
|
+
|
|
69
|
+
Repository builds and Rust tests must always use the resource-capped Docker
|
|
70
|
+
wrappers. Host Cargo compilation is fail-closed; free disk or RAM does not make
|
|
71
|
+
it an approved path.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
scripts/dbuild.sh check --workspace --all-targets
|
|
75
|
+
scripts/dbuild.sh test -p builder_domain
|
|
76
|
+
scripts/dverify.sh focused
|
|
77
|
+
scripts/dverify.sh full
|
|
78
|
+
scripts/dbuild-image.sh validation # once per fresh Docker cache
|
|
79
|
+
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/dbuild.ps1 test -p builder_domain # Windows
|
|
80
|
+
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/nverify.ps1 # Windows npm verify
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The wrappers cap memory, CPU, PIDs, jobs, test threads, and time; verify storage
|
|
84
|
+
before launch; serialize resource-intensive work; and leave a redacted resource
|
|
85
|
+
report. Automated CI/CD is disabled. Full policy: [Docker-only build safety](https://github.com/agnusdei1207/pentesting/blob/main/docs/BUILD_SAFETY.md).
|
|
86
|
+
|
|
87
|
+
### π³ Run with Docker
|
|
88
|
+
|
|
89
|
+
No local Rust toolchain needed:
|
|
90
|
+
|
|
91
|
+
Published images support `linux/amd64` only. Docker is the recommended runtime
|
|
92
|
+
on Windows and macOS; Apple Silicon Macs run the amd64 image through Docker
|
|
93
|
+
Desktop emulation. Native ARM64 images and binaries are not supported.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
export OPENAI_API_KEY="sk-..." # provider API key or gateway token
|
|
97
|
+
export OPENAI_BASE_URL="https://api.openai.com/v1"
|
|
98
|
+
export OPENAI_MODEL="gpt-4o"
|
|
99
|
+
export OPENAI_MAX_TOKENS="4096"
|
|
100
|
+
|
|
101
|
+
docker run -it --rm \
|
|
102
|
+
-v "$(pwd):/workspace" \
|
|
103
|
+
-v pentesting-config:/root/.pentesting \
|
|
104
|
+
-w /workspace \
|
|
105
|
+
-e OPENAI_API_KEY \
|
|
106
|
+
-e OPENAI_BASE_URL \
|
|
107
|
+
-e OPENAI_MODEL \
|
|
108
|
+
-e OPENAI_MAX_TOKENS \
|
|
109
|
+
agnusdei1207/pentesting:latest
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Provider environment variables are optional for startup. If they are omitted,
|
|
113
|
+
the interactive TUI still launches and lets you configure/login inside the
|
|
114
|
+
persistent `pentesting-config` volume.
|
|
115
|
+
|
|
116
|
+
Or via Docker Compose:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
PENTESTING_PROJECT_DIR=/path/to/project \
|
|
120
|
+
OPENAI_API_KEY=sk-... \
|
|
121
|
+
OPENAI_BASE_URL=https://api.openai.com/v1 \
|
|
122
|
+
OPENAI_MODEL=gpt-4o \
|
|
123
|
+
OPENAI_MAX_TOKENS=4096 \
|
|
124
|
+
docker compose run --rm pentesting
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Common commands
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
pentesting # Interactive TUI
|
|
131
|
+
pentesting --prompt "Enumerate the target and summarize next actions."
|
|
132
|
+
pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-shell listener
|
|
133
|
+
pentesting --version
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Use `shell-listener` in authorized CTF/lab work to accept callbacks, tag sessions, run sentinel-tracked commands, verify PTY upgrades, and retain transcripts/evidence.
|
|
137
|
+
|
|
138
|
+
Short version: the agent can catch a dumb reverse shell, upgrade it to a verified PTY, pivot to a second callback, and reclaim both sessions cleanly with `close` / `revoke` / `gc`.
|
|
139
|
+
|
|
140
|
+
### Interactive commands
|
|
141
|
+
|
|
142
|
+
Sessions start with auto mode off. Esc stops both the current turn and autonomous continuation. Queued input is replayed in FIFO order.
|
|
143
|
+
|
|
144
|
+
| Command | Purpose |
|
|
23
145
|
| --- | --- |
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm install -g pentesting && pentesting # install
|
|
44
|
-
npx pentesting # or run once, no install
|
|
45
|
-
pnpm dlx pentesting
|
|
46
|
-
yarn dlx pentesting
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Requires Node.js 18.18+. Use npm/npx/pnpm/yarn; Bun and Deno runners are not supported.
|
|
50
|
-
|
|
51
|
-
### π³ Run with Docker
|
|
52
|
-
|
|
53
|
-
No local Rust toolchain needed:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
export OPENAI_API_KEY="sk-..." # provider API key or gateway token
|
|
57
|
-
export OPENAI_BASE_URL="https://api.openai.com/v1"
|
|
58
|
-
export OPENAI_MODEL="gpt-4o"
|
|
59
|
-
export OPENAI_MAX_TOKENS="4096"
|
|
60
|
-
|
|
61
|
-
docker run -it --rm \
|
|
62
|
-
-v "$(pwd):/workspace" \
|
|
63
|
-
-v pentesting-config:/root/.pentesting \
|
|
64
|
-
-w /workspace \
|
|
65
|
-
-e OPENAI_API_KEY \
|
|
66
|
-
-e OPENAI_BASE_URL \
|
|
67
|
-
-e OPENAI_MODEL \
|
|
68
|
-
-e OPENAI_MAX_TOKENS \
|
|
69
|
-
agnusdei1207/pentesting:latest
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Provider environment variables are optional for startup. If they are omitted,
|
|
73
|
-
the interactive TUI still launches and lets you configure/login inside the
|
|
74
|
-
persistent `pentesting-config` volume.
|
|
75
|
-
|
|
76
|
-
Or via Docker Compose:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
PENTESTING_PROJECT_DIR=/path/to/project \
|
|
80
|
-
OPENAI_API_KEY=sk-... \
|
|
81
|
-
OPENAI_BASE_URL=https://api.openai.com/v1 \
|
|
82
|
-
OPENAI_MODEL=gpt-4o \
|
|
83
|
-
OPENAI_MAX_TOKENS=4096 \
|
|
84
|
-
docker compose run --rm pentesting
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Common commands
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
pentesting # Interactive TUI
|
|
91
|
-
pentesting --prompt "Enumerate the target and summarize next actions."
|
|
92
|
-
pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-shell listener
|
|
93
|
-
pentesting --version
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Use `shell-listener` in authorized CTF/lab work to accept callbacks, tag sessions, run sentinel-tracked commands, verify PTY upgrades, and retain transcripts/evidence.
|
|
97
|
-
|
|
98
|
-
Short version: the agent can catch a dumb reverse shell, upgrade it to a verified PTY, pivot to a second callback, and reclaim both sessions cleanly with `close` / `revoke` / `gc`.
|
|
99
|
-
|
|
100
|
-
Inside a session, `/help` lists every command and `/update` pulls the latest release for supported native targets.
|
|
101
|
-
|
|
146
|
+
| `/help` | List every command |
|
|
147
|
+
| `/model [query]` | Choose a provider/model or custom endpoint |
|
|
148
|
+
| `/goal <objective>` Β· `/auto` | Record a goal, then toggle autonomous continuation; Esc stops it |
|
|
149
|
+
| `/status` Β· `/usage` | Inspect run state, gates, budgets, tokens, and requests |
|
|
150
|
+
| `/context` Β· `/memory` | Inspect context-budget snapshots and stored memories |
|
|
151
|
+
| `/agent` Β· `/builder` Β· `/planner` Β· `/researcher` | Select the active agent |
|
|
152
|
+
| `/new` Β· `/retry` Β· `/compact` | Start fresh, retry the last turn, or compact context |
|
|
153
|
+
| `/config` Β· `/tools` Β· `/skill` | Configure the runtime and inspect capabilities |
|
|
154
|
+
| `/workflow report` | Export the active run as Markdown |
|
|
155
|
+
| `/update` Β· `/exit` | Update the native release or quit |
|
|
156
|
+
|
|
157
|
+
On native Windows Git Bash, the repository smoke path builds the capped Docker
|
|
158
|
+
image and then opens this interactive TUI without WSL:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm run check
|
|
162
|
+
```
|
|
163
|
+
|
|
102
164
|
### π Reverse-shell & PTY sessions
|
|
103
|
-
|
|
104
|
-
Catch and manage authorized shell callbacks: one listener, many targets, audited cleanup.
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
|
|
108
|
-
pentesting shell-session list # 2. See every live session + FD ownership
|
|
109
|
-
pentesting shell-session run -- id # 3. Run sentinel-bounded commands, capture output
|
|
110
|
-
pentesting shell-session
|
|
111
|
-
pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs + archive evidence
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
- **Track** β each callback is accepted, numbered, and tagged; `list` / `info` / `fdstat` / `lifecycle` show
|
|
115
|
-
- **Drive** β `run` wraps commands in a sentinel to capture exactly their output; `send` / `raw` / `signal` / `resize` give interactive control.
|
|
116
|
-
- **Upgrade** β `
|
|
117
|
-
- **Record** β per-session raw log, full-duplex transcript, command ledger, replay, and evidence manifest β with secret redaction for registered values.
|
|
118
|
-
- **Reclaim** β `close` (graceful) and `revoke` (hard) release file descriptors immediately and archive the session; `gc` prunes closed sessions. Reclamation is tracked end-to-end, so FDs never leak.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
export
|
|
132
|
-
export
|
|
133
|
-
export
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
export
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
165
|
+
|
|
166
|
+
Catch and manage authorized shell callbacks: one listener, many targets, audited cleanup.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
|
|
170
|
+
pentesting shell-session list # 2. See every live session + FD ownership
|
|
171
|
+
pentesting shell-session run -- id # 3. Run sentinel-bounded commands, capture output
|
|
172
|
+
pentesting shell-session upgrade --technique auto # 4. Recon, select, retry, and verify a real PTY
|
|
173
|
+
pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs + archive evidence
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
- **Track** β each callback is accepted, numbered, and tagged; one session actor exclusively owns its live descriptors, transcript, and child lifecycle. `list` / `info` / `fdstat` / `lifecycle` show state and byte counts without cloned reader/writer descriptors.
|
|
177
|
+
- **Drive** β `run` wraps commands in a sentinel to capture exactly their output; `send` / `raw` / `signal` / `resize` give interactive control.
|
|
178
|
+
- **Upgrade** β `upgrade --technique auto` explicitly runs a bounded `recon β select β helper β probe` controller, choosing an allowlisted shell and retrying only evidence-backed failures across `python3`, `python`, `python2`, `script`, and `expect`. Omission is still rejected: use a concrete technique for one exact CLI attempt; unusual custom `text` commands are available through the `session_control`/JSONL API. CLI `pty-upgrade` sends one concrete catalog helper and never starts adaptive fallback.
|
|
179
|
+
- **Record** β per-session raw log, full-duplex transcript, command ledger, replay, and evidence manifest β with secret redaction for registered values.
|
|
180
|
+
- **Reclaim** β `close` (graceful) and `revoke` (hard) release file descriptors immediately and archive the session; `gc` prunes closed sessions. Reclamation is tracked end-to-end, so FDs never leak.
|
|
181
|
+
- **Guard** β the JSONL control plane is a workspace-internal Unix socket only (absolute paths, symlink escapes, and non-socket files are rejected). Every request carries a protocol version and a correlating `request_id`, is bounded to 1 MiB in / 4 MiB out, and `timeout_ms` is capped at 5 minutes and rejected before any bytes reach the session. A small fixed worker pool multiplexes the socket so a long adaptive `upgrade` never blocks `health` / `observe` / `close`, and injected secrets are redacted from responses and sensitive audit records. `probe` / recon fields are the target's own self-report, not a security attestation.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## βοΈ Configuration
|
|
186
|
+
|
|
187
|
+
Pentesting uses local storage by default. For normal use, configure only the model endpoint:
|
|
188
|
+
|
|
189
|
+
### Example `.env` / shell setup
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# OpenAI-compatible provider or gateway
|
|
193
|
+
export OPENAI_API_KEY="sk-..."
|
|
194
|
+
export OPENAI_BASE_URL="https://api.openai.com/v1"
|
|
195
|
+
export OPENAI_MODEL="gpt-4o"
|
|
196
|
+
export OPENAI_MAX_TOKENS="4096"
|
|
197
|
+
|
|
198
|
+
# Runtime overrides (optional)
|
|
199
|
+
export PENTESTING_CONFIG="$HOME/.config/pentesting" # move the global config dir
|
|
200
|
+
export PENTESTING_SKIP_DOWNLOAD=1 # skip postinstall binary download (CI)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The TUI pre-fills output max tokens from known model names/provider metadata. `OPENAI_MAX_TOKENS` and the TUI field are explicit overrides for custom/self-hosted models.
|
|
204
|
+
|
|
142
205
|
### Frontier-guided CTF exploration
|
|
143
206
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
> **Note:** The command you run is always **`pentesting`**. The internal engine is **`builder`** β `pentesting` downloads and runs it under the hood; the engine name never surfaces in normal use.
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## π Documentation
|
|
205
|
-
|
|
206
|
-
* [`ARCHITECTURE.md`](ARCHITECTURE.md) β Runtime flow, agent team, memory model, crate map, tool surface, and supported targets.
|
|
207
|
-
* Internal layout: service traits are split under `builder_app/src/services/*`; OpenAI request conversion is isolated under `dto/openai/request/*`.
|
|
208
|
-
* [Public site](https://agnusdei1207.github.io/pentesting-public/) β Landing page and public runtime entry surface.
|
|
209
|
-
* [`compose.yaml`](https://github.com/agnusdei1207/pentesting-public) β Docker Compose facade for pentesting sessions.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## πΉ From the Developer
|
|
214
|
-
|
|
215
|
-
<div align="center">
|
|
216
|
-
<img src="https://github.com/user-attachments/assets/abe73474-f27b-4536-b358-fedef1e461f0" alt="Chopin Ballade No.4" width="600" />
|
|
217
|
-
</div>
|
|
218
|
-
|
|
219
|
-
<br/>
|
|
220
|
-
|
|
221
|
-
> "I believe playing the piano is also a form of orchestration."
|
|
222
|
-
>
|
|
223
|
-
> The harmony of polyphony β multiple voices β and homophony β a single melodic line.
|
|
224
|
-
>
|
|
225
|
-
> Each voice sings its most beautiful song from its own place, yet when combined, they create one grand, beautiful melody. I believe this structure is no different from AI agents.
|
|
226
|
-
>
|
|
227
|
-
> β *agnusdei1207*
|
|
207
|
+
`explore` is always available. Use `/config` to set the engagement kind, flag
|
|
208
|
+
verification, and frontier limits; settings persist in the installed runtime's
|
|
209
|
+
user config. Breadth defaults to one and is capped at four. Leads are persistent,
|
|
210
|
+
deduplicated, and dispatched explicitly.
|
|
211
|
+
|
|
212
|
+
With Docker, mount both your project and the persistent runtime config volume, then pass the same variables through with `-e`:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
docker run -it --rm \
|
|
216
|
+
-v "$(pwd):/workspace" \
|
|
217
|
+
-v pentesting-config:/root/.pentesting \
|
|
218
|
+
-w /workspace \
|
|
219
|
+
-e OPENAI_API_KEY \
|
|
220
|
+
-e OPENAI_BASE_URL \
|
|
221
|
+
-e OPENAI_MODEL \
|
|
222
|
+
-e OPENAI_MAX_TOKENS \
|
|
223
|
+
agnusdei1207/pentesting:latest
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Those variables only pre-fill provider settings. Leaving them unset must not
|
|
227
|
+
block the container from launching the TUI; configure the provider interactively
|
|
228
|
+
inside the container instead.
|
|
229
|
+
|
|
230
|
+
> **Note:** The command you run is always **`pentesting`**. The internal engine is **`builder`** β `pentesting` downloads and runs it under the hood; the engine name never surfaces in normal use.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## π Documentation
|
|
235
|
+
|
|
236
|
+
- [`ARCHITECTURE.md`](ARCHITECTURE.md) β Runtime flow, agent team, memory model, crate map, tool surface, and supported targets.
|
|
237
|
+
- [Documentation map](https://github.com/agnusdei1207/pentesting/blob/main/docs/README.md) β Current authoritative documents versus historical plans and research notes.
|
|
238
|
+
- [Integrated runtime design](https://github.com/agnusdei1207/pentesting/blob/main/docs/BUILDER-CONSOLIDATED-DEEP-DIVE.md) β Top-down explanation from the one-loop model to prompt, subagents, persistence, and PTY ownership.
|
|
239
|
+
- [Minimal Core implementation](https://github.com/agnusdei1207/pentesting/blob/main/docs/plans/2026/07/10/minimal-core/README.md) β Implemented simplification record for the single turn/tool/security surface.
|
|
240
|
+
- [Next-generation clean-break convergence](https://github.com/agnusdei1207/pentesting/blob/main/docs/plans/2026/07/10/next-generation-convergence/README.md) β Canonical contracts, deleted compatibility paths, and the phase-by-phase migration boundary.
|
|
241
|
+
- Internal layout: service traits are split under `builder_app/src/services/*`; OpenAI request conversion is isolated under `dto/openai/request/*`.
|
|
242
|
+
- [Public site](https://agnusdei1207.github.io/pentesting-public/) β Landing page and public runtime entry surface.
|
|
243
|
+
- [`compose.yaml`](https://github.com/agnusdei1207/pentesting-public) β Docker Compose facade for pentesting sessions.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## πΉ From the Developer
|
|
248
|
+
|
|
249
|
+
<div align="center">
|
|
250
|
+
<img src="https://github.com/user-attachments/assets/abe73474-f27b-4536-b358-fedef1e461f0" alt="Chopin Ballade No.4" width="600" />
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<br/>
|
|
254
|
+
|
|
255
|
+
> "I believe playing the piano is also a form of orchestration."
|
|
256
|
+
>
|
|
257
|
+
> The harmony of polyphony β multiple voices β and homophony β a single melodic line.
|
|
258
|
+
>
|
|
259
|
+
> Each voice sings its most beautiful song from its own place, yet when combined, they create one grand, beautiful melody. I believe this structure is no different from AI agents.
|
|
260
|
+
>
|
|
261
|
+
> β *agnusdei1207*
|
package/bin/pentesting.mjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { spawnSync } from "node:child_process";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
pentestingEnvironment,
|
|
7
|
-
resolveBuilderBinary,
|
|
8
|
-
translateBuilderInvocation,
|
|
9
|
-
} from "../lib/runtime.mjs";
|
|
10
|
-
|
|
11
|
-
async function main() {
|
|
12
|
-
const invocation = translateBuilderInvocation(process.argv.slice(2));
|
|
13
|
-
for (const warning of invocation.warnings) {
|
|
14
|
-
console.warn(`[pentesting] ${warning}`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const builderBinary = await resolveBuilderBinary({ downloadIfMissing: true });
|
|
18
|
-
const result = spawnSync(builderBinary, invocation.builderArgs, {
|
|
19
|
-
stdio: "inherit",
|
|
20
|
-
env: pentestingEnvironment(process.env),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
if (result.error) {
|
|
24
|
-
console.error(
|
|
25
|
-
`pentesting could not start Builder (${result.error.message}). Set PENTESTING_BIN or reinstall the pentesting package.`,
|
|
26
|
-
);
|
|
27
|
-
process.exit(127);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
process.exit(result.status ?? 1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
main().catch((error) => {
|
|
34
|
-
console.error(`[pentesting] ${error instanceof Error ? error.message : String(error)}`);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
pentestingEnvironment,
|
|
7
|
+
resolveBuilderBinary,
|
|
8
|
+
translateBuilderInvocation,
|
|
9
|
+
} from "../lib/runtime.mjs";
|
|
10
|
+
|
|
11
|
+
async function main() {
|
|
12
|
+
const invocation = translateBuilderInvocation(process.argv.slice(2));
|
|
13
|
+
for (const warning of invocation.warnings) {
|
|
14
|
+
console.warn(`[pentesting] ${warning}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const builderBinary = await resolveBuilderBinary({ downloadIfMissing: true });
|
|
18
|
+
const result = spawnSync(builderBinary, invocation.builderArgs, {
|
|
19
|
+
stdio: "inherit",
|
|
20
|
+
env: pentestingEnvironment(process.env),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
if (result.error) {
|
|
24
|
+
console.error(
|
|
25
|
+
`pentesting could not start Builder (${result.error.message}). Set PENTESTING_BIN or reinstall the pentesting package.`,
|
|
26
|
+
);
|
|
27
|
+
process.exit(127);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
process.exit(result.status ?? 1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
main().catch((error) => {
|
|
34
|
+
console.error(`[pentesting] ${error instanceof Error ? error.message : String(error)}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
});
|