/pentest:pentest-scopefrom pentest
Defines or updates pentest engagement scope, saving to disk and warning if target changes drastically during an active engagement.
Ships in pentest. Installing the plugin adds it to Claude Code.
Output the following banner verbatim:
============================================================
[SCOPE DEFINITION]
============================================================
Try to Read .pentest-scope.json.
If the file exists and is valid JSON, extract these fields and store them:
existing_target — the saved target valueexisting_engagement — the saved engagement nameexisting_out_of_scope — the saved out-of-scope valueexisting_auth — the saved auth valueexisting_timing — the saved time budget / quota (for backward compatibility: if timing is absent but a legacy window field exists, use window)existing_thoroughness — the saved thoroughness level (light, medium, deep, or full)existing_output_formats — the saved deliverable formats array (default [] if absent)existing_status — either "pending" (not yet launched) or "active" (pentest in progress)Set has_existing_scope = true.
If the file does not exist or cannot be parsed, set has_existing_scope = false.
If has_existing_scope = true, output this block with real values substituted in:
============================================================
EXISTING SCOPE FOUND
============================================================
Target: {existing_target}
Engagement: {existing_engagement}
Out-of-scope: {existing_out_of_scope}
Auth: {existing_auth}
Time budget: {existing_timing}
Thoroughness: {existing_thoroughness}
Deliverables: report.md + pentest-report.json{, plus existing_output_formats if any}
Status: {existing_status}
============================================================
Then use AskUserQuestion to ask:
"What would you like to do with the existing scope?"
Present exactly these options:
If the user selects "Cancel — keep the existing scope as-is", output:
Scope unchanged. Existing scope is still active.
Then stop — do not proceed to Step 3.
If the user selects "Update scope", continue to Step 3.
Free-text fields — ask each as a plain prompt, NOT via AskUserQuestion. Real targets are rarely localhost, so canned options don't fit — output the question and wait for the user's typed reply. Ask one at a time, in order:
new_targetnew_engagementnew_out_of_scopenew_timingnew_authThe single Time-budget question replaces the previous redundant "testing window" + "max execution time" pair — there is one time concept now: the quota.
Then use AskUserQuestion (genuine multiple choice) to ask thoroughness:
"Thoroughness — How deep should testing go? This affects which attack vectors are tested and how many payloads are attempted per category. (If it exceeds the time budget, the engagement runs breadth-first and reports the effective level.)"
Present exactly these options:
Store this answer as new_thoroughness.
Then use AskUserQuestion with multiSelect: true to ask deliverable formats:
"Deliverable formats — which report artifacts should be produced? report.md and pentest-report.json are ALWAYS produced; select any extras."
Present exactly these options (multi-select):
Store the selected labels as the new_output_formats array (empty array if none selected).
Store all answers as new_target, new_engagement, new_out_of_scope, new_auth, new_timing, new_thoroughness, new_output_formats.
This step only applies when has_existing_scope = true AND existing_status = "active".
If has_existing_scope = false OR existing_status = "pending", skip to Step 5.
Compare new_target to existing_target:
Drastic change — the primary domain or IP subnet is different. Examples:
https://example.com → https://other.com (different domain)192.168.1.0/24 → 10.0.0.0/8 (different IP range)Minor change — same primary target, different restrictions or parameters. Examples:
If the change is drastic, use AskUserQuestion to warn the operator:
"The new target ({new_target}) is significantly different from the active engagement target ({existing_target}). Changing target mid-engagement may corrupt findings. What would you like to do?"
Present exactly these options:
If "Start a new pentest — save this scope as pending":
"pending" when saving in Step 5New scope saved as pending. Run /pentest:pentest to launch a new engagement with this scope.
The active engagement ({existing_engagement}) is not affected until /pentest:pentest-exit is run.
If "Cancel — keep the existing scope unchanged":
Scope unchanged.If "Update scope anyway" OR the change is minor:
"active".Minor scope update detected — updating active engagement scope.
Write .pentest-scope.json with the following content, substituting real values. Use status "active" unless Step 4 set it to "pending":
{
"target": "{new_target}",
"engagement": "{new_engagement}",
"out_of_scope": "{new_out_of_scope}",
"auth": "{new_auth}",
"timing": "{new_timing}",
"thoroughness": "{new_thoroughness}",
"output_formats": {new_output_formats array},
"status": "pending"
}
Note: set "status" to "pending" if no pentest is currently active, or to "active" if Step 4 determined the pentest is active and the operator confirmed the update.
Output the following block with real values substituted in:
============================================================
SCOPE SAVED
============================================================
Target: {new_target}
Engagement: {new_engagement}
Out-of-scope: {new_out_of_scope}
Auth: {new_auth}
Time budget: {new_timing}
Thoroughness: {new_thoroughness}
Deliverables: report.md + pentest-report.json{, plus new_output_formats if any}
============================================================
Scope saved to .pentest-scope.json.
Next steps:
- Run /pentest:pentest to launch an engagement using this scope
- Run /pentest:pentest-scope again at any time to update the scope
- Run /pentest:pentest-exit to close an active engagement
What the command file sets; muted values are Claude Code's defaults
pentest, scope, engagement, security-testing, target-management
7-day visitors to each command page
npx claudepluginhub stickman230/claude-pentest --plugin pentest5 commands in this plugin
/pentestActivate pentest mode — displays ASCII art, configures session isolation, collects engagement scope, then OWNS the engagement: pre-flight, recon, planning (via the pentester-orchestrator planner), executor dispatch, a time-budget quota loop, aggregation, and report generation./pentest-attacksDefine the attack profile for an engagement — select which attack categories and skills to use. Saves to .pentest-attacks.json. If run before /pentest:pentest, the orchestrator will respect the selection. If run standalone, does not launch a pentest./pentest-exitClose pentest session — summarizes findings, ensures outputs are saved, lifts isolation, and prompts for /clear/pentest-kaliConnect to a Metasploit-Kali Server (MKS) REST API — verifies connectivity, discovers available Kali tools, and configures agents to prefer MKS endpoints over local Bash equivalents.Other plugins' commands for the same job