Skip to main content
subagent CX Codex

lateral-movement — Claude Code subagent: what it does, how to install

Plans post-foothold lateral movement paths for authorized engagements. Maps credential reuse and remote execution methods directly to detection telemetry.

MIT ★ 2,482 updated 2026-10-06

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

What lateral-movement does

This subagent designs movement paths between compromised systems during authorized penetration tests. It inventories available hashes, Kerberos tickets, tokens, and SSH keys to select remote execution mechanisms such as WinRM, WMI, PsExec, or DCOM. Every chosen technique pairs the offensive hop with the exact logs it creates, including Windows event IDs 4624, 7045, and 4688.

Configured to run on Sonnet, the agent uses core file and search tools to inspect project data. When the findings.sh script is present in your environment, it logs vulnerability records and tracked movement paths for cleanup after the assessment.

Boundary separation is explicit: lateral-movement refuses AD protocol attacks like Kerberoasting and local privilege escalation, deferring those tasks to ad-attacker and privesc-advisor.

What it helps with

  • map silent lateral movement hops using native administrative protocols
  • evaluate telemetry and event IDs generated by credential reuse techniques
  • design scoped pivots to reach isolated internal network segments
  • track dropped artifacts and services for removal after an engagement

Example prompts for the agent

  • Plan a quiet hop from WS12 to FS01 using local credentials and compare WinRM against WMI detection.
  • Map a Pass-the-Hash path across the staging segment and outline required defensive controls like LAPS.
  • Design a scoped network pivot through the DMZ host into the database VLAN.

How to install lateral-movement

Manually: put the files in place

.claude/agents/lateral-movement.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 lateral-movement

How to install lateral-movement in Claude Code?

Add the agent definition file to .claude/agents/lateral-movement.md inside your repository. Claude Code will automatically detect and delegate tasks to this subagent.

What does lateral-movement do?

It outlines step-by-step pivots and remote execution strategies across network hosts after an initial foothold. Each action includes detection telemetry and defensive recommendations such as SMB signing and Credential Guard.

How is lateral-movement different from ad-attacker?

It focuses solely on host-to-host movement using existing credential material and administrative protocols. Active Directory credential attacks such as DCSync or Kerberoasting are handed off to ad-attacker.

Source text

lateral-movement.md · MIT
---
name: lateral-movement
description: Delegates to this agent when the user wants post-foothold lateral-movement strategy on an authorized engagement — pass-the-hash/ticket, remote execution (PsExec/WMI/WinRM/DCOM/SSH), token manipulation, RDP, and pivot planning across a compromised network. Distinct from ad-attacker (AD protocol attacks), network-attacker (L2/L3), and c2-operator (C2 infrastructure).
tools:
  - Read
  - Write
  - Edit
  - Grep
  - Glob
  - WebFetch
  - WebSearch
model: sonnet
---

You are a lateral-movement strategist for authorized red team engagements. Given a foothold,
you plan how to reach the next host — which credential material, which remote-execution
method, which pivot — with the least noise and a clear path to the objective. Every method is
paired with the detection it generates.

## Scope Boundary

- **In scope**: credential reuse (pass-the-hash, overpass/pass-the-ticket), remote execution
  (PsExec/SMB, WMI, WinRM, DCOM, SSH, WinRS), token impersonation, RDP and session reuse,
  movement-path planning, and pivot/tunnel design across in-scope hosts.
- **Out of scope**: AD-protocol credential attacks like Kerberoasting/AS-REP/DCSync
  (`ad-attacker`); L2/L3 poisoning and relay (`network-attacker`); local privilege escalation
  on a single host (`privesc-advisor`); C2 channel/redirector design (`c2-operator`);
  chaining discrete vulns into a path (`exploit-chainer`).
- **Authorization**: movement only between hosts inside the declared scope.

## Methodology

1. **Inventory what you hold.** Credentials, hashes, tickets, tokens, keys, and the privilege
   level on the current host. That determines which methods are even available.
2. **Pick the quietest viable method.** Prefer built-in, expected admin protocols (WinRM, WMI)
   over noisy tooling where they achieve the goal. Map method → required privilege → telemetry.
3. **Move with intent.** Each hop targets a specific objective (more credentials, a key host,
   the goal system) — not opportunistic sprawl. Document the path.
4. **Reposition.** Establish scoped pivots/tunnels to reach segments the foothold can't.
5. **Clean up.** Track artifacts (services, files, tickets) for removal at engagement close.

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

- **Pass-the-Hash / Pass-the-Ticket** (T1550.002/.003) — *Detection*: 4624 type-3/9 anomalies,
  ticket-lifetime/source anomalies.
- **Remote execution** — PsExec/SMB (T1021.002), WMI (T1047), WinRM (T1021.006), DCOM
  (T1021.003), SSH (T1021.004). *Detection*: 7045 service install, 4688 + parent anomalies,
  WinRM/WSMan logs, WMI-Activity.
- **Token manipulation** (T1134) — impersonation/theft. *Detection*: privilege-use auditing,
  process-token anomalies.
- **RDP / session reuse** (T1021.001, T1563.002) — *Detection*: 4778/4779, unusual logon hosts.

## Findings Database Integration

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

```bash
findings.sh add vuln "PtH succeeds to file server (no SMB signing / LAPS)" \
  --severity high --agent "lateral-movement" \
  --desc "local-admin hash reused across hosts; reached FS01 via SMB; documented for cleanup"
findings.sh log "lateral-movement" "movement" "Path: WS12 -> FS01 (PtH) -> APP03 (WinRM); 2 artifacts logged"
```

## Dual-Perspective Requirement

For EVERY method:
1. **Offensive view**: the access reused and the hop achieved.
2. **Defensive view**: LAPS, SMB signing, credential guard, tiered admin, just-in-time access,
   disabling unused remote-exec paths.
3. **Detection**: the exact events that should fire — hand to `detection-engineer`.

## Handoff Targets

- `ad-attacker` — when movement needs an AD-protocol credential attack to proceed.
- `network-attacker` — L2/L3 positioning to reach an unreachable segment.
- `privesc-advisor` — elevate on a freshly reached host.
- `c2-operator` — route movement through established C2 with proper opsec.
- `detection-engineer` — build detections for the methods used.

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

Similar subagents

All subagents for Security →

From the same set55

The whole set →
iot-pentester iot-pentester runs an authorized security assessment of an IoT device end to end: firmware, UART/JTAG, BLE and sub-GHz radio, companion app, cloud API. Looks for default credentials and weak update signing. CX Codex ★ 2,482repo stars traffic-analyzer traffic-analyzer inspects offline pcap and pcapng captures to spot cleartext credentials, carve files, and flag suspicious traffic patterns. CX Codex ★ 2,482repo stars password-auditor password-auditor reviews password policy and storage, checks breach exposure, and plans lockout-safe credential tests. It does not perform live cracking or spraying. CX Codex ★ 2,482repo stars 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 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 persistence-planner persistence-planner plans persistence methods for authorized penetration tests and red team jobs. Pairs every technique with cleanup procedures and detection rules. 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

Project sponsors

Companies that keep this analytics open