Documentation

Everything is written to be checked against the code.

Each document below is part of the repository and reviewed with the code it describes. Where this page and the source disagree, the source wins.

Requirements

DeepSeek Harness 0.2.2-rc.3 or newer, and Node.js 22 (Node 20 works for everything except the browser drawers, which need the global WebSocket added in Node 21). Docker is optional: the Kali toolbox uses it, and without it the executor runs tools already on your PATH in a marked degraded mode. Chromium or Playwright is needed for the browser and Web-test drawers.

Install

The plugin is not published to npm. Install it from a clone or from a release tarball; the profile links the directory, so a git pull is an upgrade.

shell
$ git clone https://github.com/sm0k3net/dsh-redteam.git
$ dsh plugin --profile web add "$PWD/dsh-redteam"
$ sudo ./dsh-redteam/scripts/enable-docker-access.sh "$USER"   # optional, Docker

Refresh the Web page, open the right sidebar, press + and pick Red Team — or start an engagement with the agent and the panel opens itself once per session.

Verify: curl -s http://<host>:<port>/dsh-redteam/health should answer with the plugin version and the effective mode.

First engagement

Authorization comes first: you fill in targets, CIDRs, domains and exclusions, and accept the Rules of Engagement. Only then do gated phases unlock and the mode switch become available.

DEFAULT is the install default and runs the full PTES chain inside the accepted scope. SAFE is opt-in (defaultMode: safe) and gates exploitation-class categories behind an operator approval. Scope enforcement, operator-only RoE acceptance, the append-only audit and evidence hashing apply in both modes.

  • Ask the agent to create the engagement and record a goal or two.
  • Accept the RoE in Scope & RoE, then let the agent run recon. The drawer can also draft scope from one description with Build scope with AI; review every field before accepting.
  • Watch Flow and Activity: every fact, asset and finding is a node, and every node points at the run that produced it.
  • For passive intelligence, ask for pentest_osint_enrich against an in-scope address or domain; it reads third-party sources without touching the target. Results land in the new OSINT tab, and pentest_osint_report writes a standalone Markdown/HTML/JSON brief.
  • If recon finds a host nobody listed, the agent can propose it with pentest_scope. Inside an authorized root it is applied and audited; outside every root it waits for your approval in Scope & RoE.
  • Optional but useful on longer engagements: let the agent write a budgeted plan with pentest_plan and split the phases into role tasks with pentest_team. Both live in the Team tab, and both are advisory — the plan never widens scope, skips a gate or replaces your approval.
  • When the phases are done or explicitly skipped with a reason, close the engagement and generate the final report set.

The field manual walks the same path chapter by chapter, and the Quick Start page walks through a first session, including a local lab target.

Configuration

Defaults are conservative and nothing has to be set. The keys that matter most:

  • defaultMode — default (install default, full PTES chain) or safe (opt-in approval gate), for new engagements only.
  • allowHostFallback — run host tools when Docker is unavailable (default true).
  • hardened, capAdd, pidsLimit, memory, cpus — applied when the Kali container is created, never to an existing one.
  • browser.maxSessions, browser.idleTimeoutMs, browser.noSandbox.
  • aiEnhancement.allowRemoteContext — sends engagement context to the model only when explicitly allowed.
  • scopeAI, osintAllowlist, osint.approveLeakLookups, osint.enableOnionFetch, osint.enforceOsintScope, osint.enrichmentDelayMs — the AI scope draft, the OSINT leak/dark-web gates and the enrichment pacing/scope requirement; all default to the conservative setting.

The full table, including validation ranges and environment variables, is in CONFIGURATION.md.

Safety model

Three decisions belong to the operator and are refused for the agent: accepting the Rules of Engagement, switching the security mode, and resolving an approval. Scope is validated at the moment of action, exclusions always win, and cloud metadata endpoints are blocked even if someone adds them to scope. The agent may propose a discovered target with pentest_scope, but an expansion inside an authorized root is the only one applied automatically; anything outside waits for the operator, and the RoE acceptance is never reset.

DEFAULT is the install default and runs the full PTES chain. In optional SAFE mode, exploitation, privilege escalation, lateral movement, exfiltration and credential categories create an approval card with the exact command, target, phase, rationale and expected impact. Ignoring the card expires it after five minutes; it never defaults to approved. The bounded exploitation loop in pentest_exploitation stops on a denial and never retries around it. Neither mode disables scope checks, the audit trail or the authorisation disclaimer.

Stop ends a run immediately and keeps the record; Restart from scratch archives the old state and artifacts, keeps the scope and RoE, and starts a clean engagement. Both are operator actions and both are audited.

Read SAFETY.md before pointing this at anything.

Known behaviour

  • Per-session panel — a global page (Settings, Plugin Manager) hides the sidebar, so no tab is shown there.
  • Auto-open once — closing the panel keeps it closed until the page reloads.
  • Docker absence degrades, not breaks — recon still works with host tools; install and remove do not.
  • PDF and DOCX are built-in writers — the PDF covers headings, lists, code, simple tables, page numbers and embedded Latin/Cyrillic text; the DOCX is standards-compliant WordprocessingML with a TOC field, headers and captioned evidence images. Complex HTML is flattened by design.
  • HTML and DOCX embed evidence screenshots — screenshots are inlined as data URIs and captioned with their id, target and SHA-256; the rest of the evidence stays in the vault.
  • Live Docker test is opt-in — it creates a real container, so it is not part of CI.

Architecture

Two halves talk over one session store: a Host half that owns every side effect (store, engine, executor, browser, evidence, reports) and a client half that only renders and posts operator actions. There are no runtime dependencies — Node builtins and the DSH Host and Client APIs only.

The data model, the HTTP bridge routes and the nine security invariants are documented in ARCHITECTURE.md.

Contributing

Issues and pull requests are welcome. Start with CONTRIBUTING.md; report security problems privately per SECURITY.md. The build is one command and the suite needs no network.

develop
$ node scripts/build-client.mjs      # rebuild the client artifact
$ node --test test/*.test.mjs         # 714 cases: 712 pass, 2 env-gated, no network
$ node scripts/build-resources.mjs    # regenerate the resource catalogue