pentesting 0.92.8 → 0.100.1

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,8 @@
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 Rust coding agent CLI for authorized security work, with an audited reverse-shell control plane: catch callbacks, verify PTY upgrades, pivot across sessions, and reclaim them cleanly.
4
+
5
+ The runtime—not the model—owns routing, tool sandboxing, verification, completion adjudication, and PTY/session lifecycle management.
4
6
 
5
7
  <div align="center">
6
8
  <img src="https://api.iconify.design/hugeicons:bash.svg" alt="pentesting bash icon" width="120" />
@@ -24,31 +26,44 @@ Agent-loop essentials at parity with leading coding agents, plus a security-focu
24
26
  | Permissions | Allow / Deny / Confirm, with once/always decisions persisted |
25
27
  | Context compaction | Automatic micro-pruning + model-triggered summarization, pre/post hooks |
26
28
  | Interrupt & steering | ESC to interrupt mid-turn, queue follow-ups while it works |
29
+ | 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
30
  | Subagents | Parallel delegated tasks, budget-capped, role-specific personas |
28
31
  | MCP & skills | Dynamic MCP tool discovery, layered markdown skills |
29
32
  | Memory | Ebbinghaus-style decaying notes + hybrid lexical/semantic/graph retrieval |
30
33
 
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).
34
+ **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
35
 
33
36
  ---
34
37
 
35
38
  ## 🚀 Quick Start
36
39
 
40
+ Install globally, or run without installing via your package manager of choice:
41
+
37
42
  ```bash
38
- npm install -g pentesting
39
- pentesting
43
+ npm install -g pentesting && pentesting # install
44
+ npx pentesting # or run once, no install
45
+ pnpm dlx pentesting
46
+ yarn dlx pentesting
47
+ bunx pentesting
48
+ deno run npm:pentesting
40
49
  ```
41
50
 
42
- Or run it with Docker:
51
+ ### 🐳 Run with Docker
52
+
53
+ No local Rust toolchain or native binary needed — the image ships the full
54
+ runtime plus the offensive testing toolchain:
43
55
 
44
56
  ```bash
45
- docker run -it --rm -v "$(pwd):/workspace" -w /workspace agnusdei1207/pentesting:latest
57
+ docker run -it --rm \
58
+ -v "$(pwd):/workspace" -w /workspace \
59
+ -e ANTHROPIC_API_KEY \
60
+ agnusdei1207/pentesting:latest
46
61
  ```
47
62
 
48
63
  Or via Docker Compose:
49
64
 
50
65
  ```bash
51
- PENTESTING_PROJECT_DIR=/path/to/project docker compose run pentesting
66
+ PENTESTING_PROJECT_DIR=/path/to/project ANTHROPIC_API_KEY=sk-ant-... docker compose run pentesting
52
67
  ```
53
68
 
54
69
  ### Common commands
@@ -56,12 +71,34 @@ PENTESTING_PROJECT_DIR=/path/to/project docker compose run pentesting
56
71
  ```bash
57
72
  pentesting # Interactive TUI
58
73
  pentesting --prompt "Enumerate the target and summarize next actions."
59
- pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized lab listener
74
+ pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-shell listener
60
75
  pentesting --version
61
76
  ```
62
77
 
78
+ 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.
79
+
80
+ 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`.
81
+
63
82
  Inside a session, `/help` lists every command and `/update` pulls the latest release for supported native targets.
64
83
 
84
+ ### 🔌 Reverse-shell & PTY sessions
85
+
86
+ Catch and manage authorized shell callbacks like a session manager — **one listener, many targets, full audit trail, no leaked file descriptors.**
87
+
88
+ ```bash
89
+ pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
90
+ pentesting shell-session list # 2. See every live session + FD ownership
91
+ pentesting shell-session run -- id # 3. Run sentinel-bounded commands, capture output
92
+ pentesting shell-session pty-upgrade # 4. Inject the PTY helper; `upgrade` then verifies it
93
+ pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs + archive evidence
94
+ ```
95
+
96
+ - **Track** — each callback is accepted, numbered, and tagged; `list` / `info` / `fdstat` / `lifecycle` show live state, byte counts, and FD ownership.
97
+ - **Drive** — `run` wraps commands in a sentinel to capture exactly their output; `send` / `raw` / `signal` / `resize` give interactive control.
98
+ - **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.
99
+ - **Record** — per-session raw log, full-duplex transcript, command ledger, replay, and evidence manifest — with secret redaction for registered values.
100
+ - **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.
101
+
65
102
  ---
66
103
 
67
104
  ## ⚙️ Configuration
@@ -75,6 +112,30 @@ backend = "local" # Local md/fs runtime state
75
112
 
76
113
  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
114
 
115
+ ### Example `.env` / shell setup
116
+
117
+ ```bash
118
+ # Model provider credentials — set whichever provider(s) you use
119
+ export ANTHROPIC_API_KEY="sk-ant-..."
120
+ export OPENAI_API_KEY="sk-..."
121
+ export OPENROUTER_API_KEY="sk-or-..."
122
+
123
+ # Runtime overrides (optional)
124
+ export PENTESTING_SESSION__MODEL_ID="claude-sonnet-5" # default model for new sessions
125
+ export PENTESTING_CONFIG="$HOME/.config/pentesting" # move the global config dir
126
+ export PENTESTING_SKIP_DOWNLOAD=1 # skip postinstall binary download (CI)
127
+ ```
128
+
129
+ With Docker, pass the same variables through with `-e`:
130
+
131
+ ```bash
132
+ docker run -it --rm \
133
+ -v "$(pwd):/workspace" -w /workspace \
134
+ -e ANTHROPIC_API_KEY \
135
+ -e PENTESTING_SESSION__MODEL_ID="claude-sonnet-5" \
136
+ agnusdei1207/pentesting:latest
137
+ ```
138
+
78
139
  > **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
140
 
80
141
  ---
File without changes
package/lib/runtime.mjs CHANGED
File without changes
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.92.8",
4
- "builderReleaseTag": "v0.92.8",
5
- "description": "pentesting — security-focused agent runtime (internal engine: builder). Thin npm facade that downloads the managed Builder binary and forwards arguments.",
3
+ "version": "0.100.1",
4
+ "builderReleaseTag": "v0.100.0",
5
+ "description": "pentesting — coding agent runtime with audited reverse-shell session control, verified PTY upgrades, pivot workflows, and managed Builder delivery.",
6
6
  "license": "MIT",
7
7
  "author": "agnusdei1207",
8
8
  "type": "module",
@@ -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