# k33p5/ctf-workstation architecture

> Architecture diagram of the GitHub repository k33p5/ctf-workstation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/k33p5/ctf-workstation
- Repository: https://github.com/k33p5/ctf-workstation

## Overview

CTF Workstation is a local, thinker-led challenge-solving rig: a reasoning operator triages a challenge, delegates tool-driven or model-assisted work, then verifies any proposed flag against observed command output. It spans category presets, interactive ReAct execution, model fan-out, specialized crypto and hash-cracking helpers, and wildcard routing. README and sampled source support the major components and their documented roles; some detailed wiring and category-specific implementations were not sampled, so uncertain links are omitted.

Main entry points: [`src/toolpool.py`](https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py) (Parallel toolpool), [`src/executor.py`](https://github.com/k33p5/ctf-workstation/blob/main/src/executor.py) (ReAct executor), [`src/harness.py`](https://github.com/k33p5/ctf-workstation/blob/main/src/harness.py) (LLM harness), [`src/fanout.py`](https://github.com/k33p5/ctf-workstation/blob/main/src/fanout.py) (Model fanout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Solve orchestration"]
  node_toolpool["Parallel toolpool<br/>[toolpool.py]"]
  node_executor["ReAct executor<br/>[executor.py]"]
  node_harness["LLM harness<br/>[harness.py]"]
  node_fanout["Model fanout<br/>[fanout.py]"]
  node_guard["Flag guard<br/>[executor.py]"]
end

subgraph group_analysis["Challenge analysis"]
  node_triage["File triage<br/>[toolpool.py]"]
  node_category["Category presets<br/>[toolpool.py]"]
  node_wildcard["Wildcard router<br/>[wildcard.sh]"]
  node_hostattack["Host and attack<br/>[host_attack.sh]"]
end

subgraph group_specialists["Specialist tools"]
  node_lattice["Lattice helpers<br/>[cryptolll.py]"]
  node_hashcat["GPU hashcat<br/>[hcat.py]"]
end

subgraph group_integrations["Runtime integrations"]
  node_shell["Shell runtime"]
  node_models["Model providers"]
end

node_thinker(("Thinker"))
node_challenge["Challenge input"]
node_flag["Verified flag"]
node_gpu["GPU hashcat runtime"]

node_thinker -->|"triages"| node_challenge
node_thinker -->|"delegates scans"| node_toolpool
node_thinker -->|"delegates tasks"| node_executor
node_thinker -->|"requests answers"| node_harness
node_thinker -->|"requests votes"| node_fanout
node_thinker -.->|"uses helpers"| node_lattice
node_thinker -.->|"cracks hashes"| node_hashcat
node_thinker -.->|"starts attack"| node_hostattack
node_thinker -->|"submits verified"| node_flag
node_toolpool -->|"runs preset"| node_triage
node_toolpool -->|"runs preset"| node_category
node_toolpool -->|"dispatches"| node_wildcard
node_toolpool -->|"runs commands"| node_shell
node_executor -->|"requests completion"| node_harness
node_executor -->|"runs commands"| node_shell
node_executor -->|"checks final"| node_guard
node_guard -->|"accepts grounded"| node_flag
node_fanout -->|"calls per model"| node_harness
node_harness -->|"sends prompts"| node_models
node_hostattack -->|"hosts and attacks"| node_shell
node_lattice -.->|"runs Sage bridge"| node_shell
node_hashcat -->|"invokes"| node_gpu

click node_toolpool "https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py"
click node_executor "https://github.com/k33p5/ctf-workstation/blob/main/src/executor.py"
click node_harness "https://github.com/k33p5/ctf-workstation/blob/main/src/harness.py"
click node_fanout "https://github.com/k33p5/ctf-workstation/blob/main/src/fanout.py"
click node_guard "https://github.com/k33p5/ctf-workstation/blob/main/src/executor.py"
click node_triage "https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py"
click node_category "https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py"
click node_wildcard "https://github.com/k33p5/ctf-workstation/blob/main/tools/wildcard.sh"
click node_hostattack "https://github.com/k33p5/ctf-workstation/blob/main/tools/host_attack.sh"
click node_lattice "https://github.com/k33p5/ctf-workstation/blob/main/tools/cryptolll.py"
click node_hashcat "https://github.com/k33p5/ctf-workstation/blob/main/src/hcat.py"

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_toolpool,node_executor,node_harness,node_fanout,node_guard toneBlue
class node_triage,node_category,node_wildcard,node_hostattack toneAmber
class node_lattice,node_hashcat toneMint
class node_shell,node_models toneRose
class node_thinker,node_challenge,node_flag,node_gpu toneIndigo
```

## Components

### Solve orchestration

- [Parallel toolpool](https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py): `src/toolpool.py`
- [ReAct executor](https://github.com/k33p5/ctf-workstation/blob/main/src/executor.py): `src/executor.py`
- [LLM harness](https://github.com/k33p5/ctf-workstation/blob/main/src/harness.py): `src/harness.py`
- [Model fanout](https://github.com/k33p5/ctf-workstation/blob/main/src/fanout.py): `src/fanout.py`
- [Flag guard](https://github.com/k33p5/ctf-workstation/blob/main/src/executor.py): `src/executor.py`

### Challenge analysis

- [File triage](https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py): `src/toolpool.py`
- [Category presets](https://github.com/k33p5/ctf-workstation/blob/main/src/toolpool.py): `src/toolpool.py`
- [Wildcard router](https://github.com/k33p5/ctf-workstation/blob/main/tools/wildcard.sh): `tools/wildcard.sh`
- [Host and attack](https://github.com/k33p5/ctf-workstation/blob/main/tools/host_attack.sh): `tools/host_attack.sh`

### Specialist tools

- [Lattice helpers](https://github.com/k33p5/ctf-workstation/blob/main/tools/cryptolll.py): `tools/cryptolll.py`
- [GPU hashcat](https://github.com/k33p5/ctf-workstation/blob/main/src/hcat.py): `src/hcat.py`

### Runtime integrations

- **Shell runtime**
- **Model providers**

### Other components

- **Thinker**
- **Challenge input**
- **Verified flag**
- **GPU hashcat runtime**

## Connections

- Thinker → Challenge input: triages
- Thinker → Parallel toolpool: delegates scans
- Thinker → ReAct executor: delegates tasks
- Thinker → LLM harness: requests answers
- Thinker → Model fanout: requests votes
- Thinker → Lattice helpers: uses helpers
- Thinker → GPU hashcat: cracks hashes
- Thinker → Host and attack: starts attack
- Thinker → Verified flag: submits verified
- Parallel toolpool → File triage: runs preset
- Parallel toolpool → Category presets: runs preset
- Parallel toolpool → Wildcard router: dispatches
- Parallel toolpool → Shell runtime: runs commands
- ReAct executor → LLM harness: requests completion
- ReAct executor → Shell runtime: runs commands
- ReAct executor → Flag guard: checks final
- Flag guard → Verified flag: accepts grounded
- Model fanout → LLM harness: calls per model
- LLM harness → Model providers: sends prompts
- Host and attack → Shell runtime: hosts and attacks
- Lattice helpers → Shell runtime: runs Sage bridge
- GPU hashcat → GPU hashcat runtime: invokes
