What are Nuclei templates?
A Nuclei template is a structured YAML file that describes:- What to check: Target systems, endpoints, or services
- How to check: HTTP requests, DNS queries, TCP connections, etc.
- What to match: Response patterns indicating vulnerabilities
- What to extract: Useful information from responses
Why write templates?
Share discoveries
Contribute templates to help the security community detect vulnerabilities across all environments
Automate detection
Convert manual security testing into automated, repeatable checks
Zero false positives
Write precise detection logic that simulates real-world exploitation conditions
Protocol flexibility
Support for HTTP, DNS, TCP, SSL, WebSocket, WHOIS, JavaScript, and more
Template anatomy
Every Nuclei template consists of three main sections:1. Identification
2. Metadata
3. Protocol requests
Simple example
Here’s a complete template that detects exposed Git configuration files:Template execution flow
Template types
Nuclei supports various template types:Single protocol templates
Single protocol templates
Use a single protocol (HTTP, DNS, etc.) to perform checks. Most common template type.
Multi-protocol templates
Multi-protocol templates
Combine multiple protocols in a single template for complex detection scenarios.
Workflow templates
Workflow templates
Chain multiple templates together with conditional logic for multi-step attacks.
Self-contained templates
Self-contained templates
Include complete URLs without requiring external input, useful for specific targets.
Template capabilities
Dynamic values
Templates support dynamic value generation:- Variables: Define reusable values with DSL functions
- Payloads: Iterate over lists of values for fuzzing
- Helper functions: Use built-in functions for encoding, hashing, etc.
- Extractors: Capture data from responses for use in subsequent requests
Advanced features
- Multi-step requests: Chain requests with data passing
- Conditional logic: Control execution based on previous results
- Race conditions: Test for timing vulnerabilities
- Fuzzing: Automated parameter injection
Getting help
Template examples
Browse thousands of community templates
Discord community
Get help from template authors
Template validator
Use
nuclei -validate to check your templatesTemplate editor
VS Code extensions available for syntax highlighting
Next steps
Syntax overview
Learn YAML structure and conventions
Write your first template
Step-by-step tutorial
Protocol types
Explore available protocols