How projectdiscovery/nuclei works
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: protocols.go Protocol executors · runner.go Scan runner · engine.go Execution engine · templates.go Template library
Components 21
Scan entry
- Nuclei CLI
cmd/nuclei/main.go - Scan runner
internal/runner/runner.go
Scan preparation
- Target inputs
pkg/input/provider/interface.go - Input formats
pkg/input/formats/formats.go - Template library
pkg/templates/templates.go - Template catalog
pkg/catalog/catalog.go - Template parser
pkg/templates/parser.go - Workflow loader
pkg/loader/workflow/workflow_loader.go
Detection execution
- Execution engine
pkg/core/engine.go - Concurrent work pool
pkg/core/workpool.go - Protocol executors
pkg/protocols/protocols.go - HTTP probing
pkg/protocols/http/http.go - Other protocols
pkg/protocols/dns/dns.go - Matchers and extractors
pkg/operators/operators.go
Findings and reporting
- Scan findings
pkg/output/output.go - Report exporters
pkg/reporting/reporting.go - Issue integrations
pkg/reporting/trackers/github/github.go
Extended capabilities
- Request fuzzing
pkg/fuzz/fuzz.go - Browser scanning
pkg/protocols/headless/engine/engine.go
Other components
- CLI user
- Scan targets
Connections 21
- 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