How capture0x/adstrike works
1. What this repository is
AdStrike is a terminal-driven Active Directory attack framework, not a single-purpose tool. Its architecture is organized around a shared interactive session, a large menu of attack/utility modules, and an output/reporting pipeline that preserves evidence and operator state across actions.
2. Top-level control plane
main.py is the primary application entry point, with run.sh used as the launcher and install.sh handling local environment setup. The CLI supports running the full menu, individual modules, health checks, and loading a saved session, which makes the framework usable both interactively and in scripted workflows.
3. Shared session and configuration boundary
config/settings.py plus the session manager behavior described in the README form the central state layer. This is where target identity, credentials, Kerberos settings, operator context, and engagement metadata are stored and reused by modules instead of being re-entered. .env and output/session.json are the key configuration/state artifacts.
4. Module system as the main functional surface
The modules/ directory is the core of the product. Each file is a domain-specific capability area, and the menu is grouped into phases: reconnaissance, initial access, enumeration, privilege escalation, lateral movement, credential access, persistence, cloud/hybrid, advanced operations, and utilities. For architecture diagrams, this is the largest subsystem and should be shown as a fan-out from the CLI into many specialized modules.
5. Attack workflows and domain boundaries
The modules are intentionally separated by tradecraft boundary: AD enumeration, Kerberos operations, certificate abuse, ACL abuse, DCSync/DCShadow, coercion, GPO, RBCD, trust attacks, cloud identity attacks, and local privilege escalation. These modules are not independent apps; they share the same session context and typically hand off evidence or credentials to later stages.
6. Kerberos-aware execution path
Kerberos is a first-class cross-cutting subsystem. modules/kerberos_manager.py, the Kerberos-focused attack modules, and the output/runtime files under output/agent_runtime/ support TGT/PTT, ccache management, krb5.conf generation, and workflows for NTLM-disabled environments. This is a distinct data-flow boundary because many later modules depend on Kerberos state created earlier.
7. Agent and AI-assisted orchestration
modules/agent/ plus modules/red_team_agent.py implement the optional AI-assisted orchestration layer. The agent can run in planning or automated modes and has backend support for local Ollama or Claude. This subsystem sits beside the manual module menu rather than replacing it, and it consumes the same session data and findings to decide next actions.
8. Analysis, parsing, and report generation
modules/analyst.py, modules/loot_parser.py, and modules/reporting.py form the evidence-processing pipeline. Raw tool output and loot are normalized, deduplicated, and scored, then exported into HTML, Markdown, and JSON reports. In a diagram, this is the downstream sink for data produced by enumeration and exploitation modules.
9. Wrappers around external tooling
The framework is largely an orchestration layer over established AD tooling such as Impacket, NetExec, BloodHound, Certipy, Kerbrute, Rubeus, PowerView, and related utilities. The tools/bin/ directory contains bundled helper scripts like PetitPotam.py, dnstool.py, gMSADumper.py, and printerbug.py, which are treated as executable dependencies for specific modules.
10. Operational helpers and tooling validation
modules/c2_integration.py, modules/bloodhound_helper.py, modules/netexec_suite.py, modules/powerview_enum.py, and similar helpers provide curated access to common workflows rather than raw primitives. The Tool Checker utility and scripts/repair_tools.sh form a maintenance boundary that validates imports, checks installed binaries, and repairs missing external dependencies.
11. Persistence of artifacts and outputs
Runtime data is written under output/, with separate buckets for session state, enumeration artifacts, BloodHound collections, agent logs, runtime Kerberos artifacts, audits, and reports. This clear output partitioning matters architecturally because it shows where evidence accumulates and which files become inputs to later modules or reporting.
12. Knowledge base and technique mapping
The ActiveDirectory-SAST/ folder contains YAML and JSON technique definitions plus a skills knowledge base. This looks like the repository’s internal domain knowledge layer, likely used to map AD behaviors and attack primitives to named techniques for analysis, scoring, or assistant guidance.
13. Documentation and operator guidance
docs/ADSTRIKE_AND_AGENT_GUIDE.md and the README provide the operator-facing workflow model, while SECURITY.md and the license define boundaries for use. For an architecture diagram, these are supporting edges around the system rather than runtime components, but they clarify that the tool is intended for authorized offensive/security testing.
14. Overall data flow
The dominant flow is: launcher/CLI → session setup/config discovery → module execution against live AD targets and local helper tools → artifact collection in output/ → analysis/reporting → optional AI-assisted planning or further module chaining. The important architectural feature is that state persists across all stages, so the framework behaves like a coordinated engagement workspace rather than isolated commands.
Main entry points: main.py CLI · analyst.py Analyst · bin Bundled tools · red_team_agent.py Red team agent
Components 23
Core runtime
Entry points, shared settings, and session control.
Module surface
Primary AD tradecraft and workflow modules.
- Discovery · Core AD enumeration and reconnaissance workflow.
modules/enum_ad.py - Initial access · Entry and credential-oriented access paths.
modules/initial_access.py - Kerberos mgr · Kerberos ticket, ccache, and config management.
modules/kerberos_manager.py - Kerberos ops · Kerberos-focused attack workflows and abuse paths.
modules/kerberos_attacks.py - Trust attacks · Cross-domain trust abuse and escalation paths.
modules/trust_attacks.py - Lateral movement · Remote execution and movement across hosts.
modules/lateral_movement.py - Credential dump · Secrets and credential access workflows.
modules/credential_dump.py - Persistence · Domain persistence and long-lived access.
modules/persistence.py - Local privesc · Host-level privilege escalation techniques.
modules/local_privesc.py - Red team agent · Operator-facing AI-assisted workflow controller.
modules/red_team_agent.py
Analysis pipeline
Loot parsing, analysis, and reporting.
- Analyst · Normalization, scoring, and findings analysis.
modules/analyst.py - Loot parser · Parses raw output and loot into structured evidence.
modules/loot_parser.py - Reporting · Generates HTML, Markdown, and JSON reports.
modules/reporting.py
Artifacts
Saved outputs and runtime state.
- Session state · Persistent engagement state restored across runs.
- Reports · Exported engagement reports.
reports
Knowledge base
Technique mappings and operator guidance.
- Technique KB · YAML and JSON technique mappings for AD tradecraft.
ActiveDirectory-SAST - Operator guide · Workflow and usage guidance for operators.
docs/ADSTRIKE_AND_AGENT_GUIDE.md
Bundled tools
Helper scripts and maintenance utilities.
- Bundled tools · Executable dependencies and helper scripts.
tools/bin - Tool repair · Validates and repairs external tooling dependencies.
scripts/repair_tools.sh
Connections 27
- Launcher → CLI: launches · Starts the main CLI application.
- Installer → CLI: prepares · Sets up the local environment for execution.
- CLI → Settings: loads · Reads shared configuration and defaults.
- CLI → Session state: restores · Loads a saved engagement session when present.
- CLI → Discovery: dispatches · Routes interactive or scripted execution to modules.
- CLI → Initial access: dispatches · Routes interactive or scripted execution to modules.
- CLI → Kerberos ops: dispatches · Routes interactive or scripted execution to modules.
- CLI → Lateral movement: dispatches · Routes interactive or scripted execution to modules.
- CLI → Persistence: dispatches · Routes interactive or scripted execution to modules.
- CLI → Red team agent: optional path · Can hand control to the AI-assisted orchestration layer.
- Settings → Kerberos mgr: configures · Supplies target and Kerberos-related settings.
- Discovery → Loot parser: emits evidence · Produces raw findings and command output for parsing.
- Initial access → Bundled tools: uses · Wraps bundled external helper tools.
- Kerberos ops → Kerberos mgr: depends on · Relies on ticket and cache management.
- Kerberos mgr → Session state: persists · Stores reusable Kerberos and operator state.
- Trust attacks → Bundled tools: uses · Leverages bundled tooling for trust workflows.
- Credential dump → Reports: stores · Writes collected secrets and artifacts for later review.
- Persistence → Reports: stores · Writes persistence-related artifacts and evidence.
- Local privesc → Bundled tools: uses · May invoke bundled helper tools and scripts.
- Red team agent → Settings: consumes · Uses shared session and operator context.
- Red team agent → Analyst: consumes · Uses findings and history to suggest next actions.
- Loot parser → Analyst: feeds · Parsed artifacts become structured analysis input.
- Analyst → Reporting: publishes · Produces scored findings for report generation.
- Reporting → Reports: writes · Exports HTML, Markdown, and JSON reports.
- Technique KB → Analyst: informs · Technique mappings support analysis and scoring.
- Operator guide → CLI: documents · Explains workflow and operational usage.
- Tool repair → Bundled tools: repairs · Validates and repairs external dependencies.