# guelfoweb/knockpy architecture

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

- Interactive diagram: https://gitdiagram.com/guelfoweb/knockpy
- Repository: https://github.com/guelfoweb/knockpy

## Overview

KnockPy discovers subdomains through passive reconnaissance, bruteforce, or both, then checks discovered hosts and presents or saves scan findings. The CLI orchestrates scans and separate setup, status, and report workflows; the Python API exposes the same engine. Reports can be managed in SQLite and exported as interactive HTML, while server-version assessment and release-update checks provide supporting capabilities. Relationships among sampled modules are cited where visible; some engine internals are only partially excerpted, so their detailed sequencing is not inferred.

Main entry points: [`knockpy/cli.py`](https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli.py) (CLI orchestration), [`knockpy/engine/runtime.py`](https://github.com/guelfoweb/knockpy/blob/master/knockpy/engine/runtime.py) (Scan engine), [`knockpy/storage.py`](https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage.py) (Storage facade), [`knockpy/storage_parts/export.py`](https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/export.py) (Export orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and workflows"]
  node_cli["CLI orchestration<br/>[cli.py]"]
  node_scanflow["Scan helpers<br/>[scan_flow.py]"]
  node_setup["Setup workflow<br/>[setup.py]"]
  node_status["Status display<br/>[status.py]"]
  node_reportui["Report workflow<br/>[report.py]"]
  node_output["Terminal output<br/>[output.py]"]
end

subgraph group_scan["Discovery and checks"]
  node_core["Core facade<br/>[core.py]"]
  node_runtime["Scan engine<br/>[runtime.py]"]
  node_wordlist["Bruteforce wordlist<br/>[wordlist.txt]"]
  node_dns{{"DNS resolver"}}
  node_reconservices{{"Recon services"}}
  node_hostchecks["Host checks<br/>[runtime.py]"]
end

subgraph group_reports["Reports and persistence"]
  node_storage["Storage facade<br/>[storage.py]"]
  node_database[("SQLite reports and settings<br/>[db.py]")]
  node_export["Export orchestration<br/>[export.py]"]
  node_html["HTML report renderer<br/>[html_report.py]"]
end

subgraph group_support["Supporting capabilities"]
  node_versions[("Server version catalog<br/>[server_versions.py]")]
  node_release["Release update check<br/>[version.py]"]
end

node_user(("Operator"))
node_pypi{{"PyPI"}}

node_user -->|"invokes"| node_cli
node_cli -->|"dispatches scans"| node_core
node_cli -->|"uses scan helpers"| node_scanflow
node_cli -->|"dispatches setup"| node_setup
node_cli -->|"dispatches status"| node_status
node_cli -->|"dispatches reports"| node_reportui
node_core -->|"re-exports engine"| node_runtime
node_runtime -.->|"reads words"| node_wordlist
node_runtime -.->|"resolves names"| node_dns
node_runtime -.->|"queries sources"| node_reconservices
node_runtime -.->|"checks hosts"| node_hostchecks
node_runtime -->|"uses catalog"| node_versions
node_cli -->|"renders results"| node_output
node_setup -->|"reads and saves settings"| node_storage
node_reportui -->|"manages reports"| node_storage
node_reportui -->|"requests export"| node_export
node_storage -->|"delegates persistence"| node_database
node_storage -->|"delegates export"| node_export
node_export -->|"renders HTML"| node_html
node_export -->|"assesses banners"| node_versions
node_cli -->|"checks updates"| node_release
node_release -->|"fetches release data"| node_pypi

click node_cli "https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli.py"
click node_scanflow "https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/scan_flow.py"
click node_setup "https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/setup.py"
click node_status "https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/status.py"
click node_reportui "https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/report.py"
click node_core "https://github.com/guelfoweb/knockpy/blob/master/knockpy/core.py"
click node_runtime "https://github.com/guelfoweb/knockpy/blob/master/knockpy/engine/runtime.py"
click node_wordlist "https://github.com/guelfoweb/knockpy/blob/master/knockpy/wordlist/wordlist.txt"
click node_hostchecks "https://github.com/guelfoweb/knockpy/blob/master/knockpy/engine/runtime.py"
click node_output "https://github.com/guelfoweb/knockpy/blob/master/knockpy/output.py"
click node_storage "https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage.py"
click node_database "https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/db.py"
click node_export "https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/export.py"
click node_html "https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/html_report.py"
click node_versions "https://github.com/guelfoweb/knockpy/blob/master/knockpy/server_versions.py"
click node_release "https://github.com/guelfoweb/knockpy/blob/master/knockpy/version.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_cli,node_scanflow,node_setup,node_status,node_reportui,node_output toneBlue
class node_core,node_runtime,node_wordlist,node_dns,node_reconservices,node_hostchecks toneAmber
class node_storage,node_database,node_export,node_html toneMint
class node_versions,node_release toneRose
class node_user,node_pypi toneIndigo
```

## Components

### Entry and workflows

- [CLI orchestration](https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli.py): `knockpy/cli.py`
- [Scan helpers](https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/scan_flow.py): `knockpy/cli_parts/scan_flow.py`
- [Setup workflow](https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/setup.py): `knockpy/cli_parts/setup.py`
- [Status display](https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/status.py): `knockpy/cli_parts/status.py`
- [Report workflow](https://github.com/guelfoweb/knockpy/blob/master/knockpy/cli_parts/report.py): `knockpy/cli_parts/report.py`
- [Terminal output](https://github.com/guelfoweb/knockpy/blob/master/knockpy/output.py): `knockpy/output.py`

### Discovery and checks

- [Core facade](https://github.com/guelfoweb/knockpy/blob/master/knockpy/core.py): `knockpy/core.py`
- [Scan engine](https://github.com/guelfoweb/knockpy/blob/master/knockpy/engine/runtime.py): `knockpy/engine/runtime.py`
- [Bruteforce wordlist](https://github.com/guelfoweb/knockpy/blob/master/knockpy/wordlist/wordlist.txt): `knockpy/wordlist/wordlist.txt`
- **DNS resolver**
- **Recon services**
- [Host checks](https://github.com/guelfoweb/knockpy/blob/master/knockpy/engine/runtime.py): `knockpy/engine/runtime.py`

### Reports and persistence

- [Storage facade](https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage.py): `knockpy/storage.py`
- [SQLite reports and settings](https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/db.py): `knockpy/storage_parts/db.py`
- [Export orchestration](https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/export.py): `knockpy/storage_parts/export.py`
- [HTML report renderer](https://github.com/guelfoweb/knockpy/blob/master/knockpy/storage_parts/html_report.py): `knockpy/storage_parts/html_report.py`

### Supporting capabilities

- [Server version catalog](https://github.com/guelfoweb/knockpy/blob/master/knockpy/server_versions.py): `knockpy/server_versions.py`
- [Release update check](https://github.com/guelfoweb/knockpy/blob/master/knockpy/version.py): `knockpy/version.py`

### Other components

- **Operator**
- **PyPI**

## Connections

- Operator → CLI orchestration: invokes (evidence: `README.md`)
- CLI orchestration → Core facade: dispatches scans (evidence: `knockpy/cli.py`)
- CLI orchestration → Scan helpers: uses scan helpers (evidence: `knockpy/cli.py`)
- CLI orchestration → Setup workflow: dispatches setup (evidence: `knockpy/cli.py`)
- CLI orchestration → Status display: dispatches status (evidence: `knockpy/cli.py`)
- CLI orchestration → Report workflow: dispatches reports (evidence: `knockpy/cli.py`)
- Core facade → Scan engine: re-exports engine (evidence: `knockpy/core.py`)
- Scan engine → Bruteforce wordlist: reads words
- Scan engine → DNS resolver: resolves names
- Scan engine → Recon services: queries sources
- Scan engine → Host checks: checks hosts (evidence: `knockpy/engine/runtime.py`)
- Scan engine → Server version catalog: uses catalog (evidence: `knockpy/engine/runtime.py`)
- CLI orchestration → Terminal output: renders results (evidence: `knockpy/cli.py`)
- Setup workflow → Storage facade: reads and saves settings (evidence: `knockpy/cli_parts/setup.py`)
- Report workflow → Storage facade: manages reports (evidence: `knockpy/cli_parts/report.py`)
- Report workflow → Export orchestration: requests export (evidence: `knockpy/cli_parts/report.py`)
- Storage facade → SQLite reports and settings: delegates persistence (evidence: `knockpy/storage.py`)
- Storage facade → Export orchestration: delegates export (evidence: `knockpy/storage.py`)
- Export orchestration → HTML report renderer: renders HTML (evidence: `knockpy/storage_parts/export.py`)
- Export orchestration → Server version catalog: assesses banners (evidence: `knockpy/storage_parts/export.py`)
- CLI orchestration → Release update check: checks updates (evidence: `knockpy/cli.py`)
- Release update check → PyPI: fetches release data (evidence: `knockpy/version.py`)
