TInjA
CLI tool for testing web pages for template injection vulnerabilities. Supports 44 of the most relevant template engines for eight different programming languages.
Description
TInjA is a CLI tool designed for detecting template injection vulnerabilities in web applications. Template injection, also known as Server-Side Template Injection (SSTI) or Client-Side Template Injection (CST), occurs when user input is unsafely embedded into templates, allowing attackers to execute arbitrary code.
The tool scans web pages by injecting payloads tailored to various template engines across multiple programming languages. It supports testing single URLs, multiple URLs, raw files, or JSONL files containing test cases. This makes it versatile for penetration testing and vulnerability assessments in web development environments.
Published by Hackmanit under Apache License 2.0, TInjA is maintained on GitHub and provides detailed reporting, including options for JSON output with HTML escaping.
How It Works
TInjA operates by sending crafted payloads to target web pages and analyzing responses for reflections indicative of template injection. It memorizes preceding characters (default 30) around reflection points in the body to identify context. Supports custom cookies, headers, and proxy certificates. Includes headless browser mode (--csti) for client-side template injections. Detection covers 44 template engines in eight languages by matching response patterns against known injection signatures.
Installation
sudo apt install tinjaFlags
Examples
tinja -htinja urltinja rawtinja jsonltinja url --cstitinja url -c "session=abc123"tinja url -H "X-Forwarded-For: 127.0.0.1"