nuclei-template-writer
Skill37 starsChanged 5 months agoMITView on GitHub
Convert a vulnerability description or HTTP request/response pair into a ready-to-run Nuclei YAML template handles auth strategies, matcher selection, OOB detection, and multi-step flows. Trigger when the user found a vulnerability and wants to automate detection on other targets, pastes an HTTP request/response and asks for a Nuclei template, says "write a nuclei template for this" or "automate this finding", or wants to build a personal template library from bug bounty findings.
In this repository38 other files it gives its agents.
- ad-breachSkill
- ai-llm-hunterSkill
- attack-surfaceSkill
- bugbounty-reporterSkill
- cavemanSkill
- check-exploitSkill
- clickjacking-hunterSkill
- compliance-gap-analyzerSkill
- control-lookupSkill
- ctf-writeupSkill
- cvss-scorerSkill
- deadangleSkill
- droid-reconSkill
- economist-attackSkill
- engagement-handoffSkill
- finding-writerSkill
- find-skillsSkill
- graphql-raiderSkill
- hexstrike-forgeSkill
- high-severity-hunterSkill
- hpp-hunterSkill
- idor-hunterSkill
- js-analyzerSkill
- jwt-crackerSkill
- less-aggressive-attackSkill
- less-noise-attackSkill
- pentest-reportSkill
- redirect-forgeSkill
- redmindSkill
- remediation-plannerSkill
- risk-assessorSkill
- scope-grillSkill
- skill-benchmarkSkill
- ssrf-hunterSkill
- ssti-hunterSkill
- vuln-diagnoseSkill
- xss-hunterSkill
- xxe-phantomSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
If input is ambiguous, ask ONE question: "What does the response look like when the vulnerability triggers?"
- Distinctive: line 48
If the class is not in the table, follow this fallback in order:
- Very specific: line 52
If none apply, stop and output: [nuclei-template-writer] Cannot determine detection method — provide the response body or describe what …
- Very specific: line 58
Use references/matcher-guide.md to select the right matcher.
- Very specific: line 66
Always combine matchers with matchers-condition: and when using status + word/regex to reduce false positives.
- Very specific: line 72
Check if the original request contains any authentication.
- Distinctive: line 94
Follow the Nuclei YAML schema exactly.
- Distinctive: line 113
Never hardcode auth tokens — always use variables (see auth strategy from Step 2.5)
- Very specific: line 118
Add matchers-condition: and when using multiple matchers
- Distinctive: line 121
Always add a status matcher as secondary when the vuln returns a specific code
- Distinctive: line 165
4. Validate before bulk-running: test on one confirmed-vulnerable target (expect a hit) and one clean target (expect no hit).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nuclei Template Writer
Turns a finding into a Nuclei template. The template can then be run against thousands of targets to find the same vulnerability at scale.
Protocol
Step 0 — Parse the input
Identify the input type — determines how precise the output can be:
| Type | What was given | Template quality |
| A | Description only | Skeleton with placeholder payloads — mark what needs customization |
| B | HTTP request only | Parameterized request, best-guess matchers — note matchers are inferred |
| C | HTTP request + response | Full template with precise matchers — production ready |
| D | Multiple requests (IDOR, multi-step) | Multi-step raw template |
Extract every detail available:
- HTTP method, full path, query parameters
- Request headers (note auth headers — document them, never hardcode values)
- Request body
- Response status code, response headers, response body (key sections)
- Any payload or test string mentioned
- Any error message, leaked string, or behavioral signal described
If input is ambiguous, ask ONE question: "What does the response look like when the vulnerability triggers?"
Step 1 — Classify the vulnerability
Match the finding against references/vuln-classes.md. Identify:
- Primary class — XSS, SQLi, SSRF, LFI, IDOR, etc.
- Severity — from the class table; adjust up if auth not required or down if interaction needed
- Tags — from the class table
- Detection method — response-based, OOB, time-based, or status-based
If the class is not in the table, follow this fallback in order:
- Does the response contain a unique string when the vuln triggers? → word matcher
- Does the response contain a pattern (version, key, email)? → regex matcher
- Is there no response signal at all (blind vuln)? → go to Step 2's interactsh path
- If none apply, stop and output:
[nuclei-template-writer] Cannot determine detection method — provide the response body or describe what changes when the vulnerability triggers.
Step 2 — Choose detection strategy
Use references/matcher-guide.md to select the right matcher. Priority order:
- Word matcher — if a specific string appears in the response (error message, reflected payload, leaked data). Most reliable, lowest false-positive risk.
- Regex matcher — if the evidence is a pattern (version number, email, secret format, dynamic value).
- Status matcher — only as a secondary matcher, never alone (too many false positives).
- DSL matcher — for time-based blind vulns (
response_time > 5) or header condition checks. - Interactsh matcher — for blind OOB vulns (SSRF, blind XXE, blind command injection). Requires
{{interactsh-url}}as the payload.
Always combine matchers with matchers-condition: and when using status + word/regex to reduce false positives.
Step 2.5 — Determine auth strategy
Check if the original request contains any authentication. Use references/auth-strategies.md to select the right approach.
First — always generate an unauthenticated probe variant: Strip all auth headers/cookies and test the same endpoint. Include this as a separate template or first request block. Reason: the same vuln may be exploitable without auth on other targets even if auth was required on the original. If the unauthenticated probe hits, upgrade severity by one level.
Then — handle the authenticated case based on auth type:
| Auth detected | Strategy | Scales to other targets? |
| No auth | Unauthenticated probe only — done | ✅ Yes, fully |
| Bearer JWT / API key header | {{token}} variable + -var at runtime | ✅ Yes, one token per target |
| Session cookie from login form | Login-flow template — auto-extracts token | ✅ Yes, with test credentials |
| Basic auth | {{b64creds}} variable, base64 of user:pass | ✅ Yes, one cred set per target |
| OAuth / SAML / SSO | Flag as limitation — too complex for a template | ❌ Manual only |
| CSRF token in body | Login-flow template — extracts CSRF then exploits | ✅ Yes, with test credentials |
See references/auth-strategies.md for the full template pattern for each auth type.
Step 3 — Generate the template
Follow the Nuclei YAML schema exactly. Build each block:
ID: {vuln-class}-{endpoint-slug} — kebab-case, descriptive, unique.
Example: reflected-xss-api-user-export-format
Info block:
info:
name: [human-readable description of what this detects]
author: [leave blank or use "custom"]
severity: [info/low/medium/high/critical]
description: [one sentence — what triggers it and what the impact is]
tags: [from vuln-classes.md, comma-separated]HTTP block:
- Replace the hostname with
{{BaseURL}} - Replace OOB payloads with
{{interactsh-url}} - Replace dynamic/session values (CSRF tokens, timestamps) with notes
- Never hardcode auth tokens — always use variables (see auth strategy from Step 2.5)
- For login-flow templates: use
raw:block withcookie-reuse: trueand an extractor on the first request - For multi-step (IDOR): use
raw:block withcookie-reuse: true
Matchers:
- Add
matchers-condition: andwhen using multiple matchers - Word matchers: use the exact string from the response, not a generic one
- Regex matchers: keep patterns tight — prefer anchors and specific character classes
- Always add a status matcher as secondary when the vuln returns a specific code
Variables block — always declare variables for anything target-specific:
variables:
token: "REPLACE_ME" # for Bearer/API key auth
username: "REPLACE_ME" # for login-flow templates
password: "REPLACE_ME" # for login-flow templatesOutput order when auth is required: generate two templates:
- Unauthenticated probe (stripped of auth) — label it
[unauthenticated] - Authenticated template with chosen auth strategy — label it
[authenticated]
Apply the skeleton from references/vuln-classes.md for the matched class, then apply the auth pattern from references/auth-strategies.md.
Step 4 — Output
Produce in this exact order:
1. The complete template — fenced as ```yaml
2. Customize before running — bullet list of exactly what to change before the template works:
- Which headers need real values
- Which payloads need adjustment for the target
- Whether interactsh needs to be set up
3. Test command — show the right command for the auth strategy used:
# No auth — run directly
nuclei -t template-name.yaml -l targets.txt
# Bearer / API key — pass token at runtime
nuclei -t template-name.yaml -l targets.txt -var "token=eyJ..."
# Login-flow — pass credentials at runtime
nuclei -t template-name.yaml -l targets.txt -var "username=test@test.com" -var "password=Test1234"
# OOB template
nuclei -t template-name.yaml -l targets.txt -iserver https://interactsh.com4. Validate before bulk-running: test on one confirmed-vulnerable target (expect a hit) and one clean target (expect no hit). If both trigger, the matcher is too broad — tighten the word or regex before scaling.
Step 5 — Flag limitations
State clearly if any of the following apply:
- OOB required: "This template uses interactsh — set up a listener before running. Hits will appear in your interactsh dashboard, not in nuclei output directly."
- Auth required (Bearer/API key): "Pass your token at runtime with
-var token=YOUR_TOKEN. You need a valid account on each target. The unauthenticated probe is included — check if it hits first." - Auth required (login flow): "Pass test credentials with
-var username=X -var password=Y. The template logs in automatically and extracts the session. You need a registered account on each target." - Auth required (OAuth/SSO): "Cannot be templated reliably — OAuth flows require browser interaction. Test manually on each target."
- Multi-account required (IDOR): "This template needs two valid accounts on the target. Replace
VICTIM_OBJECT_IDandATTACKER_SESSIONwith real values." - Low confidence matchers (Type A/B): "Matchers are inferred from the description — validate against the real response before bulk-running to avoid false positives."
Reference Files
references/vuln-classes.md— Vulnerability class table with severity, tags, and template skeletonsreferences/matcher-guide.md— Matcher type selection guide with examplesreferences/auth-strategies.md— Auth patterns and full template examples per auth type
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

