# rap1p1/c0015-conti-detection-lab architecture

> Architecture diagram of the GitHub repository rap1p1/c0015-conti-detection-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rap1p1/c0015-conti-detection-lab
- Repository: https://github.com/rap1p1/c0015-conti-detection-lab

## Overview

C0015 Detection Lab is an evidence-driven campaign simulation and detection-engineering exercise, not a general-purpose intrusion tool. Its main workflow recreates a staged campaign with benign payloads and operator-controlled beacon sessions, observes host and network telemetry, evaluates version-controlled detections, and validates findings against run artifacts and a recorded evidence ledger. The README documents the overall topology and stage handoffs; sampled code confirms C2 tasking, payload behavior, and evidence validation. Several campaign stages are documented but their implementation was not sampled, so those links rely on README statements.

Main entry points: [`scripts/c2sim.py`](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/c2sim.py) (C2 simulator), [`payloads/beacon/c0015_beacon.ps1`](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/beacon/c0015_beacon.ps1) (PowerShell beacon), [`evidence/runs`](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/evidence/runs) (Run artifacts), [`payloads/docm`](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/docm) (Macro entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_campaign["Campaign simulation"]
  node_entry["Macro entry"]
  node_hta["HTA bootstrap"]
  node_bootstrap["Bootstrap DLL"]
  node_beacon["PowerShell beacon<br/>[c0015_beacon.ps1]"]
  node_c2["C2 simulator<br/>[c2sim.py]"]
  node_operator_tasks["Operator runbook<br/>[c0015-phase2.json]"]
  node_lsass["LSASS surrogate"]
  node_pivot["WMI pivot"]
  node_later_stages["Collection and impact"]
end

subgraph group_detection["Telemetry detection"]
  node_sysmon["Windows telemetry"]
  node_queries["Detection queries"]
  node_exports["Rule exports"]
  node_elastic[("Elastic stack")]
end

subgraph group_evidence["Evidence validation"]
  node_artifacts["Run artifacts"]
  node_evidence_tools["Artifact tools<br/>[lab_tools.py]"]
  node_verifier["Run verifier"]
  node_ledger[("Evidence ledger")]
  node_reports["Reference reports"]
end

node_operator(("Lab operator"))

node_operator -->|"opens document"| node_entry
node_entry -->|"launches bootstrap"| node_hta
node_hta -->|"loads DLL"| node_bootstrap
node_bootstrap -->|"starts session"| node_beacon
node_beacon -->|"registers and checks in"| node_c2
node_operator -->|"controls sessions"| node_c2
node_operator_tasks -.->|"queues tasks"| node_c2
node_beacon -.->|"runs operator task"| node_lsass
node_operator -->|"directs pivot"| node_pivot
node_pivot -->|"starts second session"| node_c2
node_operator -->|"drives later phases"| node_later_stages
node_sysmon -->|"sends telemetry"| node_elastic
node_queries -->|"generates rules"| node_exports
node_exports -->|"imports rules"| node_elastic
node_elastic -.->|"evaluates detections"| node_queries
node_later_stages -->|"produces receipts"| node_artifacts
node_artifacts -.->|"checks artifacts"| node_evidence_tools
node_artifacts -->|"records evidence"| node_ledger
node_elastic -->|"checks run events"| node_verifier
node_verifier -->|"validates run evidence"| node_ledger
node_ledger -->|"supports findings"| node_reports

click node_entry "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/docm"
click node_hta "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/hta"
click node_bootstrap "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/dll/c0015_bootstrap_dll.c"
click node_beacon "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/beacon/c0015_beacon.ps1"
click node_c2 "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/c2sim.py"
click node_operator_tasks "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/runbooks/c0015-phase2.json"
click node_lsass "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/lsass/c0015_mimikatz_surrogate.c"
click node_pivot "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/dll/c0015_143_surrogate.c"
click node_later_stages "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/impact"
click node_sysmon "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/configs/sysmon"
click node_queries "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/detections/queries"
click node_exports "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/detections/exports"
click node_artifacts "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/evidence/runs"
click node_evidence_tools "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/lab_tools.py"
click node_verifier "https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/verify/verify_final_phases.py"
click node_ledger "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/evidence/runs"
click node_reports "https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/reports"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_hta,node_bootstrap,node_beacon,node_c2,node_operator_tasks,node_lsass,node_pivot,node_later_stages toneBlue
class node_sysmon,node_queries,node_exports,node_elastic toneAmber
class node_artifacts,node_evidence_tools,node_verifier,node_ledger,node_reports toneMint
class node_operator toneIndigo
```

## Components

### Campaign simulation

- [Macro entry](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/docm): `payloads/docm`
- [HTA bootstrap](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/hta): `payloads/hta`
- [Bootstrap DLL](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/dll/c0015_bootstrap_dll.c): `payloads/dll/c0015_bootstrap_dll.c`
- [PowerShell beacon](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/beacon/c0015_beacon.ps1): `payloads/beacon/c0015_beacon.ps1`
- [C2 simulator](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/c2sim.py): `scripts/c2sim.py`
- [Operator runbook](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/runbooks/c0015-phase2.json): `scripts/runbooks/c0015-phase2.json`
- [LSASS surrogate](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/lsass/c0015_mimikatz_surrogate.c): `payloads/lsass/c0015_mimikatz_surrogate.c`
- [WMI pivot](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/payloads/dll/c0015_143_surrogate.c): `payloads/dll/c0015_143_surrogate.c`
- [Collection and impact](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/payloads/impact): `payloads/impact`

### Telemetry detection

- [Windows telemetry](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/configs/sysmon): `configs/sysmon`
- [Detection queries](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/detections/queries): `detections/queries`
- [Rule exports](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/detections/exports): `detections/exports`
- **Elastic stack**

### Evidence validation

- [Run artifacts](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/evidence/runs): `evidence/runs`
- [Artifact tools](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/lab_tools.py): `scripts/lab_tools.py`
- [Run verifier](https://github.com/rap1p1/c0015-conti-detection-lab/blob/main/scripts/verify/verify_final_phases.py): `scripts/verify/verify_final_phases.py`
- [Evidence ledger](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/evidence/runs): `evidence/runs`
- [Reference reports](https://github.com/rap1p1/c0015-conti-detection-lab/tree/main/reports): `reports`

### Other components

- **Lab operator**

## Connections

- Lab operator → Macro entry: opens document (evidence: `README.md`)
- Macro entry → HTA bootstrap: launches bootstrap (evidence: `README.md`)
- HTA bootstrap → Bootstrap DLL: loads DLL (evidence: `README.md`)
- Bootstrap DLL → PowerShell beacon: starts session (evidence: `payloads/dll/c0015_bootstrap_dll.c`)
- PowerShell beacon → C2 simulator: registers and checks in (evidence: `README.md`)
- Lab operator → C2 simulator: controls sessions (evidence: `README.md`)
- Operator runbook → C2 simulator: queues tasks
- PowerShell beacon → LSASS surrogate: runs operator task
- Lab operator → WMI pivot: directs pivot (evidence: `README.md`)
- WMI pivot → C2 simulator: starts second session (evidence: `payloads/dll/c0015_143_surrogate.c`)
- Lab operator → Collection and impact: drives later phases (evidence: `README.md`)
- Windows telemetry → Elastic stack: sends telemetry (evidence: `README.md`)
- Detection queries → Rule exports: generates rules (evidence: `README.md`)
- Rule exports → Elastic stack: imports rules (evidence: `README.md`)
- Elastic stack → Detection queries: evaluates detections
- Collection and impact → Run artifacts: produces receipts (evidence: `README.md`)
- Run artifacts → Artifact tools: checks artifacts
- Run artifacts → Evidence ledger: records evidence (evidence: `README.md`)
- Elastic stack → Run verifier: checks run events (evidence: `scripts/verify/verify_final_phases.py`)
- Run verifier → Evidence ledger: validates run evidence (evidence: `scripts/verify/verify_final_phases.py`)
- Evidence ledger → Reference reports: supports findings (evidence: `README.md`)
