Tinja
Scanner de découverte et d'exploitation de server-side template injection qui fuzz les points d'injection et identifie le moteur de templating sous-jacent. Server-side template injection discovery and exploitation scanner that fuzzes for injection points and identifies the underlying templating engine.
↗ https://github.com/Marven11/TinjaOverview
Tinja automates the tedious part of SSTI hunting: throwing polyglot payloads at every parameter, header, and injection point, then fingerprinting which templating engine (Jinja2, Twig, Freemarker, Velocity, etc.) is in play based on how it responds. Once an engine is identified it can help move from detection straight to RCE payload generation, saving the manual “does {{7*7}} become 49?” grind.
Common Usage
Scan a URL with a marked injection point
tinja url -u "http://target.com/search?q=INJECT" -X INJECT
Scan and read request from Burp/raw HTTP file
tinja url -r request.txt -X INJECT
Scan all parameters automatically, no explicit marker
tinja url -u "http://target.com/render?name=test" --scan-all-params
Increase verbosity to see each payload/response pair
tinja url -u "http://target.com/preview?tpl=INJECT" -X INJECT -v
Example Workflow
# 1. Capture the vulnerable request in Burp, save as raw request
# (mark the injection point with INJECT)
- Run Tinja against the saved request
tinja url -r request.txt -X INJECT
# 3. Tinja fingerprints the engine (e.g. Jinja2) and suggests/executes
# an RCE payload using engine-specific gadgets
Tips
- Works over headers, cookies, and POST bodies, not just URL query params — mark the injection point with
-Xwherever it lives. - Fingerprinting relies on subtle behavioral differences between engines (e.g.
{{7*'7'}}→49in Jinja2 vs7777777in Twig) — false positives are possible on custom template logic. - Pair with manual verification before relying on any auto-generated RCE payload in a report.
Help / Man page
usage: tinja url [-h] -u URL [-r REQUEST] -X MARKER [--scan-all-params]
[--cookie COOKIE] [--header HEADER] [-v] [--proxy PROXY]
optional arguments:
-u URL Target URL
-r REQUEST Raw HTTP request file (from Burp/curl)
-X MARKER Injection marker string used in URL/request
--scan-all-params Automatically test every discovered parameter
--cookie COOKIE Cookie header to include
--header HEADER Additional header (repeatable)
--proxy PROXY Route requests through a proxy (e.g. 127.0.0.1:8080)
-v, --verbose Verbose payload/response output
-h, --help Show help and exit
Vue d’ensemble
Tinja automatise la partie fastidieuse de la chasse aux SSTI : envoyer des payloads polyglottes sur chaque paramètre, en-tête et point d’injection, puis fingerprinter le moteur de templating (Jinja2, Twig, Freemarker, Velocity, etc.) en fonction de sa réponse. Une fois le moteur identifié, il peut aider à passer directement de la détection à la génération de payload RCE, économisant le travail manuel du “est-ce que {{7*7}} devient 49 ?”.
Utilisation courante
# Scanner une URL avec un point d'injection marqué
tinja url -u "http://target.com/search?q=INJECT" -X INJECT
# Scanner et lire une requête depuis Burp/un fichier HTTP brut
tinja url -r request.txt -X INJECT
# Scanner automatiquement tous les paramètres, sans marqueur explicite
tinja url -u "http://target.com/render?name=test" --scan-all-params
# Augmenter la verbosité pour voir chaque paire payload/réponse
tinja url -u "http://target.com/preview?tpl=INJECT" -X INJECT -v
Exemple de workflow
# 1. Capturer la requête vulnérable dans Burp, la sauvegarder comme requête brute
# (marquer le point d'injection avec INJECT)
Étape 2 : lancer Tinja contre la requête sauvegardée
tinja url -r request.txt -X INJECT
# 3. Tinja fingerprint le moteur (par exemple Jinja2) et suggère/exécute
# un payload RCE en utilisant des gadgets spécifiques au moteur
Conseils
- Fonctionne via les en-têtes, cookies et corps POST, pas seulement les paramètres de requête d’URL : marquer le point d’injection avec
-Xoù qu’il se trouve. - Le fingerprinting repose sur des différences comportementales subtiles entre moteurs (par exemple
{{7*'7'}}→49en Jinja2 vs7777777en Twig) : des faux positifs sont possibles sur une logique de template personnalisée. - Associer à une vérification manuelle avant de se fier à un payload RCE généré automatiquement dans un rapport.
Aide / Page de manuel
usage: tinja url [-h] -u URL [-r REQUEST] -X MARKER [--scan-all-params]
[--cookie COOKIE] [--header HEADER] [-v] [--proxy PROXY]
optional arguments:
-u URL Target URL
-r REQUEST Raw HTTP request file (from Burp/curl)
-X MARKER Injection marker string used in URL/request
--scan-all-params Automatically test every discovered parameter
--cookie COOKIE Cookie header to include
--header HEADER Additional header (repeatable)
--proxy PROXY Route requests through a proxy (e.g. 127.0.0.1:8080)
-v, --verbose Verbose payload/response output
-h, --help Show help and exit