pentesting 0.92.8 → 0.100.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/ARCHITECTURE.md CHANGED
@@ -28,7 +28,8 @@ stays intentionally short and usage-focused.
28
28
  - **Intelligent Queuing** — Queued inputs are deduplicated and prioritized live;
29
29
  obsolete tasks are preempted, not FIFO-replayed.
30
30
  - **Lab Session Multiplexing** — `shell-listener` runs multiple authorized TCP
31
- sessions with per-session routing and PTY upgrades.
31
+ sessions with per-session routing, identity tags, verified PTY upgrade state,
32
+ transcripts, command ledgers, replay, and orphaned evidence recovery.
32
33
  - **Dynamic Agent Profiles** — No fixed persona: the runtime *derives* a profile
33
34
  per request from the prompt and can overlay a named autonomy profile, driving
34
35
  tool scope, phase, and memory weighting.
@@ -405,5 +406,18 @@ pentesting shell-listener --bind 127.0.0.1 --port 4444
405
406
  ```
406
407
 
407
408
  Manages multiple accepted TCP sessions with per-session routing, buffered
408
- output, raw byte logging, and PTY-upgrade helpers. Bound to loopback by default;
409
- `--allow-remote` is an explicit opt-in gate.
409
+ output, raw byte logging, full-duplex transcripts, command history, attach /
410
+ detach events, replay, and evidence manifests. `pty-upgrade` sends the helper
411
+ only; `upgrade` runs the helper plus a probe and records `pty_state` as verified
412
+ or failed. The upgrade helper is drawn from a named technique catalog
413
+ (`python3`, `python`, `python2`, `script`, `expect`) selectable per request —
414
+ there is no default, so the request is rejected unless the caller picks a
415
+ technique or supplies a full custom command, forcing the agent to recon the
416
+ target and match what it actually has instead of assuming one interpreter; a
417
+ missing tool is recorded as `pty_state=failed` with reason `<technique> helper
418
+ unavailable`. Raw logs and transcripts are capped per session and closed sessions
419
+ are archived automatically so a noisy peer cannot grow memory or disk without
420
+ bound. Secret redaction is applied before new raw/transcript/display records are
421
+ written; it is not retroactive for output that arrived before the secret value
422
+ was registered. Bound to loopback by default; `--allow-remote` is an explicit
423
+ opt-in gate.
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pentesting 🔓
2
2
 
3
- > **Pentesting** is a local-first, zero-panic Rust coding agent CLI for authorized security assessments. The runtime—not the model—owns routing, tool sandboxing, verification, and completion adjudication.
3
+ > **Pentesting** is a local-first, zero-panic Rust coding agent CLI for authorized security assessments and educational security research. The runtime—not the model—owns routing, tool sandboxing, verification, and completion adjudication.
4
4
 
5
5
  <div align="center">
6
6
  <img src="https://api.iconify.design/hugeicons:bash.svg" alt="pentesting bash icon" width="120" />
@@ -24,31 +24,44 @@ Agent-loop essentials at parity with leading coding agents, plus a security-focu
24
24
  | Permissions | Allow / Deny / Confirm, with once/always decisions persisted |
25
25
  | Context compaction | Automatic micro-pruning + model-triggered summarization, pre/post hooks |
26
26
  | Interrupt & steering | ESC to interrupt mid-turn, queue follow-ups while it works |
27
+ | 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 |
27
28
  | Subagents | Parallel delegated tasks, budget-capped, role-specific personas |
28
29
  | MCP & skills | Dynamic MCP tool discovery, layered markdown skills |
29
30
  | Memory | Ebbinghaus-style decaying notes + hybrid lexical/semantic/graph retrieval |
30
31
 
31
- **Beyond the baseline:** evidence-gated completion adjudication (Complete / Replan / Blocked), full PTY session control, and CTF-grade verification tools (flag check, best-of-N verify, findings ledger).
32
+ **Beyond the baseline:** evidence-gated completion adjudication (Complete / Replan / Blocked), a CTF-oriented reverse-shell/PTY control plane (multi-session tracking, helper-only `pty_upgrade` plus verified `upgrade`, transcript/history/replay, lifecycle/FD management), and CTF-grade verification tools (flag check, best-of-N verify, findings ledger).
32
33
 
33
34
  ---
34
35
 
35
36
  ## 🚀 Quick Start
36
37
 
38
+ Install globally, or run without installing via your package manager of choice:
39
+
37
40
  ```bash
38
- npm install -g pentesting
39
- pentesting
41
+ npm install -g pentesting && pentesting # install
42
+ npx pentesting # or run once, no install
43
+ pnpm dlx pentesting
44
+ yarn dlx pentesting
45
+ bunx pentesting
46
+ deno run npm:pentesting
40
47
  ```
41
48
 
42
- Or run it with Docker:
49
+ ### 🐳 Run with Docker
50
+
51
+ No local Rust toolchain or native binary needed — the image ships the full
52
+ runtime plus the offensive testing toolchain:
43
53
 
44
54
  ```bash
45
- docker run -it --rm -v "$(pwd):/workspace" -w /workspace agnusdei1207/pentesting:latest
55
+ docker run -it --rm \
56
+ -v "$(pwd):/workspace" -w /workspace \
57
+ -e ANTHROPIC_API_KEY \
58
+ agnusdei1207/pentesting:latest
46
59
  ```
47
60
 
48
61
  Or via Docker Compose:
49
62
 
50
63
  ```bash
51
- PENTESTING_PROJECT_DIR=/path/to/project docker compose run pentesting
64
+ PENTESTING_PROJECT_DIR=/path/to/project ANTHROPIC_API_KEY=sk-ant-... docker compose run pentesting
52
65
  ```
53
66
 
54
67
  ### Common commands
@@ -56,12 +69,34 @@ PENTESTING_PROJECT_DIR=/path/to/project docker compose run pentesting
56
69
  ```bash
57
70
  pentesting # Interactive TUI
58
71
  pentesting --prompt "Enumerate the target and summarize next actions."
59
- pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized lab listener
72
+ pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-shell listener
60
73
  pentesting --version
61
74
  ```
62
75
 
76
+ Use `shell-listener` in authorized CTF/lab work to accept multiple callbacks, label/tag sessions, probe remote identity, run sentinel-tracked commands, verify dumb-shell PTY upgrades, attach/detach without closing, and retain raw logs, transcripts, command history, replay data, and evidence manifests.
77
+
78
+ 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`.
79
+
63
80
  Inside a session, `/help` lists every command and `/update` pulls the latest release for supported native targets.
64
81
 
82
+ ### 🔌 Reverse-shell & PTY sessions
83
+
84
+ Catch and manage authorized shell callbacks like a session manager — **one listener, many targets, full audit trail, no leaked file descriptors.**
85
+
86
+ ```bash
87
+ pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
88
+ pentesting shell-session list # 2. See every live session + FD ownership
89
+ pentesting shell-session run -- id # 3. Run sentinel-bounded commands, capture output
90
+ pentesting shell-session pty-upgrade # 4. Inject the PTY helper; `upgrade` then verifies it
91
+ pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs + archive evidence
92
+ ```
93
+
94
+ - **Track** — each callback is accepted, numbered, and tagged; `list` / `info` / `fdstat` / `lifecycle` show live state, byte counts, and FD ownership.
95
+ - **Drive** — `run` wraps commands in a sentinel to capture exactly their output; `send` / `raw` / `signal` / `resize` give interactive control.
96
+ - **Upgrade** — `pty-upgrade` sends the built-in helper and `upgrade` verifies a real PTY before remote resize is allowed; the agent must pick the method with `--technique` (`python3`, `python`, `python2`, `script`, `expect` — no default) after reconning what the target actually has, or send a fully custom command instead.
97
+ - **Record** — per-session raw log, full-duplex transcript, command ledger, replay, and evidence manifest — with secret redaction for registered values.
98
+ - **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.
99
+
65
100
  ---
66
101
 
67
102
  ## ⚙️ Configuration
@@ -75,6 +110,30 @@ backend = "local" # Local md/fs runtime state
75
110
 
76
111
  Environment variables use the `PENTESTING_` prefix (`__` for nested keys, e.g. `PENTESTING_SESSION__MODEL_ID=...`). Full variable list and the legacy `BUILDER_*` aliases are documented in [`ARCHITECTURE.md`](ARCHITECTURE.md#configuration).
77
112
 
113
+ ### Example `.env` / shell setup
114
+
115
+ ```bash
116
+ # Model provider credentials — set whichever provider(s) you use
117
+ export ANTHROPIC_API_KEY="sk-ant-..."
118
+ export OPENAI_API_KEY="sk-..."
119
+ export OPENROUTER_API_KEY="sk-or-..."
120
+
121
+ # Runtime overrides (optional)
122
+ export PENTESTING_SESSION__MODEL_ID="claude-sonnet-5" # default model for new sessions
123
+ export PENTESTING_CONFIG="$HOME/.config/pentesting" # move the global config dir
124
+ export PENTESTING_SKIP_DOWNLOAD=1 # skip postinstall binary download (CI)
125
+ ```
126
+
127
+ With Docker, pass the same variables through with `-e`:
128
+
129
+ ```bash
130
+ docker run -it --rm \
131
+ -v "$(pwd):/workspace" -w /workspace \
132
+ -e ANTHROPIC_API_KEY \
133
+ -e PENTESTING_SESSION__MODEL_ID="claude-sonnet-5" \
134
+ agnusdei1207/pentesting:latest
135
+ ```
136
+
78
137
  > **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.
79
138
 
80
139
  ---
File without changes
package/lib/runtime.mjs CHANGED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.92.8",
4
- "builderReleaseTag": "v0.92.8",
3
+ "version": "0.100.0",
4
+ "builderReleaseTag": "v0.100.0",
5
5
  "description": "pentesting — security-focused agent runtime (internal engine: builder). Thin npm facade that downloads the managed Builder binary and forwards arguments.",
6
6
  "license": "MIT",
7
7
  "author": "agnusdei1207",
@@ -53,6 +53,7 @@
53
53
  "test": "node --test tests/*.test.mjs",
54
54
  "preflight:local": "bash scripts/preflight-local.sh",
55
55
  "verify": "npm run consistency && npm run test",
56
+ "check": "npm run verify",
56
57
  "pentesting:help": "bash scripts/pentesting-release-help.sh",
57
58
  "pentesting:status": "bash scripts/pentesting-release-status.sh",
58
59
  "pentesting:test": "npm run test",
@@ -70,7 +71,7 @@
70
71
  "public:sync": "bash scripts/sync-public-repo.sh",
71
72
  "public:mirror-release": "bash scripts/mirror-public-release.sh",
72
73
  "release:backfill": "bash scripts/backfill-release-local.sh",
73
- "check": "sh -c 'npm run docker:build && docker run -it --rm -v builder-workspace:/workspace -e ANTHROPIC_BASE_URL -e ANTHROPIC_AUTH_TOKEN -e ANTHROPIC_MODEL -e ANTHROPIC_API_KEY -e MINIMAX_API_KEY -e OPENAI_API_KEY -e OPENAI_BASE_URL -e GEMINI_API_KEY -e DEEPSEEK_API_KEY agnusdei1207/pentesting:latest'",
74
+ "check:docker": "sh -c 'npm run docker:build && docker run -it --rm -v builder-workspace:/workspace -e ANTHROPIC_BASE_URL -e ANTHROPIC_AUTH_TOKEN -e ANTHROPIC_MODEL -e ANTHROPIC_API_KEY -e MINIMAX_API_KEY -e OPENAI_API_KEY -e OPENAI_BASE_URL -e GEMINI_API_KEY -e DEEPSEEK_API_KEY agnusdei1207/pentesting:latest'",
74
75
  "docker:build": "(docker image inspect agnusdei1207/pentesting-build-base:1.96 >/dev/null 2>&1 && docker image inspect agnusdei1207/pentesting-runtime-base:26.04 >/dev/null 2>&1 || npm run docker:base:build) && docker build --build-arg APP_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo dev) -t agnusdei1207/pentesting:latest .",
75
76
  "docker:base:build": "docker build -t agnusdei1207/pentesting-build-base:1.96 -f docker/build-base.Dockerfile . && docker build -t agnusdei1207/pentesting-runtime-base:26.04 -f docker/runtime-base.Dockerfile .",
76
77
  "release:patch": "./scripts/release-all.sh patch",
File without changes
File without changes