This project demonstrates how to identify Server-Side Template Injection (SSTI) vulnerabilities in web applications. It uses a Flask application as a demo target, intercepts HTTP requests using mitmproxy, and tests for potential SSTI vulnerabilities.
This project consists of three main components:
- Flask Application (
SSTI-vul.py): A simple web application vulnerable to SSTI. - Interceptor (
interceptor.py): Amitmproxyscript to capture and modify HTTP requests and responses. - Checker (
checker.py): A script to detect SSTI vulnerabilities by sending payloads and analyzing responses.
- Python 3.x
pip(Python package manager)mitmproxyfor intercepting and modifying HTTP traffic
-
Clone the Repository:
git clone https://github.com/L1v3y/SSTI-Fuzz.git cd SSTI-Fuzz -
Install Required Packages: Install the dependencies listed in
requirements.txt.pip install -r requirements.txt
-
Install
mitmproxy: Follow the official mitmproxy installation guide for your operating system.
Start the vulnerable Flask application by running:
python SSTI-vul.pyThe application will be accessible at http://127.0.0.1:5000.
Launch mitmproxy with the custom interceptor script:
mitmproxy -s interceptor.pyIn your browser, navigate to http://127.0.0.1:5000 and submit the form.
Observe the captured request in the mitmproxy interface.
Export the captured request to a file named request.txt:
- In the mitmproxy interface, select the captured request.
- Press
eto export and save it asrequest.txt.
Run the checker script to see if the captured request is vulnerable to SSTI:
python checker.pyThe script will analyze the request, test for various template engines, and report if any vulnerabilities are found. If a vulnerability allows command execution, it will be highlighted.