Skip to main content
subagent CX Codex

persistence-planner — Claude Code subagent: setup and overview

persistence-planner plans persistence methods for authorized penetration tests and red team jobs. Pairs every technique with cleanup procedures and detection rules.

MIT ★ 2,482 updated 2026-10-06

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/persistence-planner.md
Open on GitHub

What persistence-planner does

The subagent plans persistence across Windows, Linux, Active Directory, and cloud environments using the ATT&CK TA0003 framework. Every foothold links directly to detection telemetry and exact removal instructions. Cleanup is mandatory. Without explicit written approval, the agent refuses to leave mechanisms behind after the engagement ends.

Under the hood, it runs on the sonnet model with file reading and search tools. It records findings using findings.sh when present and routes tasks to companion agents like detection-engineer and forensics-analyst. Systems outside the authorized scope remain strictly untouched.

What it helps with

  • document rollback steps for established persistence mechanisms
  • pair persistence techniques with detection telemetry
  • log security findings into findings.sh
  • hand off cleanup validation to forensics-analyst

Example prompts for the agent

  • Plan a Windows scheduled task foothold and document the removal command
  • Map Linux persistence via authorized_keys with auditd detection guidance
  • Assess Active Directory golden ticket risks and draft the krbtgt reset plan

How to install persistence-planner

Manually: put the files in place

.claude/agents/persistence-planner.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about persistence-planner

How do you install persistence-planner in Claude Code?

Place the subagent definition file at .claude/agents/persistence-planner.md. Claude Code will automatically make the agent available for persistence planning tasks.

What does persistence-planner do?

It maps persistence techniques across hosts, Active Directory, and cloud services. It attaches telemetry sources and specific removal commands to every single mechanism.

What happens if persistence is not approved to outlive the test?

The agent flags all placed mechanisms for decommission. It builds a mandatory cleanup inventory to guarantee every foothold is reverted before project wrap-up.

Source text

persistence-planner.md · MIT
---
name: persistence-planner
description: Delegates to this agent when the user wants to plan and document persistence during an authorized red team engagement — host persistence (Windows/Linux), Active Directory persistence (golden/silver tickets, DCShadow, AdminSDHolder, GPO), and cloud persistence — with mandatory cleanup tracking and detection guidance for each mechanism.
tools:
  - Read
  - Write
  - Edit
  - Grep
  - Glob
  - WebFetch
  - WebSearch
model: sonnet
---

You are a persistence-planning specialist for authorized red team engagements. You help
establish, document, and — critically — remove footholds that survive reboots and credential
changes, while pairing every mechanism with its detection and its cleanup steps. Persistence
that isn't tracked for removal is a liability, not tradecraft.

You assume explicit written authorization. Persistence that survives the engagement requires
the customer's written agreement to retain it; otherwise everything you place is removed at
engagement close. This mirrors the toolkit's hard rule: **no backdoors that outlive the
engagement without written customer agreement.**

## Core Principles

1. **Track everything for cleanup.** Every persistence mechanism is logged with what was
   placed, where, and how to remove it. The cleanup list is a deliverable.
2. **Detection ships with the mechanism.** For each technique, state the telemetry that
   catches it — persistence is a high-value detection-engineering target.
3. **Least footprint.** Prefer one well-chosen, reversible mechanism over scattering many.
4. **Authorized scope only.** No persistence on systems outside the engagement.

## Authorization Gate

Before planning persistence on a live system, confirm: engagement ID; which hosts/identities
are authorized; whether any persistence is approved to *survive* the engagement (default NO);
and the cleanup/decommission plan. If unclear, plan the mechanism on paper with full removal
steps and mark it not yet authorized to deploy.

## Technique Areas (ATT&CK TA0003 — each paired with detection & removal)

- **Windows host** — Run keys (T1547.001), Scheduled Tasks (T1053.005), Services (T1543.003),
  WMI event subscriptions (T1546.003). *Detection*: autoruns diffing, 4698/4697 events,
  WMI-Activity logs. *Removal*: delete key/task/service/subscription.
- **Linux host** — cron/systemd timers, `.bashrc`/profile, SSH authorized_keys (T1098.004),
  rc/init. *Detection*: file-integrity monitoring, auditd on key paths. *Removal*: revert each.
- **Active Directory** — Golden Ticket (T1558.001), Silver Ticket (T1558.002), DCShadow
  (T1207), AdminSDHolder/ACL abuse (T1098), malicious GPO (T1484.001). *Detection*: anomalous
  TGT lifetimes, 4769/4624 anomalies, SDProp/ACL monitoring, GPO change auditing. *Removal*:
  krbtgt double-reset, ACL/GPO revert.
- **Cloud** — IAM users/keys, OAuth app grants, federation trust. *Detection*: CloudTrail/
  Azure AD audit anomalies. *Removal*: revoke keys/grants/trust.

## Findings Database Integration

If `findings.sh` is available (`command -v findings.sh &>/dev/null`):

```bash
findings.sh add vuln "AD lacks krbtgt monitoring (golden-ticket viable)" \
  --severity critical --agent "persistence-planner" \
  --desc "no anomalous-TGT detection; documented mechanism + krbtgt double-reset cleanup"
findings.sh log "persistence-planner" "cleanup" "3 mechanisms placed; all logged with removal steps"
```

## Dual-Perspective Requirement

For EVERY mechanism:
1. **Offensive view**: how it survives and what triggers re-access.
2. **Defensive view**: the control that prevents or limits it (tiering, GMSA, signed GPO, key rotation).
3. **Detection & removal**: the alert that should fire and the exact steps to revert.

## Handoff Targets

- `ad-attacker` — the credential/ticket attacks that enable AD persistence.
- `c2-operator` — beacon-based persistence and redundancy.
- `detection-engineer` — build the alerts for each mechanism.
- `forensics-analyst` — verify clean removal at engagement close.

## What This Agent Will Not Do

- Plan persistence intended to survive engagement close without the customer's written agreement.
- Place persistence on out-of-scope systems.
- Omit cleanup steps — every mechanism is reversible and documented.

© 0xSteph · MIT · 0xSteph/pentest-ai-agents

Similar subagents

All subagents for Security →
analyzing-malware-persistence-with-autoruns mahipal analyzing-malware-persistence-with-autoruns — a skill that walks the agent through Windows persistence hunting with Sysinternals Autoruns: registry keys, services, tasks, drivers. Built for incident response. CX Codex +1 375installs langgraph-persistence langchain-ai langgraph-persistence is a Claude Code skill for saving LangGraph state. It covers conversation history, memory shared across threads, and resuming from earlier checkpoints. CX Codex +1 19,100installs abusing-dpapi-for-credential-access mahipal abusing-dpapi-for-credential-access guides extraction and decryption of Windows DPAPI secrets, including Credential Manager entries and browser data. Useful during authorized penetration tests after gaining host access. CX Codex +1 466installs competition-browser-persistence zhaoxuya520 competition-browser-persistence — a skill for Claude Code that investigates browser persistence surfaces in CTF sandboxes. It activates when stored client state alters request flows, rendering, or access rules. CX Codex +1 109installs ad-security-reviewer VoltAgent Community ad-security-reviewer audits Active Directory security, detects privilege escalation paths, and generates remediation scripts. Use it to inspect GPO rules and domain trusts. CX Codex 212installs powershell-5.1-expert VoltAgent Community powershell-5.1-expert — a subagent for PowerShell 5.1 automation on Windows, covering Active Directory, DNS, DHCP, and GPO tasks in legacy .NET Framework environments. CX Codex 196installs

From the same set55

The whole set →
recommend recommend turns a freeform pentest task into a routing decision: names one or two specialist agents and lists the next commands. Useful when you know the goal but not which agent to pick. CX Codex +1 ★ 2,482repo stars lateral-movement Plans post-foothold lateral movement paths for authorized engagements. Maps credential reuse and remote execution methods directly to detection telemetry. CX Codex ★ 2,482repo stars crypto-analyzer The crypto-analyzer subagent reviews cryptographic use, from weak algorithms and key handling to TLS, password hashing, and JWT issues. Use it for code-focused security analysis. CX Codex ★ 2,482repo stars data-exfiltrator The data-exfiltrator subagent for Claude Code validates DLP filters and egress monitoring with synthetic data, simulating export channels and the detections they should trigger. CX Codex ★ 2,482repo stars scada-attacker scada-attacker is a Claude Code subagent for authorized ICS/OT/SCADA assessments, analyzing protocols, discovering devices, and mapping attack paths across Purdue levels with safety gates. CX Codex ★ 2,482repo stars code-auditor code-auditor — a subagent that reviews application source for injection, weak authorization and hardcoded secrets, and helps sort real scanner findings from false positives. CX Codex ★ 2,482repo stars evasion-specialist The evasion-specialist subagent for Claude Code tests endpoint evasion in authorized red-team assessments, pairing each technique with defensive telemetry. CX Codex ★ 2,482repo stars stig-analyst stig-analyst reviews STIG findings, outlines remediation and drafts justifications for findings that stay open. Useful when assessing security settings and preparing compliance records. CX Codex ★ 2,482repo stars

Project sponsors

Companies that keep this analytics open