# nemsensei/nopainnoscan architecture

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

- Interactive diagram: https://gitdiagram.com/nemsensei/nopainnoscan
- Repository: https://github.com/nemsensei/nopainnoscan

## Overview

NoPainNoScan is an Active Directory internal-pentest toolkit: discovery produces host and port inventories, service-specific checks produce structured findings, and a standalone generator aggregates outputs into HTML. Its optional local FastAPI UI manages campaigns and runs, launches the same scripts, parses results, streams progress, and exports reports. The README documents the CLI workflow; sampled UI modules show key API-to-service relationships. Some internal orchestration is only indicated by source references, so uncertain links are omitted or marked dashed.

Main entry points: [`ad_recon_userless.py`](https://github.com/nemsensei/nopainnoscan/blob/main/ad_recon_userless.py) (Host inventory), [`check_dc.py`](https://github.com/nemsensei/nopainnoscan/blob/main/check_dc.py) (Domain controller audit), [`npns_common.py`](https://github.com/nemsensei/nopainnoscan/blob/main/npns_common.py) (Shared scan helpers), [`webui/app/main.py`](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_recon["Network discovery"]
  node_discovery["Network discovery"]
  node_inventory["Host inventory"]
end

subgraph group_checks["Service checks"]
  node_dc["Domain controller audit<br/>[check_dc.py]"]
  node_ldap["LDAP audit<br/>[check_ldap.py]"]
  node_smb["SMB audit<br/>[check_smb.py]"]
  node_dns["DNS audit<br/>[check_dns.py]"]
  node_ftp["FTP audit<br/>[check_ftp.py]"]
  node_http["HTTP audit<br/>[check_http.py]"]
  node_ipmi["IPMI audit<br/>[check_ipmi.py]"]
  node_kerberos["Kerberos audit<br/>[check_kerberos.py]"]
  node_mssql["MSSQL audit<br/>[check_mssql.py]"]
  node_rdp["RDP audit<br/>[check_rdp.py]"]
  node_snmp["SNMP audit<br/>[check_snmp.py]"]
  node_ssh["SSH audit<br/>[check_ssh.py]"]
  node_winrm["WinRM audit<br/>[check_winrm.py]"]
end

subgraph group_reporting["Reporting"]
  node_report_generator["HTML report generator<br/>[generate_report.py]"]
end

subgraph group_web["Web interface"]
  node_web_app["FastAPI application<br/>[main.py]"]
  node_config["UI configuration<br/>[config.py]"]
  node_registry["Check registry<br/>[registry.py]"]
  node_scan_routes["Scan API<br/>[routes.py]"]
  node_jobs["Run job manager<br/>[jobs.py]"]
  node_runner["Script runner<br/>[runner.py]"]
  node_campaign_store[("Campaign and run store<br/>[store.py]")]
  node_parser_routes["Results API<br/>[routes.py]"]
  node_outputs["Output parser<br/>[outputs.py]"]
  node_report_routes["Report API<br/>[routes.py]"]
  node_export["Web report exporter<br/>[export.py]"]
end

subgraph group_runtime["Shared runtime"]
  node_common["Shared scan helpers<br/>[npns_common.py]"]
  node_progress["Progress emitter<br/>[_npns_progress.py]"]
end

node_operator(("Pentest operator"))
node_web_operator(("Browser user"))

node_operator -->|"starts discovery"| node_discovery
node_discovery -->|"writes inventory"| node_inventory
node_operator -->|"runs checks"| node_dc
node_operator -->|"runs checks"| node_ldap
node_operator -->|"runs checks"| node_smb
node_operator -->|"runs checks"| node_dns
node_operator -->|"runs checks"| node_ftp
node_operator -->|"runs checks"| node_http
node_operator -->|"runs checks"| node_ipmi
node_operator -->|"runs checks"| node_kerberos
node_operator -->|"runs checks"| node_mssql
node_operator -->|"runs checks"| node_rdp
node_operator -->|"runs checks"| node_snmp
node_operator -->|"runs checks"| node_ssh
node_operator -->|"runs checks"| node_winrm
node_inventory -->|"supplies targets"| node_dc
node_inventory -->|"supplies targets"| node_ldap
node_inventory -->|"supplies targets"| node_smb
node_inventory -->|"supplies targets"| node_dns
node_inventory -->|"supplies targets"| node_ftp
node_inventory -->|"supplies targets"| node_http
node_inventory -->|"supplies targets"| node_ipmi
node_inventory -->|"supplies targets"| node_kerberos
node_inventory -->|"supplies targets"| node_mssql
node_inventory -->|"supplies targets"| node_rdp
node_inventory -->|"supplies targets"| node_snmp
node_inventory -->|"supplies targets"| node_ssh
node_inventory -->|"supplies targets"| node_winrm
node_operator -->|"requests report"| node_report_generator
node_dc -->|"provides outputs"| node_report_generator
node_ldap -->|"provides outputs"| node_report_generator
node_smb -->|"provides outputs"| node_report_generator
node_common -->|"imports emitter"| node_progress
node_dc -->|"uses helpers"| node_common
node_ldap -->|"uses helpers"| node_common
node_smb -->|"uses helpers"| node_common
node_discovery -->|"uses helpers"| node_common
node_web_operator -->|"uses interface"| node_web_app
node_web_app -->|"registers routes"| node_scan_routes
node_web_app -->|"registers routes"| node_report_routes
node_web_app -->|"loads settings"| node_config
node_scan_routes -->|"starts and tracks"| node_jobs
node_scan_routes -->|"manages records"| node_campaign_store
node_jobs -->|"executes commands"| node_runner
node_jobs -->|"persists runs"| node_campaign_store
node_runner -->|"builds from definitions"| node_registry
node_runner -.->|"launches scripts"| node_discovery
node_runner -.->|"launches scripts"| node_dc

click node_discovery "https://github.com/nemsensei/nopainnoscan/blob/main/ad_recon_userless.py"
click node_inventory "https://github.com/nemsensei/nopainnoscan/blob/main/ad_recon_userless.py"
click node_dc "https://github.com/nemsensei/nopainnoscan/blob/main/check_dc.py"
click node_ldap "https://github.com/nemsensei/nopainnoscan/blob/main/check_ldap.py"
click node_smb "https://github.com/nemsensei/nopainnoscan/blob/main/check_smb.py"
click node_dns "https://github.com/nemsensei/nopainnoscan/blob/main/check_dns.py"
click node_ftp "https://github.com/nemsensei/nopainnoscan/blob/main/check_ftp.py"
click node_http "https://github.com/nemsensei/nopainnoscan/blob/main/check_http.py"
click node_ipmi "https://github.com/nemsensei/nopainnoscan/blob/main/check_ipmi.py"
click node_kerberos "https://github.com/nemsensei/nopainnoscan/blob/main/check_kerberos.py"
click node_mssql "https://github.com/nemsensei/nopainnoscan/blob/main/check_mssql.py"
click node_rdp "https://github.com/nemsensei/nopainnoscan/blob/main/check_rdp.py"
click node_snmp "https://github.com/nemsensei/nopainnoscan/blob/main/check_snmp.py"
click node_ssh "https://github.com/nemsensei/nopainnoscan/blob/main/check_ssh.py"
click node_winrm "https://github.com/nemsensei/nopainnoscan/blob/main/check_winrm.py"
click node_report_generator "https://github.com/nemsensei/nopainnoscan/blob/main/generate_report.py"
click node_common "https://github.com/nemsensei/nopainnoscan/blob/main/npns_common.py"
click node_progress "https://github.com/nemsensei/nopainnoscan/blob/main/_npns_progress.py"
click node_web_app "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/main.py"
click node_config "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/config.py"
click node_registry "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/registry.py"
click node_scan_routes "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/routes.py"
click node_jobs "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/jobs.py"
click node_runner "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/runner.py"
click node_campaign_store "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/campaigns/store.py"
click node_parser_routes "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/parsers/routes.py"
click node_outputs "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/parsers/outputs.py"
click node_report_routes "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/reports/routes.py"
click node_export "https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/reports/export.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_discovery,node_inventory,node_web_operator toneBlue
class node_dc,node_ldap,node_smb,node_dns,node_ftp,node_http,node_ipmi,node_kerberos,node_mssql,node_rdp,node_snmp,node_ssh,node_winrm toneAmber
class node_report_generator toneMint
class node_web_app,node_config,node_registry,node_scan_routes,node_jobs,node_runner,node_campaign_store,node_parser_routes,node_outputs,node_report_routes,node_export toneRose
class node_common,node_progress,node_operator toneIndigo
```

## Components

### Network discovery

- [Network discovery](https://github.com/nemsensei/nopainnoscan/blob/main/ad_recon_userless.py): `ad_recon_userless.py`
- [Host inventory](https://github.com/nemsensei/nopainnoscan/blob/main/ad_recon_userless.py): `ad_recon_userless.py`

### Service checks

- [Domain controller audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_dc.py): `check_dc.py`
- [LDAP audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_ldap.py): `check_ldap.py`
- [SMB audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_smb.py): `check_smb.py`
- [DNS audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_dns.py): `check_dns.py`
- [FTP audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_ftp.py): `check_ftp.py`
- [HTTP audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_http.py): `check_http.py`
- [IPMI audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_ipmi.py): `check_ipmi.py`
- [Kerberos audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_kerberos.py): `check_kerberos.py`
- [MSSQL audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_mssql.py): `check_mssql.py`
- [RDP audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_rdp.py): `check_rdp.py`
- [SNMP audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_snmp.py): `check_snmp.py`
- [SSH audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_ssh.py): `check_ssh.py`
- [WinRM audit](https://github.com/nemsensei/nopainnoscan/blob/main/check_winrm.py): `check_winrm.py`

### Reporting

- [HTML report generator](https://github.com/nemsensei/nopainnoscan/blob/main/generate_report.py): `generate_report.py`

### Web interface

- [FastAPI application](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/main.py): `webui/app/main.py`
- [UI configuration](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/config.py): `webui/app/config.py`
- [Check registry](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/registry.py): `webui/app/scanner/registry.py`
- [Scan API](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/routes.py): `webui/app/scanner/routes.py`
- [Run job manager](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/jobs.py): `webui/app/scanner/jobs.py`
- [Script runner](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/scanner/runner.py): `webui/app/scanner/runner.py`
- [Campaign and run store](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/campaigns/store.py): `webui/app/campaigns/store.py`
- [Results API](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/parsers/routes.py): `webui/app/parsers/routes.py`
- [Output parser](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/parsers/outputs.py): `webui/app/parsers/outputs.py`
- [Report API](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/reports/routes.py): `webui/app/reports/routes.py`
- [Web report exporter](https://github.com/nemsensei/nopainnoscan/blob/main/webui/app/reports/export.py): `webui/app/reports/export.py`

### Shared runtime

- [Shared scan helpers](https://github.com/nemsensei/nopainnoscan/blob/main/npns_common.py): `npns_common.py`
- [Progress emitter](https://github.com/nemsensei/nopainnoscan/blob/main/_npns_progress.py): `_npns_progress.py`

### Other components

- **Pentest operator**
- **Browser user**

## Connections

- Pentest operator → Network discovery: starts discovery (evidence: `README.md`)
- Network discovery → Host inventory: writes inventory (evidence: `README.md`)
- Pentest operator → Domain controller audit: runs checks (evidence: `README.md`)
- Pentest operator → LDAP audit: runs checks (evidence: `README.md`)
- Pentest operator → SMB audit: runs checks (evidence: `README.md`)
- Pentest operator → DNS audit: runs checks (evidence: `README.md`)
- Pentest operator → FTP audit: runs checks (evidence: `README.md`)
- Pentest operator → HTTP audit: runs checks (evidence: `README.md`)
- Pentest operator → IPMI audit: runs checks (evidence: `README.md`)
- Pentest operator → Kerberos audit: runs checks (evidence: `README.md`)
- Pentest operator → MSSQL audit: runs checks (evidence: `README.md`)
- Pentest operator → RDP audit: runs checks (evidence: `README.md`)
- Pentest operator → SNMP audit: runs checks (evidence: `README.md`)
- Pentest operator → SSH audit: runs checks (evidence: `README.md`)
- Pentest operator → WinRM audit: runs checks (evidence: `README.md`)
- Host inventory → Domain controller audit: supplies targets (evidence: `README.md`)
- Host inventory → LDAP audit: supplies targets (evidence: `README.md`)
- Host inventory → SMB audit: supplies targets (evidence: `README.md`)
- Host inventory → DNS audit: supplies targets (evidence: `README.md`)
- Host inventory → FTP audit: supplies targets (evidence: `README.md`)
- Host inventory → HTTP audit: supplies targets (evidence: `README.md`)
- Host inventory → IPMI audit: supplies targets (evidence: `README.md`)
- Host inventory → Kerberos audit: supplies targets (evidence: `README.md`)
- Host inventory → MSSQL audit: supplies targets (evidence: `README.md`)
- Host inventory → RDP audit: supplies targets (evidence: `README.md`)
- Host inventory → SNMP audit: supplies targets (evidence: `README.md`)
- Host inventory → SSH audit: supplies targets (evidence: `README.md`)
- Host inventory → WinRM audit: supplies targets (evidence: `README.md`)
- Pentest operator → HTML report generator: requests report (evidence: `README.md`)
- Domain controller audit → HTML report generator: provides outputs (evidence: `README.md`)
- LDAP audit → HTML report generator: provides outputs (evidence: `README.md`)
- SMB audit → HTML report generator: provides outputs (evidence: `README.md`)
- Shared scan helpers → Progress emitter: imports emitter (evidence: `npns_common.py`)
- Domain controller audit → Shared scan helpers: uses helpers (evidence: `check_dc.py`)
- LDAP audit → Shared scan helpers: uses helpers (evidence: `check_ldap.py`)
- SMB audit → Shared scan helpers: uses helpers (evidence: `check_smb.py`)
- Network discovery → Shared scan helpers: uses helpers (evidence: `ad_recon_userless.py`)
- Browser user → FastAPI application: uses interface (evidence: `README.md`)
- FastAPI application → Scan API: registers routes (evidence: `webui/app/main.py`)
- FastAPI application → Report API: registers routes (evidence: `webui/app/main.py`)
- FastAPI application → UI configuration: loads settings (evidence: `webui/app/main.py`)
- Scan API → Run job manager: starts and tracks (evidence: `webui/app/scanner/routes.py`)
- Scan API → Campaign and run store: manages records (evidence: `webui/app/scanner/routes.py`)
- Run job manager → Script runner: executes commands (evidence: `webui/app/scanner/jobs.py`)
- Run job manager → Campaign and run store: persists runs (evidence: `webui/app/scanner/jobs.py`)
- Script runner → Check registry: builds from definitions (evidence: `webui/app/scanner/runner.py`)
- Script runner → Network discovery: launches scripts
- Script runner → Domain controller audit: launches scripts
