# mauriceos/cpointed-framework architecture

> Architecture diagram of the GitHub repository mauriceos/cpointed-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mauriceos/cpointed-framework
- Repository: https://github.com/mauriceos/cpointed-framework

## Overview

#### Purpose and Entry Points
cpointed is a Python 3.10+ authorized security assessment framework for hosting control panels and WordPress. It performs discovery, CVE-labelled checks, reporting, gated validation hooks, remediation planning, and interactive triage. Console entry points are `cpointed` and `python -m cpointed`, routed through `cpointed/__main__.py` and `cpointed/cli/main.py`; the orchestration layer is `cpointed/orchestrator.py`.

#### Operator Interfaces
The CLI is the primary control plane, exposing scan, WordPress, exploit, remediation, local, and TUI workflows. Full exploit execution has a dedicated CLI path in `cpointed/cli/exploit_full.py`. The optional Textual/Rich terminal dashboard is implemented in `cpointed/tui/app.py` with vulnerability-detail navigation in `cpointed/tui/screens/vuln_detail.py`. A desktop GUI exists only as a stub at `cpointed/gui/main_window.py`.

#### Scan and Target Acquisition
Scanning accepts individual hosts, CIDR ranges, and target files, optionally performing port discovery and service fingerprinting. Core acquisition stages are separated into `cpointed/scanner/cidr.py`, `cpointed/scanner/bulk.py`, `cpointed/scanner/ports.py`, and `cpointed/scanner/fingerprint.py`. These feed normalized target/service context into the engine rather than directly coupling network discovery to individual vulnerability modules.

#### Module Execution Engine
`cpointed/core/engine.py` is the central module runner; it loads and evaluates standardized module implementations based on the shared contract in `cpointed/modules/base.py`. Modules are organized by target ecosystem: cPanel (`cpointed/modules/cpanel/`), DirectAdmin (`cpointed/modules/directadmin/`), Mailman (`cpointed/modules/mailman/`), and WordPress (`cpointed/modules/wordpress/`). WordPress execution has its own base/discovery boundary in `cpointed/modules/wordpress/base.py` and `cpointed/modules/wordpress/discovery.py`, and is included explicitly through scan options or `wp` commands.

#### Validation, Payload, and Authorization Boundary
The exploit manager selects supported validation paths from module identifiers and delegates specialized runners, notably `cpointed/exploit/manager.py` and `cpointed/exploit/runners/cpanel_41940.py`. Authorization-sensitive behavior is centralized around session and hook facilities in `cpointed/core/session.py` and `cpointed/core/payload_hooks.py`; destructive paths are intended to require explicit operator authorization, including the `CPOINTED_AUTHORIZED=1` environment gate. Payload packaging is isolated in `cpointed/payloads/bundle.py`, limiting payload concerns from scanner and reporting flows.

#### Evidence and Reporting Flow
Scan/module results become evidence records through `cpointed/reporting/evidence.py`, then are rendered to machine-readable JSON or HTML by `cpointed/reporting/json_reporter.py` and `cpointed/reporting/html_reporter.py`. The CLI can write both outputs, while the TUI consumes reporting-oriented presentation support from `cpointed/tui/reporting.py`. This keeps network checks, result representation, and output formatting distinct.

#### Post-Assessment and Local Operations
Remediation is a separate defensive workflow: `cpointed/remediation/engine.py` coordinates cleanup, patch/checklist, malware, and session-purging actions represented by `cpointed/remediation/cleaner.py` and `cpointed/remediation/patch.py`. Optional remediation helpers may use Paramiko, while local/Linus-WSL-oriented enumeration is isolated in `cpointed/local/wp_enumerator.py`. Persistence-related implementations reside under `cpointed/persistence/` and should remain tightly constrained behind authorization and explicit operator invocation.

Main entry points: [`cpointed/cli/main.py`](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/cli/main.py) (CLI control plane), [`cpointed/core/engine.py`](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/core/engine.py) (Module execution engine), [`cpointed/orchestrator.py`](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/orchestrator.py) (Workflow orchestrator), [`cpointed/exploit/manager.py`](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/exploit/manager.py) (Validation manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Operator interfaces"]
  node_entry["Console entry points<br/>Python entry<br/>[__main__.py]"]
  node_cli["CLI control plane<br/>[main.py]"]
  node_full_exploit_cli["Full exploit CLI<br/>CLI command<br/>[exploit_full.py]"]
  node_tui["Terminal dashboard<br/>Textual/Rich UI<br/>[app.py]"]
  node_gui_stub["Desktop GUI stub<br/>[main_window.py]"]
end

subgraph group_acquisition["Target acquisition"]
  node_cidr["CIDR expansion<br/>Discovery stage<br/>[cidr.py]"]
  node_bulk["Bulk target loading<br/>Discovery stage<br/>[bulk.py]"]
  node_ports["Port discovery<br/>Discovery stage<br/>[ports.py]"]
  node_fingerprint["Service fingerprinting<br/>Discovery stage<br/>[fingerprint.py]"]
end

subgraph group_execution["Assessment engine"]
  node_orchestrator{{"Workflow orchestrator<br/>Orchestration<br/>[orchestrator.py]"}}
  node_engine{{"Module execution engine<br/>Module runner<br/>[engine.py]"}}
  node_module_contract["Module contract<br/>Module API<br/>[base.py]"]
  node_ecosystem_modules["Control-panel modules<br/>Module families"]
  node_wordpress["WordPress discovery and modules<br/>WordPress subsystem<br/>[discovery.py]"]
end

subgraph group_controlled["Controlled actions"]
  node_exploit_manager["Validation manager<br/>Exploit dispatcher<br/>[manager.py]"]
  node_validation_runner["Specialized validation runner<br/>Exploit runner<br/>[cpanel_41940.py]"]
  node_authorization{{"Session and authorization hooks<br/>Safety boundary<br/>[payload_hooks.py]"}}
  node_payload_bundle["Payload bundle<br/>Payload packaging<br/>[bundle.py]"]
  node_remediation["Remediation engine<br/>Defensive workflow<br/>[engine.py]"]
  node_local_wp["Local WordPress enumeration<br/>Local workflow<br/>[wp_enumerator.py]"]
end

subgraph group_reporting["Evidence and reporting"]
  node_evidence["Evidence records<br/>Result model<br/>[evidence.py]"]
  node_renderers["JSON and HTML reports<br/>Report renderers<br/>[json_reporter.py]"]
end

node_entry -->|"routes to"| node_cli
node_cli -->|"starts workflows"| node_orchestrator
node_full_exploit_cli -->|"requests validation"| node_exploit_manager
node_cli -->|"exploit path"| node_full_exploit_cli
node_cli -->|"launches"| node_tui
node_cli -->|"invokes"| node_local_wp
node_cli -->|"invokes"| node_remediation
node_orchestrator -->|"expands ranges"| node_cidr
node_orchestrator -->|"loads target files"| node_bulk
node_cidr -->|"targets"| node_ports
node_bulk -->|"targets"| node_ports
node_ports -->|"open services"| node_fingerprint
node_fingerprint -->|"normalized context"| node_engine
node_orchestrator -->|"direct host context"| node_engine
node_engine -->|"loads via"| node_module_contract
node_module_contract -->|"implemented by"| node_ecosystem_modules
node_module_contract -->|"implemented by"| node_wordpress
node_engine -->|"assessment results"| node_evidence
node_evidence -->|"renders"| node_renderers
node_renderers -->|"presentation support"| node_tui
node_engine -.->|"eligible findings"| node_exploit_manager
node_exploit_manager -->|"delegates"| node_validation_runner
node_authorization -.->|"gates execution"| node_exploit_manager
node_payload_bundle -->|"supplies packaged payloads"| node_validation_runner
node_authorization -.->|"gates destructive actions"| node_remediation

click node_entry "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/__main__.py"
click node_cli "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/cli/main.py"
click node_full_exploit_cli "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/cli/exploit_full.py"
click node_tui "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/tui/app.py"
click node_gui_stub "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/gui/main_window.py"
click node_orchestrator "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/orchestrator.py"
click node_cidr "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/cidr.py"
click node_bulk "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/bulk.py"
click node_ports "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/ports.py"
click node_fingerprint "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/fingerprint.py"
click node_engine "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/core/engine.py"
click node_module_contract "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/modules/base.py"
click node_wordpress "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/modules/wordpress/discovery.py"
click node_evidence "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/reporting/evidence.py"
click node_renderers "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/reporting/json_reporter.py"
click node_exploit_manager "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/exploit/manager.py"
click node_validation_runner "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/exploit/runners/cpanel_41940.py"
click node_authorization "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/core/payload_hooks.py"
click node_payload_bundle "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/payloads/bundle.py"
click node_remediation "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/remediation/engine.py"
click node_local_wp "https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/local/wp_enumerator.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_entry,node_cli,node_full_exploit_cli,node_tui,node_gui_stub toneBlue
class node_cidr,node_bulk,node_ports,node_fingerprint toneAmber
class node_orchestrator,node_engine,node_module_contract,node_ecosystem_modules,node_wordpress toneMint
class node_exploit_manager,node_validation_runner,node_authorization,node_payload_bundle,node_remediation,node_local_wp toneRose
class node_evidence,node_renderers toneIndigo
```

## Components

### Operator interfaces

- [Console entry points](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/__main__.py): Python entry · `cpointed` and module invocation route into the CLI. · `cpointed/__main__.py`
- [CLI control plane](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/cli/main.py): CLI · Selects scan, WordPress, exploit, remediation, local, and TUI workflows. · `cpointed/cli/main.py`
- [Full exploit CLI](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/cli/exploit_full.py): CLI command · `cpointed/cli/exploit_full.py`
- [Terminal dashboard](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/tui/app.py): Textual/Rich UI · Provides reporting presentation and vulnerability-detail navigation. · `cpointed/tui/app.py`
- [Desktop GUI stub](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/gui/main_window.py): GUI stub · `cpointed/gui/main_window.py`

### Target acquisition

- [CIDR expansion](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/cidr.py): Discovery stage · `cpointed/scanner/cidr.py`
- [Bulk target loading](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/bulk.py): Discovery stage · `cpointed/scanner/bulk.py`
- [Port discovery](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/ports.py): Discovery stage · `cpointed/scanner/ports.py`
- [Service fingerprinting](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/scanner/fingerprint.py): Discovery stage · `cpointed/scanner/fingerprint.py`

### Assessment engine

- [Workflow orchestrator](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/orchestrator.py): Orchestration · Coordinates selected assessment workflows. · `cpointed/orchestrator.py`
- [Module execution engine](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/core/engine.py): Module runner · Loads and evaluates modules against normalized target and service context. · `cpointed/core/engine.py`
- [Module contract](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/modules/base.py): Module API · `cpointed/modules/base.py`
- **Control-panel modules**: Module families · cPanel, DirectAdmin, and Mailman checks.
- [WordPress discovery and modules](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/modules/wordpress/discovery.py): WordPress subsystem · Separate base and discovery boundary for WordPress assessment. · `cpointed/modules/wordpress/discovery.py`

### Controlled actions

Authorization-gated validation and remediation.

- [Validation manager](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/exploit/manager.py): Exploit dispatcher · Selects supported validation runners from module identifiers. · `cpointed/exploit/manager.py`
- [Specialized validation runner](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/exploit/runners/cpanel_41940.py): Exploit runner · `cpointed/exploit/runners/cpanel_41940.py`
- [Session and authorization hooks](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/core/payload_hooks.py): Safety boundary · Destructive paths require explicit authorization, including `CPOINTED_AUTHORIZED=1`. · `cpointed/core/payload_hooks.py`
- [Payload bundle](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/payloads/bundle.py): Payload packaging · `cpointed/payloads/bundle.py`
- [Remediation engine](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/remediation/engine.py): Defensive workflow · Coordinates cleanup, patch/checklist, malware, and session-purging actions. · `cpointed/remediation/engine.py`
- [Local WordPress enumeration](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/local/wp_enumerator.py): Local workflow · Linux/WSL-oriented enumeration isolated from remote scanning. · `cpointed/local/wp_enumerator.py`

### Evidence and reporting

- [Evidence records](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/reporting/evidence.py): Result model · `cpointed/reporting/evidence.py`
- [JSON and HTML reports](https://github.com/mauriceos/cpointed-framework/blob/main/cpointed/reporting/json_reporter.py): Report renderers · `cpointed/reporting/json_reporter.py`

## Connections

- Console entry points → CLI control plane: routes to
- CLI control plane → Workflow orchestrator: starts workflows
- Full exploit CLI → Validation manager: requests validation
- CLI control plane → Full exploit CLI: exploit path
- CLI control plane → Terminal dashboard: launches
- CLI control plane → Local WordPress enumeration: invokes
- CLI control plane → Remediation engine: invokes
- Workflow orchestrator → CIDR expansion: expands ranges
- Workflow orchestrator → Bulk target loading: loads target files
- CIDR expansion → Port discovery: targets
- Bulk target loading → Port discovery: targets
- Port discovery → Service fingerprinting: open services
- Service fingerprinting → Module execution engine: normalized context
- Workflow orchestrator → Module execution engine: direct host context
- Module execution engine → Module contract: loads via
- Module contract → Control-panel modules: implemented by
- Module contract → WordPress discovery and modules: implemented by
- Module execution engine → Evidence records: assessment results
- Evidence records → JSON and HTML reports: renders
- JSON and HTML reports → Terminal dashboard: presentation support
- Module execution engine → Validation manager: eligible findings
- Validation manager → Specialized validation runner: delegates
- Session and authorization hooks → Validation manager: gates execution
- Payload bundle → Specialized validation runner: supplies packaged payloads
- Session and authorization hooks → Remediation engine: gates destructive actions
