# Offensive Ssti

Dense description covering Server-Side Template Injection across Jinja2, Twig...

- Repository: https://github.com/SnailSploit/Claude-Red (10186 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-12
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add SnailSploit/Claude-Red --skill offensive-ssti -g -a claude-code -y`
Codex: `npx skills add SnailSploit/Claude-Red --skill offensive-ssti -g -a codex -y`
Cursor: `npx skills add SnailSploit/Claude-Red --skill offensive-ssti -g -a cursor -y`
Gemini CLI: `npx skills add SnailSploit/Claude-Red --skill offensive-ssti -g -a gemini-cli -y`

## Description

Dense description covering Server-Side Template Injection across Jinja2, Twig, Freemarker, Velocity, Pebble, Smarty, Mako, Handlebars, ERB, Thymeleaf, EJS, Pug. Engine fingerprinting, filter bypass, blind exploitation, WAF evasion, SSTI-to-RCE chains. Tools: tplmap. CWE-1336. MITRE T1190. Use when testing template rendering endpoints or exploiting template injection for code execution.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Server-Side Template Injection (SSTI) -- Offensive Methodology

SSTI exists wherever user-controlled input is concatenated into a server-side
template string and the engine evaluates it as code. The engine executes
attacker-supplied directives, granting access to the language runtime and, in
nearly every engine, remote code execution through the host language's object
model. You encounter SSTI in any application passing raw user input to functions
like `render_template_string()`, `Template()`, or `compile()`.

CWE-1336. MITRE ATT&CK T1190.

## Quick Workflow

1. Map injection surfaces: URL params, POST bodies, JSON values, path segments, headers, cookies.
2. Inject polyglot probes and engine-specific arithmetic expressions; note evaluation, errors, or blank output.
3. Fingerprint the engine via decision-tree probes, error signatures, and variable enumeration (section 1).
4. Confirm server-side execution -- rule out client-side template injection (AngularJS, Vue.js).
5. Escalate to information disclosure: dump config, env vars, secrets, internal paths.
6. Achieve code execution with the engine-specific chain; apply bypass techniques if blocked (section 6).
7. Chain for higher impact: file read, SSRF to cloud metadata, reverse shell, internal pivot.
8. Produce non-destructive PoC with unique marker and capture the full request/response chain.

---

## 1. Engine Detection and Fingerprinting

### 1.1 Polyglot Probes

```text
${{<%[%'"}}%\          Universal polyglot
{{7*7}}                Double-curly arithmetic
{{7*'7'}}              String multiplication (Jinja2 returns 7777777, Twig returns 49)
<%= 7*7 %>             ERB / EJS style
#{7*7}                 Pebble / Pug / Thymeleaf contexts
@(7+7)                 Razor (.NET)
```

Engine-narrowing probes:

The rest: https://github.com/SnailSploit/Claude-Red/blob/HEAD/Skills/web/offensive-ssti/SKILL.md
