Basic Usage #
Scanning a Single Target #
bash Copy
nuclei -u https://example.com
nuclei -u https://example.com -v
nuclei -u https://example.com -debug
Scanning Multiple Targets #
bash Copy
nuclei -u https://example.com,https://test.com
nuclei -l urls.txt
cat urls.txt| nuclei
Template Selection #
bash Copy
nuclei -u https://example.com -t cves/2021/CVE-2021-44228.yaml
nuclei -u https://example.com -t cves/2021/CVE-2021-44228.yaml,cves/2021/CVE-2021-40438.yaml
nuclei -u https://example.com -t cves/
nuclei -u https://example.com -tags cve,oast
nuclei -u https://example.com -exclude-tags dos,fuzz
Output Options #
bash Copy
nuclei -u https://example.com -o results.txt
nuclei -u https://example.com -o results.json -j
nuclei -u https://example.com -o results.sarif -sarif
nuclei -u https://example.com -o results.md -markdown
Rate Limiting #
bash Copy
nuclei -u https://example.com -rate-limit 100
nuclei -u https://example.com -rate-limit-minute 300
nuclei -u https://example.com -bulk-size 25
nuclei -u https://example.com -c 50
Advanced Usage #
Severity Filtering #
bash Copy
nuclei -u https://example.com -severity critical
nuclei -u https://example.com -severity high,critical
nuclei -u https://example.com -exclude-severity low,info
Automatic Template Updates #
bash Copy
nuclei -update-templates
nuclei -update-directory /path/to/templates
nuclei -update-templates -ut
Proxy and Network Options #
bash Copy
nuclei -u https://example.com -proxy http://127.0.0.1:8080
nuclei -u https://example.com -proxy socks5://127.0.0.1:1080
nuclei -u https://example.com -follow-redirects
nuclei -u https://example.com -follow-host-redirects
Authentication #
bash Copy
nuclei -u https://example.com -auth-type basic -auth-user username -auth-pass password
nuclei -u https://example.com -H "Authorization: Bearer YOUR_TOKEN"
nuclei -u https://example.com -H "Cookie: session=123456"
Interactsh Integration #
bash Copy
nuclei -u https://example.com -interactsh-server https://your-interactsh-server.com
nuclei -u https://example.com -no-interactsh
nuclei -u https://example.com -interactsh-server https://your-interactsh-server.com -interactions-poll-duration 60 -interactions-cooldown-period 30
Workflow Execution #
bash Copy
nuclei -u https://example.com -w workflows/wordpress-workflow.yaml
nuclei -u https://example.com -w workflows/wordpress-workflow.yaml,workflows/jira-workflow.yaml
Headless Browser Support #
bash Copy
nuclei -u https://example.com -headless
nuclei -u https://example.com -headless -browser-path /path/to/chrome
nuclei -u https://example.com -headless -page-timeout 20
Template Management #
Template Structure #
Nuclei templates are YAML files with the following basic structure:
yaml Copy
id : template- id
info :
name : Template Name
author : Author Name
severity : info| low| medium| high| critical
description : Template description
tags : tag1, tag2
requests :
- method : GET
path :
- "\\\\{\\\\{BaseURL\\\\}\\\\}/path"
matchers :
- type : word
words :
- "sensitive data"
Creating Custom Templates #
bash Copy
cat > custom-template.yaml << EOF
id: custom-template
info:
name: Custom Template
author: Your Name
severity: medium
description: Detects a custom vulnerability
tags: custom
requests:
- method: GET
path:
- "\\ \\ {\\ \\ {BaseURL\\ \\ }\\ \\ }/admin"
matchers:
- type: word
words:
- "Admin Panel"
EOF
nuclei -u https://example.com -t custom-template.yaml
Template Validation #
bash Copy
nuclei -validate -t custom-template.yaml
nuclei -validate -t templates/
Template Listing #
bash Copy
nuclei -tl
nuclei -tl -tags cve,2021
nuclei -tl -severity critical
Pipeline with httpx #
bash Copy
subfinder -d example.com| httpx| nuclei -t cves/
naabu -host example.com -top-ports 100 -silent| httpx -silent| nuclei -t cves/
Integration with Notify #
bash Copy
nuclei -u https://example.com -o results.txt| notify -provider slack
nuclei -u https://example.com -severity critical -json| notify -provider discord
Integration with GitHub Actions #
yaml Copy
name : Nuclei Scan
on :
schedule :
- cron : '0 0 * * *'
jobs :
scan :
runs-on : ubuntu- latest
steps :
- uses : actions/checkout@v2
- name : Nuclei Scan
uses : projectdiscovery/nuclei- action@main
with :
target : https: //example.com
templates : cves/
output : nuclei- results.txt
Best Practices #
bash Copy
nuclei -u https://example.com -tags tech
nuclei -u https://example.com -exclude-templates ssl,fuzzing
nuclei -u https://example.com -c 50 -bulk-size 20
nuclei -u https://example.com -rate-limit 100
Targeted Scanning #
bash Copy
nuclei -u https://example.com -tags wordpress,plugin
nuclei -u https://example.com -tags cve,2023
httpx -u https://example.com -tech-detect| nuclei -t technologies/
Reducing Noise #
bash Copy
nuclei -u https://example.com -exclude-templates false-positives/
nuclei -u https://example.com -severity high,critical
nuclei -u https://example.com -exclude-tags fuzz,dos
Regular Updates #
bash Copy
nuclei -update-templates
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
Troubleshooting #
Common Issues #
Template Errors
bash Copy
nuclei -validate -t custom-template.yaml
nuclei -u https://example.com -t custom-template.yaml -debug
Rate Limiting by Target
bash Copy
nuclei -u https://example.com -rate-limit 10
nuclei -u https://example.com -rate-limit 10 -random-delay 5
Memory Issues
bash Copy
nuclei -u https://example.com -c 10
nuclei -u https://example.com -bulk-size 10
Network Issues
bash Copy
nuclei -u https://example.com -timeout 10
nuclei -u https://example.com -retries 3
Debugging #
bash Copy
nuclei -u https://example.com -debug
nuclei -u https://example.com -v
nuclei -u https://example.com -debug -show-request -show-response
nuclei -u https://example.com -store-resp
Configuration #
Configuration File #
Nuclei uses a configuration file located at $HOME/.config/nuclei/config.yaml. You can customize various settings in this file:
yaml Copy
concurrency : 25
rate-limit : 150
bulk-size : 20
templates-directory : /path/to/templates
output : /path/to/output.txt
json : true
severity :
- critical
- high
- medium
exclude-severity :
- info
- low
Environment Variables #
bash Copy
export NUCLEI_CONCURRENCY = 25
export NUCLEI_RATE_LIMIT = 150
export NUCLEI_TEMPLATES_DIRECTORY = /path/to/templates
export NUCLEI_OUTPUT = /path/to/output.txt
export NUCLEI_JSON = true
Reference #
Command Line Options #
Flag
Description
-u, -target
Target URL to scan
-l, -list
Path to file containing list of URLs to scan
-t, -templates
Templates to use for scanning
-tags
Tags to include templates by
-exclude-tags
Tags to exclude templates by
-o, -output
File to write output to
-j, -json
Write output in JSON format
-c, -concurrency
Number of concurrent requests
-rate-limit
Maximum number of requests per second
-timeout
Timeout in seconds for HTTP requests
-v, -verbose
Show verbose output
-debug
Show debug information
-update-templates
Update templates to latest version
-severity
Filter templates by severity
-exclude-severity
Exclude templates by severity
-interactsh-server
Interactsh server URL for OOB testing
-no-interactsh
Disable Interactsh for OOB testing
-follow-redirects
Follow HTTP redirects
-follow-host-redirects
Follow redirects on the same host
-max-redirects
Maximum number of redirects to follow
-headless
Enable headless browser support
-proxy
HTTP/SOCKS5 proxy to use
-H, -header
Custom header to add to all requests
-validate
Validate templates
-tl
List available templates
Template Types #
Type
Description
HTTP
Web-based vulnerabilities
DNS
DNS-based vulnerabilities
File
Local file analysis
Network
Network protocol vulnerabilities
Headless
Browser-based vulnerabilities
SSL
SSL/TLS vulnerabilities
Websocket
Websocket vulnerabilities
Whois
Whois data analysis
Javascript
JavaScript analysis
Workflow
Multi-step vulnerability chains
Matcher Types #
Type
Description
word
Match based on response containing specific words
regex
Match based on regular expressions
binary
Match based on binary response
status
Match based on HTTP status code
size
Match based on response size
dsl
Match using DSL expressions
xpath
Match using XPath expressions
jsonpath
Match using JSONPath expressions
gval
Match using GVAL expressions
kval
Match using key-value expressions
Type
Description
regex
Extract data using regular expressions
kval
Extract key-value pairs
xpath
Extract data using XPath expressions
jsonpath
Extract data using JSONPath expressions
dsl
Extract data using DSL expressions
gval
Extract data using GVAL expressions