Python SSTI: Attack Flask framework using Jinja2 template engine

preview_player
Показать описание
In this episode of "from 0 to pentesting hero" we'll talk about template engines and Server-Side Template Injections attack.

This time we'll use python as an example and flask framework, in which we will use Jinja2.

Long ago, pieces of code responsible for application logic and content displayed to the user were stored in one file.

As you can guess, such mix was not only difficult to control, but also caused a lot of bugs in applications.

Because of that, template engines were created. Thanks to them, the logic of the page is stored in one file and everything that is to be displayed in the second.

Initially, these engines were simple and in most cases worked like good old "find and replace" feature known from word processors.

With time, however, their capabilities have increased drastically. It can be observed on the example of Jinja2 documentation, which is a popular engine used in applications created in Python.

Currently, it can be said that these engines are programming languages themselves. And usually you can perform a lot of potentially dangerous activities such as reading any file or executing any code.

So what will happen when a programmer forgets how powerful tool he has and uses it in a wrong way?

#from0topentestinghero #security #python
Рекомендации по теме
Комментарии
Автор

How I know the site use the Jinja or not

mr-bahi
welcome to shbcf.ru