hunt-ssti

Detects server-side template injection and escalates to RCE across Jinja2, Twig, Freemarker, ERB, and other engines.

10|3|Updated Aug 10, 2026
One-click install
npx skills add https://github.com/baiqigo/baiqi-redteam-lab --skill hunt-ssti-baiqigo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hunt-ssti
Source: https://github.com/baiqigo/baiqi-redteam-lab/tree/main/.agents/skills/hunt-ssti
Command: npx skills add https://github.com/baiqigo/baiqi-redteam-lab --skill hunt-ssti-baiqigo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Server-side template injection is easy to miss and often under-reported: testers stop at arithmetic probes like {{77}} without proving real impact, or they fire the wrong engine's payload and get false negatives. This Skill provides an evidence-gated workflow to fingerprint the template engine correctly and escalate injection to verified remote code execution. ## Core Features & Use Cases - Engine Fingerprinting Matrix: Differentiate Jinja2, Twig, Freemarker, Velocity, ERB, Thymeleaf, Mako, Smarty, and Spring using double-curly, dollar-curly, and string-repetition probes (e.g., {{7'7'}} separates Jinja2 from Twig). - Engine-Specific RCE Payloads: Jinja2 class-walker via config.class.init.globals, Twig registerUndefinedFilterCallback, Freemarker Execute utility, and ERB backticks. - Authenticated CMS Template-Editor Workflow: Handles query-param record IDs, per-request CSRF token refresh, and preview-vs-save actions for template editor endpoints. - Use Case: While testing a Flask app's invoice name field, send the Jinja2 class-walker payload as a form-encoded body and confirm RCE when uid=N(user) appears in the response. ## Quick Start Use the hunt-ssti skill to test the template preview endpoint for server-side template injection and escalate any confirmed injection to a verified RCE proof.

Frequently Asked Questions about hunt-ssti

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test for server-side template injection?

Send arithmetic probes like {{7*7}}, ${7*7}, <%= 7*7 %>, and *{7*7} to every input reflected in rendered output. A response of 49 confirms server-side evaluation; the probe syntax that evaluates identifies which template engine is in use.

How to tell Jinja2 and Twig apart with SSTI probes?

Send {{7*'7'}}: Jinja2 performs Python string repetition and returns 7777777, while Twig coerces the string numerically and returns 49. This single payload differentiates the two engines before selecting an RCE payload.

Why does my SSTI payload return nothing in a web form?

Traditional form endpoints read application/x-www-form-urlencoded bodies, so JSON payloads are silently ignored by handlers like request.form['field']. Resend the payload as a form-encoded body field instead of JSON.

Does {{7*7}} returning 49 prove critical RCE?

No, arithmetic evaluation only confirms injection, not impact. Sandboxed engines like Twig sandbox mode or Jinja2 SandboxedEnvironment may block runtime access, so you must prove command execution with id output or an out-of-band callback before claiming Critical severity.

How do I exploit SSTI in an authenticated CMS template editor?

Fingerprint the engine first since editors often run Freemarker, keep the record ID in the query string rather than the body, re-fetch a fresh CSRF token each request, and iterate with template-action=preview before saving the final payload.

What can I do if the template engine is sandboxed?

Sandboxed SSTI without runtime escape is typically Medium severity, but the same reflection often yields stored XSS in rendered emails or SSRF through URL-fetching filters like Twig's include() targeting cloud metadata endpoints.