pentesting 0.100.13 → 0.101.2
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 +92 -37
- package/README.md +68 -206
- package/package.json +4 -5
package/ARCHITECTURE.md
CHANGED
|
@@ -130,19 +130,35 @@ request hot path. Explicit event metadata is routed deterministically; absent
|
|
|
130
130
|
metadata receives one general strategy. Named profiles may add context, but
|
|
131
131
|
coarse labels do not authorize or reject tool calls.
|
|
132
132
|
|
|
133
|
-
CTF engagement metadata may select `ctf-competition` prompt context, and
|
|
134
|
-
`flag_check` remains a verification tool and evidence source rather than a
|
|
135
|
-
default completion gate. `explore` is always available; `[exploration]` only
|
|
136
|
-
sets node and fan-out caps. Installed users edit the relevant engagement, flag,
|
|
137
|
-
and frontier fields through `/config`.
|
|
133
|
+
CTF engagement metadata may select `ctf-competition` prompt context, and
|
|
134
|
+
`flag_check` remains a verification tool and evidence source rather than a
|
|
135
|
+
default completion gate. `explore` is always available; `[exploration]` only
|
|
136
|
+
sets node and fan-out caps. Installed users edit the relevant engagement, flag,
|
|
137
|
+
and frontier fields through `/config`.
|
|
138
138
|
|
|
139
139
|
The shipped exploration tool does not replace the core execution strategy.
|
|
140
140
|
It provides a bounded `EvidenceKind::Lead` ledger and explicit dispatch. Stable
|
|
141
141
|
generated identity is separate from semantic deduplication. Dead probes suppress
|
|
142
142
|
an execution branch without rejecting its knowledge hypothesis, and fresh
|
|
143
|
-
evidence reopens scheduling.
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
evidence reopens scheduling. An explicit `explore op=frontier` call reads one
|
|
144
|
+
canonical snapshot and returns a bounded attention brief: one visible focus, at
|
|
145
|
+
most two alternatives, at most two alerts, state counts, and an omitted count.
|
|
146
|
+
Focus is visibility, not a recommendation, authorization, or execution lock;
|
|
147
|
+
priority scores stay internal and the model must name leads in a separate
|
|
148
|
+
`dispatch` call. The model-facing payload stays within 4 KiB after JSON and HTML
|
|
149
|
+
escaping. On an explicit `/status`, the same pure projection is loaded once and
|
|
150
|
+
rendered as Battlefield Lite: at most eight logical rows and 1.5 KiB, containing
|
|
151
|
+
only typed counts/enums/numeric metadata and revalidated Lead IDs. It omits Lead
|
|
152
|
+
title, detail, parent/sample IDs, evidence references, tool output, and score;
|
|
153
|
+
that is a narrow Lead-prose disclosure boundary, not a general secret scanner
|
|
154
|
+
for the rest of the diagnostic output. There is no passive mission-control
|
|
155
|
+
injection, model-request hot-path repository read, `/frontier` command, detached
|
|
156
|
+
task registry, advisor, or second scheduler.
|
|
157
|
+
`orch_spec::exploration_e2e` pins the explicit frontier/pivot/dispatch/merge
|
|
158
|
+
behavior. A deterministic 256-Lead Phase 4 fixture measured the legacy rendered
|
|
159
|
+
frontier at 121,420 bytes and the bounded brief at 1,858 bytes (98.46% smaller),
|
|
160
|
+
while the existing completion-provenance corpus remained 9/9. This supports the
|
|
161
|
+
bounded visibility decision; it is not a claim of improved live-model solve rate.
|
|
146
162
|
|
|
147
163
|
Reliability guards sit below the profile layer. Provider protocol capabilities
|
|
148
164
|
default native tool support for OpenAI/Anthropic-compatible responses on
|
|
@@ -179,16 +195,16 @@ flowchart TD
|
|
|
179
195
|
The core agent team is domain-neutral. Each agent ships as a markdown persona
|
|
180
196
|
definition under `crates/builder_repo/src/agents/`.
|
|
181
197
|
|
|
182
|
-
Subagents are explicit and bounded. A `task` call selects one agent; its tasks
|
|
183
|
-
run concurrently up to four per call and delegation stops at depth two.
|
|
184
|
-
Separate top-level tool calls are sequenced. Built-ins include `crypto`, `rev`,
|
|
185
|
-
and `pwn`.
|
|
186
|
-
|
|
187
|
-
`explore dispatch` is a separate path. It runs selected leads as `builder`
|
|
188
|
-
clones with category overlays, defaults to breadth one, is hard-capped at four,
|
|
189
|
-
and waits for the batch. It does not auto-route leads to specialist personas.
|
|
190
|
-
Every child uses the same tool/policy gateway, budget, lineage, and evidence
|
|
191
|
-
merge contracts.
|
|
198
|
+
Subagents are explicit and bounded. A `task` call selects one agent; its tasks
|
|
199
|
+
run concurrently up to four per call and delegation stops at depth two.
|
|
200
|
+
Separate top-level tool calls are sequenced. Built-ins include `crypto`, `rev`,
|
|
201
|
+
and `pwn`.
|
|
202
|
+
|
|
203
|
+
`explore dispatch` is a separate path. It runs selected leads as `builder`
|
|
204
|
+
clones with category overlays, defaults to breadth one, is hard-capped at four,
|
|
205
|
+
and waits for the batch. It does not auto-route leads to specialist personas.
|
|
206
|
+
Every child uses the same tool/policy gateway, budget, lineage, and evidence
|
|
207
|
+
merge contracts.
|
|
192
208
|
|
|
193
209
|
| Agent | Default role | Runtime profile |
|
|
194
210
|
| --- | --- | --- |
|
|
@@ -367,13 +383,52 @@ trusted verifier with explicit provenance is the only mission-promotion path;
|
|
|
367
383
|
|
|
368
384
|
## Diagnostic UI boundary
|
|
369
385
|
|
|
370
|
-
The default TUI renders the response stream and deterministic input queue. It
|
|
371
|
-
does not maintain a second workflow engine. `/status` consumes one immutable
|
|
386
|
+
The default TUI renders the response stream and deterministic input queue. It
|
|
387
|
+
does not maintain a second workflow engine. `/status` consumes one immutable
|
|
372
388
|
`RunStatusProjection`; `/workflow report` is the explicit offline export. The
|
|
373
|
-
former bare `/workflow` alias has been removed.
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
389
|
+
former bare `/workflow` alias has been removed. For an active run the projection
|
|
390
|
+
adds exactly one optional canonical Lead-ledger read and immediately reduces it
|
|
391
|
+
to `Option<AttentionBrief>`; raw nodes never cross the API boundary, an optional
|
|
392
|
+
read failure only renders `BATTLEFIELD [UNAVAILABLE]`, and no Lead produces no
|
|
393
|
+
battlefield rows. Core status read failures retain their existing error path.
|
|
394
|
+
With no recorded run, `/status` still shows goal, manual/auto mode, queue, and
|
|
395
|
+
usage without an evidence read. Recorded `TurnExit` and typed `MissionState` are
|
|
396
|
+
shown separately so model Stop or run completion cannot appear as verified
|
|
397
|
+
mission completion. The live status row deliberately remains limited to
|
|
398
|
+
actionable progress/wait state: there is no frontier parsing, background refresh,
|
|
399
|
+
write, dispatch shortcut, or hidden chrome state.
|
|
400
|
+
|
|
401
|
+
Completed type-ahead inputs carry an explicit active-turn behavior. Safe
|
|
402
|
+
inspection commands (`/info`, `/usage`, `/context`, `/memory`, `/status`,
|
|
403
|
+
`/help`, `/skill`, and `/tools`) are atomically extracted and
|
|
404
|
+
rendered without cancelling the response stream. State-changing and modal
|
|
405
|
+
commands, including `/log` and `/model`, remain in FIFO order until the next safe turn
|
|
406
|
+
boundary. `/new`, `/retry`, `/exit`, and explicit `/replace` retain interrupt
|
|
407
|
+
semantics and take priority over active-turn query extraction. The input buffer
|
|
408
|
+
rebuilds replay events after extraction so queued messages and the current draft
|
|
409
|
+
preserve their original order and cursor. Esc cancellation preserves submitted
|
|
410
|
+
queued input and starts its FIFO replay after stream cleanup; Ctrl+C remains the
|
|
411
|
+
explicit clear-buffer interrupt. A conversation reset consumes `/new` but retains
|
|
412
|
+
its FIFO tail for the new conversation. Modal prompts isolate that pre-existing
|
|
413
|
+
tail from widget input and expose it again only after modal ownership ends.
|
|
414
|
+
Commands that eventually open a modal keep the outer interrupt listener during
|
|
415
|
+
their asynchronous prefetch and persistence phases. Before the widget starts,
|
|
416
|
+
the terminal session requests a reader pause and waits for its acknowledgement;
|
|
417
|
+
the reader resumes after modal ownership ends. Type-ahead is therefore buffered
|
|
418
|
+
FIFO instead of racing or leaking into a later model, agent, or configuration
|
|
419
|
+
field. Service-layer approval, secret, selection, and follow-up prompts acquire
|
|
420
|
+
the same lifetime-bound modal handoff through the prompt-entry hook, and
|
|
421
|
+
concurrent service prompts are serialized so two widgets never read stdin at
|
|
422
|
+
once.
|
|
423
|
+
|
|
424
|
+
Typing `/` opens the complete registered command catalog. Search includes
|
|
425
|
+
canonical names and aliases; Up/Down changes the selection, and Enter inserts
|
|
426
|
+
the selected template into the editor for partial matches and commands that
|
|
427
|
+
require arguments. A later Enter submits that populated input; a fully typed
|
|
428
|
+
exact command that needs no expansion submits normally. Palette descriptions
|
|
429
|
+
expose `[now]`, `[queued]`, and `[interrupt]` so the queue behavior is visible
|
|
430
|
+
before submission. The selected entry is rendered as the first hint row so it
|
|
431
|
+
remains visible when the terminal can show only a constrained input viewport.
|
|
377
432
|
|
|
378
433
|
## Distribution — single source, two surfaces
|
|
379
434
|
|
|
@@ -422,14 +477,14 @@ Compilation is outside the application runtime boundary and is always executed
|
|
|
422
477
|
through resource-capped Docker wrappers. Host Cargo is not an emergency
|
|
423
478
|
fallback. `dbuild.sh` owns individual Cargo commands, `dverify.sh` owns
|
|
424
479
|
sequential gate profiles, and `dbuild-image.sh` owns BuildKit. Each path shares
|
|
425
|
-
storage admission, effective-limit inspection, a machine-wide lock, watchdogs,
|
|
426
|
-
and structured failure reports. Automated CI/CD is disabled; maintainers invoke
|
|
427
|
-
these wrappers explicitly. The
|
|
428
|
-
normative contract is [Docker-only build safety](https://github.com/agnusdei1207/pentesting/blob/main/docs/BUILD_SAFETY.md).
|
|
429
|
-
|
|
430
|
-
Patch publication performs one Cross build. The version-checked, checksummed
|
|
431
|
-
AMD64 musl artifact is uploaded to GitHub and packaged into Docker from a
|
|
432
|
-
minimal context; its dependency cache stays in a versioned Docker volume.
|
|
480
|
+
storage admission, effective-limit inspection, a machine-wide lock, watchdogs,
|
|
481
|
+
and structured failure reports. Automated CI/CD is disabled; maintainers invoke
|
|
482
|
+
these wrappers explicitly. The
|
|
483
|
+
normative contract is [Docker-only build safety](https://github.com/agnusdei1207/pentesting/blob/main/docs/BUILD_SAFETY.md).
|
|
484
|
+
|
|
485
|
+
Patch publication performs one Cross build. The version-checked, checksummed
|
|
486
|
+
AMD64 musl artifact is uploaded to GitHub and packaged into Docker from a
|
|
487
|
+
minimal context; its dependency cache stays in a versioned Docker volume.
|
|
433
488
|
|
|
434
489
|
The measured next-stage simplification and deletion plan is indexed at
|
|
435
490
|
[Minimal Core plan](https://github.com/agnusdei1207/pentesting/blob/main/docs/plans/2026/07/10/minimal-core/README.md).
|
|
@@ -443,9 +498,9 @@ overridden by project-local `.pentesting.toml` files discovered by walking up
|
|
|
443
498
|
from the working directory. Local storage is the default; normal setup only
|
|
444
499
|
needs the public model endpoint environment.
|
|
445
500
|
|
|
446
|
-
The full file shape is represented in `builder.schema.json`; common runtime and
|
|
447
|
-
CTF fields are editable through `/config`. Set `PENTESTING_CONFIG` to override
|
|
448
|
-
the global config directory.
|
|
501
|
+
The full file shape is represented in `builder.schema.json`; common runtime and
|
|
502
|
+
CTF fields are editable through `/config`. Set `PENTESTING_CONFIG` to override
|
|
503
|
+
the global config directory.
|
|
449
504
|
|
|
450
505
|
| Variable | Description |
|
|
451
506
|
| --- | --- |
|
|
@@ -474,7 +529,7 @@ Inside an interactive session, these commands inspect and drive runtime state
|
|
|
474
529
|
(`/help` lists the full set):
|
|
475
530
|
|
|
476
531
|
```text
|
|
477
|
-
/status Show
|
|
532
|
+
/status Show goal/mode/queue, turn vs mission, run gates, budgets, and a bounded read-only battlefield
|
|
478
533
|
/workflow report
|
|
479
534
|
Export the active run, engagement metadata, evidence, and large outputs to Markdown
|
|
480
535
|
/context Show recent context-budget snapshots for the current conversation
|
|
@@ -483,7 +538,7 @@ Inside an interactive session, these commands inspect and drive runtime state
|
|
|
483
538
|
/agent Switch the active agent
|
|
484
539
|
/conversation Browse conversations for the active workspace
|
|
485
540
|
/goal <task> Set the active goal without enabling autonomous mode
|
|
486
|
-
/auto Toggle autonomous mode for the current goal (default: off; Esc stops it)
|
|
541
|
+
/auto Toggle autonomous mode for the current goal (default: off; Esc stops it)
|
|
487
542
|
/update Download and apply the latest public release asset for supported native targets
|
|
488
543
|
/help Show all commands
|
|
489
544
|
/exit Quit
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Pentesting 🔓
|
|
2
2
|
|
|
3
|
-
<div align="center">
|
|
4
|
-
<img src="https://api.iconify.design/hugeicons:bash.svg" alt="pentesting bash icon" width="120" />
|
|
5
|
-
<h1>
|
|
6
|
-
<p>
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://api.iconify.design/hugeicons:bash.svg" alt="pentesting bash icon" width="120" />
|
|
5
|
+
<h1>A High-Efficiency Penetration-Testing Agent</h1>
|
|
6
|
+
<p>Designed to achieve strong results with low-cost models. Powered by Rust.</p>
|
|
7
7
|
|
|
8
8
|
[](LICENSE)
|
|
9
9
|
[](https://www.npmjs.com/package/pentesting)
|
|
@@ -11,49 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
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
14
|
## 🚀 Quick Start
|
|
55
15
|
|
|
56
|
-
Install globally, or run once with a Node package runner:
|
|
16
|
+
Install globally, or run once with a Node package runner (Node.js 18.18+):
|
|
57
17
|
|
|
58
18
|
```bash
|
|
59
19
|
npm install -g pentesting && pentesting # install
|
|
@@ -62,38 +22,9 @@ pnpm dlx pentesting
|
|
|
62
22
|
yarn dlx pentesting
|
|
63
23
|
```
|
|
64
24
|
|
|
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
|
-
Patch releases compile once, verify the binary version and SHA-256, and reuse
|
|
88
|
-
that same AMD64 artifact for GitHub and Docker publication.
|
|
89
|
-
|
|
90
25
|
### 🐳 Run with Docker
|
|
91
26
|
|
|
92
|
-
No local
|
|
93
|
-
|
|
94
|
-
Published images support `linux/amd64` only. Docker is the recommended runtime
|
|
95
|
-
on Windows and macOS; Apple Silicon Macs run the amd64 image through Docker
|
|
96
|
-
Desktop emulation. Native ARM64 images and binaries are not supported.
|
|
27
|
+
No local toolchain needed. Published images are `linux/amd64` only.
|
|
97
28
|
|
|
98
29
|
```bash
|
|
99
30
|
export OPENAI_API_KEY="sk-..." # provider API key or gateway token
|
|
@@ -112,146 +43,71 @@ docker run -it --rm \
|
|
|
112
43
|
agnusdei1207/pentesting:latest
|
|
113
44
|
```
|
|
114
45
|
|
|
115
|
-
Provider
|
|
116
|
-
the interactive TUI still launches and lets you configure/login inside the
|
|
117
|
-
persistent `pentesting-config` volume.
|
|
118
|
-
|
|
119
|
-
Or via Docker Compose:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
PENTESTING_PROJECT_DIR=/path/to/project \
|
|
123
|
-
OPENAI_API_KEY=sk-... \
|
|
124
|
-
OPENAI_BASE_URL=https://api.openai.com/v1 \
|
|
125
|
-
OPENAI_MODEL=gpt-4o \
|
|
126
|
-
OPENAI_MAX_TOKENS=4096 \
|
|
127
|
-
docker compose run --rm pentesting
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Common commands
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
pentesting # Interactive TUI
|
|
134
|
-
pentesting --prompt "Enumerate the target and summarize next actions."
|
|
135
|
-
pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-shell listener
|
|
136
|
-
pentesting --version
|
|
137
|
-
```
|
|
46
|
+
Provider variables are optional — the TUI launches without them and lets you log in inside the persistent `pentesting-config` volume. The TUI pre-fills output max tokens from the model; `OPENAI_MAX_TOKENS` overrides it.
|
|
138
47
|
|
|
139
|
-
|
|
48
|
+
---
|
|
140
49
|
|
|
141
|
-
|
|
50
|
+
## ✅ Capabilities
|
|
142
51
|
|
|
143
|
-
|
|
52
|
+
| Area | What it does |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Verified agent loop | Streams actions and observations; a model Stop ends only the turn, evidence-backed verification closes the mission, and the full trajectory is persisted |
|
|
55
|
+
| Unified tool boundary | Built-in, delegated, and MCP calls share schema validation, provenance, permissions, policy, and resource limits |
|
|
56
|
+
| Context economy | Automatic micro-pruning and model-triggered summaries preserve useful context for low-cost models |
|
|
57
|
+
| Deterministic steering | Esc stops the current turn and auto loop, while submitted input resumes in FIFO order at safe turn boundaries |
|
|
58
|
+
| Reverse-shell & PTY lifecycle | One control plane manages authorized callbacks and local PTY/pipe sessions, from tagging, probing, and verified upgrades to transcripts, evidence, FD accounting, and deterministic reclamation |
|
|
59
|
+
| Bounded battlefield | A persistent Lead ledger produces a compact on-demand attention brief and read-only `/status` view; dispatch stays explicit and is capped at four branches |
|
|
60
|
+
| Adversarial pathfinding | A localized AlphaGo-inspired minimax technique models an opponent's best defensive move and improves the ability to find viable bypass paths |
|
|
61
|
+
| Dynamic fan-out / fan-in | The model sizes each specialist batch to the task, runs up to four delegated branches concurrently, then returns their results to the parent with bounded depth and recorded lineage |
|
|
62
|
+
| Extensible skills & tools | Discovers MCP tools dynamically and layers Markdown skills onto the same guarded runtime surface |
|
|
63
|
+
| Forgetting-aware memory | Ebbinghaus-style decaying notes combine with lexical, semantic, and graph retrieval |
|
|
64
|
+
|
|
65
|
+
---
|
|
144
66
|
|
|
145
|
-
|
|
67
|
+
## 🧭 Philosophy
|
|
68
|
+
|
|
69
|
+
| Principle | What it means here |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| Simplicity is best | Prefer the smallest design that preserves the capability, makes ownership clear, and remains easy to verify |
|
|
72
|
+
| If it cannot be measured, it cannot be improved | Instrument outcomes, compare them under repeatable conditions, and let evidence drive the next change |
|
|
73
|
+
| The best design blueprint is the human being | Better systems begin with better self-observation: understand how we perceive, decide, learn, and recover, then make those loops observable |
|
|
74
|
+
| The agent is the bottleneck | As AI models advance, the agent framework and the surrounding system must evolve with them |
|
|
75
|
+
|
|
76
|
+
### Capability record
|
|
77
|
+
|
|
78
|
+
| Date | Record | Test conditions |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| 2026-04 | Project work began | Initial implementation and baseline work |
|
|
81
|
+
| 2026-07-15 | First project-reported result in which Pentesting exceeded Claude Code on the tested penetration-testing capability set; reported margin: approximately 40% | Pentesting with MiniMax M3 versus Claude Code with Sonnet 5; identical prompts; CTF tasks ranging from easy to hard; a 60-minute test window for each system |
|
|
82
|
+
|
|
83
|
+
This is a project-maintained, task-specific record, not an independent or general-purpose benchmark. It does not claim broader general-purpose superiority.
|
|
84
|
+
|
|
85
|
+
> Claude Code's strength is generality, an area where Pentesting was weaker. Even so, it was strong enough to become a foundation that other products wrapped for penetration-testing workflows. To me, it felt like a formidable wall—and, at the same time, the goal I wanted to surpass.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## ⌨️ Slash commands
|
|
146
90
|
|
|
147
91
|
| Command | Purpose |
|
|
148
92
|
| --- | --- |
|
|
149
|
-
| `/help` |
|
|
150
|
-
| `/model [query]` |
|
|
151
|
-
| `/goal <objective>`
|
|
152
|
-
| `/
|
|
153
|
-
| `/
|
|
154
|
-
| `/
|
|
155
|
-
| `/
|
|
156
|
-
| `/
|
|
157
|
-
| `/workflow report` | Export the active run as Markdown |
|
|
158
|
-
| `/update` · `/exit` | Update the native release or quit |
|
|
159
|
-
|
|
160
|
-
On native Windows Git Bash, the repository smoke path builds the capped Docker
|
|
161
|
-
image and then opens this interactive TUI without WSL:
|
|
93
|
+
| `/help` | Show commands |
|
|
94
|
+
| `/model [query]` | Switch provider, model, or custom endpoint |
|
|
95
|
+
| `/goal <objective>` | Set or clear the active goal |
|
|
96
|
+
| `/auto` | Run the active goal automatically; Esc stops it |
|
|
97
|
+
| `/status` | Show the current run and verified mission status |
|
|
98
|
+
| `/new` · `/retry` | Start a new conversation or retry the last turn |
|
|
99
|
+
| `/config` | Edit runtime configuration |
|
|
100
|
+
| `/exit` | Quit |
|
|
162
101
|
|
|
163
|
-
|
|
164
|
-
npm run check
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### 🔌 Reverse-shell & PTY sessions
|
|
168
|
-
|
|
169
|
-
Catch and manage authorized shell callbacks: one listener, many targets, audited cleanup.
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
|
|
173
|
-
pentesting shell-session list # 2. See every live session + FD ownership
|
|
174
|
-
pentesting shell-session run -- id # 3. Run sentinel-bounded commands, capture output
|
|
175
|
-
pentesting shell-session upgrade --technique auto # 4. Recon, select, retry, and verify a real PTY
|
|
176
|
-
pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs + archive evidence
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
- **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.
|
|
180
|
-
- **Drive** — `run` wraps commands in a sentinel to capture exactly their output; `send` / `raw` / `signal` / `resize` give interactive control.
|
|
181
|
-
- **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.
|
|
182
|
-
- **Record** — per-session raw log, full-duplex transcript, command ledger, replay, and evidence manifest — with secret redaction for registered values.
|
|
183
|
-
- **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.
|
|
184
|
-
- **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.
|
|
102
|
+
> The command you run is always **`pentesting`**. The internal engine is **`builder`** — `pentesting` runs it under the hood; the engine name never surfaces in normal use.
|
|
185
103
|
|
|
186
104
|
---
|
|
187
105
|
|
|
188
|
-
##
|
|
189
|
-
|
|
190
|
-
Pentesting uses local storage by default. For normal use, configure only the model endpoint:
|
|
191
|
-
|
|
192
|
-
### Example `.env` / shell setup
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
# OpenAI-compatible provider or gateway
|
|
196
|
-
export OPENAI_API_KEY="sk-..."
|
|
197
|
-
export OPENAI_BASE_URL="https://api.openai.com/v1"
|
|
198
|
-
export OPENAI_MODEL="gpt-4o"
|
|
199
|
-
export OPENAI_MAX_TOKENS="4096"
|
|
200
|
-
|
|
201
|
-
# Runtime overrides (optional)
|
|
202
|
-
export PENTESTING_CONFIG="$HOME/.config/pentesting" # move the global config dir
|
|
203
|
-
export PENTESTING_SKIP_DOWNLOAD=1 # skip postinstall binary download (CI)
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
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.
|
|
207
|
-
|
|
208
|
-
### Frontier-guided CTF exploration
|
|
106
|
+
## 🎹 From the Developer
|
|
209
107
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
deduplicated, and dispatched explicitly.
|
|
214
|
-
|
|
215
|
-
With Docker, mount both your project and the persistent runtime config volume, then pass the same variables through with `-e`:
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
docker run -it --rm \
|
|
219
|
-
-v "$(pwd):/workspace" \
|
|
220
|
-
-v pentesting-config:/root/.pentesting \
|
|
221
|
-
-w /workspace \
|
|
222
|
-
-e OPENAI_API_KEY \
|
|
223
|
-
-e OPENAI_BASE_URL \
|
|
224
|
-
-e OPENAI_MODEL \
|
|
225
|
-
-e OPENAI_MAX_TOKENS \
|
|
226
|
-
agnusdei1207/pentesting:latest
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Those variables only pre-fill provider settings. Leaving them unset must not
|
|
230
|
-
block the container from launching the TUI; configure the provider interactively
|
|
231
|
-
inside the container instead.
|
|
232
|
-
|
|
233
|
-
> **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.
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
## 📖 Documentation
|
|
238
|
-
|
|
239
|
-
- [`ARCHITECTURE.md`](ARCHITECTURE.md) — Runtime flow, agent team, memory model, crate map, tool surface, and supported targets.
|
|
240
|
-
- [Documentation map](https://github.com/agnusdei1207/pentesting/blob/main/docs/README.md) — Current authoritative documents versus historical plans and research notes.
|
|
241
|
-
- [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.
|
|
242
|
-
- [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.
|
|
243
|
-
- [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.
|
|
244
|
-
- Internal layout: service traits are split under `builder_app/src/services/*`; OpenAI request conversion is isolated under `dto/openai/request/*`.
|
|
245
|
-
- [Public site](https://agnusdei1207.github.io/pentesting-public/) — Landing page and public runtime entry surface.
|
|
246
|
-
- [`compose.yaml`](https://github.com/agnusdei1207/pentesting-public) — Docker Compose facade for pentesting sessions.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## 🎹 From the Developer
|
|
251
|
-
|
|
252
|
-
<div align="center">
|
|
253
|
-
<img src="https://github.com/user-attachments/assets/abe73474-f27b-4536-b358-fedef1e461f0" alt="Chopin Ballade No.4" width="600" />
|
|
254
|
-
</div>
|
|
108
|
+
<div align="center">
|
|
109
|
+
<img src="https://github.com/user-attachments/assets/abe73474-f27b-4536-b358-fedef1e461f0" alt="Chopin Ballade No.4" width="600" />
|
|
110
|
+
</div>
|
|
255
111
|
|
|
256
112
|
<br/>
|
|
257
113
|
|
|
@@ -259,6 +115,12 @@ inside the container instead.
|
|
|
259
115
|
>
|
|
260
116
|
> The harmony of polyphony — multiple voices — and homophony — a single melodic line.
|
|
261
117
|
>
|
|
262
|
-
> 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.
|
|
263
|
-
>
|
|
264
|
-
> — *agnusdei1207*
|
|
118
|
+
> 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.
|
|
119
|
+
>
|
|
120
|
+
> — *agnusdei1207*
|
|
121
|
+
|
|
122
|
+
### First principles
|
|
123
|
+
|
|
124
|
+
> Since the AI era began, I have studied many highly starred agent systems, but their machinery often obscured a clear philosophy. The ideas that actually improved performance came from observing myself and returning to computer science fundamentals—Kruskal and Prim, divide and conquer, backtracking, Monte Carlo methods, and time/space complexity. My conclusion is simple: observe yourself, master the fundamentals, and build from there.
|
|
125
|
+
|
|
126
|
+
> I use Pentesting to study CTFs and penetration testing.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pentesting",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"builderReleaseTag": "v0.
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.101.2",
|
|
4
|
+
"builderReleaseTag": "v0.101.2",
|
|
5
|
+
"description": "Penetration testing AI agent powered by Rust, with audited reverse-shell capture, verified PTY upgrades, and evidence-first orchestration.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "agnusdei1207",
|
|
8
8
|
"type": "module",
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
"hacker",
|
|
37
37
|
"ai",
|
|
38
38
|
"autonomous",
|
|
39
|
-
"
|
|
40
|
-
"anthropic",
|
|
39
|
+
"rust",
|
|
41
40
|
"tui",
|
|
42
41
|
"cli",
|
|
43
42
|
"nmap",
|