# projectdiscovery/nuclei architecture

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

- Interactive diagram: https://gitdiagram.com/projectdiscovery/nuclei
- Repository: https://github.com/projectdiscovery/nuclei

## Overview

Nuclei is a CLI-driven, template-based vulnerability scanner. A scan accepts targets and YAML templates, prepares them for execution, sends protocol-specific probes, evaluates responses, and emits findings. The graph also preserves documented input-format, workflow, fuzzing, browser, and reporting capabilities. Core execution and browser construction are supported by sampled source; several subsystem connections reflect the README’s product description and paths in the tree, not inspected call sites.

Main entry points: [`pkg/protocols/protocols.go`](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/protocols.go) (Protocol executors), [`internal/runner/runner.go`](https://github.com/projectdiscovery/nuclei/blob/dev/internal/runner/runner.go) (Scan runner), [`pkg/core/engine.go`](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/core/engine.go) (Execution engine), [`pkg/templates/templates.go`](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/templates/templates.go) (Template library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Scan entry"]
  node_cli["Nuclei CLI<br/>[main.go]"]
  node_runner["Scan runner<br/>[runner.go]"]
end

subgraph group_prepare["Scan preparation"]
  node_targets["Target inputs<br/>[interface.go]"]
  node_formats["Input formats<br/>[formats.go]"]
  node_templates["Template library<br/>[templates.go]"]
  node_catalog[("Template catalog<br/>[catalog.go]")]
  node_parser["Template parser<br/>[parser.go]"]
  node_workflows["Workflow loader<br/>[workflow_loader.go]"]
end

subgraph group_execute["Detection execution"]
  node_engine["Execution engine<br/>[engine.go]"]
  node_pool["Concurrent work pool<br/>[workpool.go]"]
  node_protocols["Protocol executors<br/>[protocols.go]"]
  node_http["HTTP probing<br/>[http.go]"]
  node_otherprotocols["Other protocols<br/>[dns.go]"]
  node_operators["Matchers and extractors<br/>[operators.go]"]
end

subgraph group_results["Findings and reporting"]
  node_results["Scan findings<br/>[output.go]"]
  node_reporting["Report exporters<br/>[reporting.go]"]
  node_integrations["Issue integrations<br/>[github.go]"]
end

subgraph group_extensions["Extended capabilities"]
  node_fuzz["Request fuzzing<br/>[fuzz.go]"]
  node_headless["Browser scanning<br/>[engine.go]"]
end

node_user(("CLI user"))
node_targetnetwork(("Scan targets"))

node_user -->|"starts scan"| node_cli
node_cli -->|"runs enumeration"| node_runner
node_runner -->|"loads targets"| node_targets
node_runner -->|"selects templates"| node_catalog
node_formats -->|"parses inputs"| node_targets
node_catalog -->|"provides templates"| node_templates
node_templates -->|"parsed by"| node_parser
node_workflows -->|"loads workflows"| node_templates
node_runner -->|"starts execution"| node_engine
node_engine -->|"dispatches work"| node_pool
node_engine -->|"executes templates"| node_protocols
node_protocols -->|"supports HTTP"| node_http
node_protocols -->|"supports protocols"| node_otherprotocols
node_http -->|"sends probes"| node_targetnetwork
node_otherprotocols -->|"sends probes"| node_targetnetwork
node_protocols -->|"evaluates responses"| node_operators
node_protocols -->|"supports fuzzing"| node_fuzz
node_protocols -->|"supports browser scans"| node_headless
node_engine -->|"emits findings"| node_results
node_results -->|"formats findings"| node_reporting
node_reporting -.->|"dispatches findings"| node_integrations

click node_cli "https://github.com/projectdiscovery/nuclei/blob/dev/cmd/nuclei/main.go"
click node_runner "https://github.com/projectdiscovery/nuclei/blob/dev/internal/runner/runner.go"
click node_targets "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/input/provider/interface.go"
click node_formats "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/input/formats/formats.go"
click node_templates "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/templates/templates.go"
click node_catalog "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/catalog/catalog.go"
click node_parser "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/templates/parser.go"
click node_workflows "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/loader/workflow/workflow_loader.go"
click node_engine "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/core/engine.go"
click node_pool "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/core/workpool.go"
click node_protocols "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/protocols.go"
click node_http "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/http/http.go"
click node_otherprotocols "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/dns/dns.go"
click node_operators "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/operators/operators.go"
click node_fuzz "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/fuzz/fuzz.go"
click node_headless "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/headless/engine/engine.go"
click node_results "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/output/output.go"
click node_reporting "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/reporting/reporting.go"
click node_integrations "https://github.com/projectdiscovery/nuclei/blob/dev/pkg/reporting/trackers/github/github.go"

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_runner,node_user toneBlue
class node_targets,node_formats,node_templates,node_catalog,node_parser,node_workflows toneAmber
class node_engine,node_pool,node_protocols,node_http,node_otherprotocols,node_operators toneMint
class node_results,node_reporting,node_integrations toneRose
class node_fuzz,node_headless,node_targetnetwork toneIndigo
```

## Components

### Scan entry

- [Nuclei CLI](https://github.com/projectdiscovery/nuclei/blob/dev/cmd/nuclei/main.go): `cmd/nuclei/main.go`
- [Scan runner](https://github.com/projectdiscovery/nuclei/blob/dev/internal/runner/runner.go): `internal/runner/runner.go`

### Scan preparation

- [Target inputs](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/input/provider/interface.go): `pkg/input/provider/interface.go`
- [Input formats](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/input/formats/formats.go): `pkg/input/formats/formats.go`
- [Template library](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/templates/templates.go): `pkg/templates/templates.go`
- [Template catalog](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/catalog/catalog.go): `pkg/catalog/catalog.go`
- [Template parser](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/templates/parser.go): `pkg/templates/parser.go`
- [Workflow loader](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/loader/workflow/workflow_loader.go): `pkg/loader/workflow/workflow_loader.go`

### Detection execution

- [Execution engine](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/core/engine.go): `pkg/core/engine.go`
- [Concurrent work pool](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/core/workpool.go): `pkg/core/workpool.go`
- [Protocol executors](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/protocols.go): `pkg/protocols/protocols.go`
- [HTTP probing](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/http/http.go): `pkg/protocols/http/http.go`
- [Other protocols](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/dns/dns.go): `pkg/protocols/dns/dns.go`
- [Matchers and extractors](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/operators/operators.go): `pkg/operators/operators.go`

### Findings and reporting

- [Scan findings](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/output/output.go): `pkg/output/output.go`
- [Report exporters](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/reporting/reporting.go): `pkg/reporting/reporting.go`
- [Issue integrations](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/reporting/trackers/github/github.go): `pkg/reporting/trackers/github/github.go`

### Extended capabilities

- [Request fuzzing](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/fuzz/fuzz.go): `pkg/fuzz/fuzz.go`
- [Browser scanning](https://github.com/projectdiscovery/nuclei/blob/dev/pkg/protocols/headless/engine/engine.go): `pkg/protocols/headless/engine/engine.go`

### Other components

- **CLI user**
- **Scan targets**

## Connections

- CLI user → Nuclei CLI: starts scan
- Nuclei CLI → Scan runner: runs enumeration
- Scan runner → Target inputs: loads targets
- Scan runner → Template catalog: selects templates
- Input formats → Target inputs: parses inputs
- Template catalog → Template library: provides templates
- Template library → Template parser: parsed by
- Workflow loader → Template library: loads workflows
- Scan runner → Execution engine: starts execution
- Execution engine → Concurrent work pool: dispatches work
- Execution engine → Protocol executors: executes templates
- Protocol executors → HTTP probing: supports HTTP
- Protocol executors → Other protocols: supports protocols
- HTTP probing → Scan targets: sends probes
- Other protocols → Scan targets: sends probes
- Protocol executors → Matchers and extractors: evaluates responses
- Protocol executors → Request fuzzing: supports fuzzing
- Protocol executors → Browser scanning: supports browser scans
- Execution engine → Scan findings: emits findings
- Scan findings → Report exporters: formats findings
- Report exporters → Issue integrations: dispatches findings
