Senior Security Researcher Podalirius Labs
Remi Gascou (@podalirius_) is a Microsoft Security MVP and Senior offensive security consultant in France, where he performs internal and external penetration tests for various clients. Passionate about security research and playing with undocumented mechanisms, he is particularly interested in Windows internals and Active Directory. Along with his research, Remi has contributed to many open source tools including crackmapexec, impacket and co-authored Get-GPPPassword, smartbrute and pyWhisker. He also created FindUncommonShares, LDAPmonitor and Coercer.
Graph-oriented approach for SSTI payload optimization: Usecase of jinja2
When attacking Python-based web applications, we often need to find a way to execute commands on the server and escape from the application context. This goal can be achieved by leveraging vulnerabilities such as Server-Side Template Injection (SSTI) or Python format string injections. In these two cases we are able to manipulate Python objects as an attacker, but how can we find the shortest and most optimized payloads to achieve Remote Code Execution in this context?
In the first part of this talk, we will remind basics of python internals about objects, properties and variables. We will then leverage Python introspection capabilities to create paths to high value targets by chaining objects. We will then apply common graph exploration algorithms such as breadth first search or depth first search in order to find the shortest paths to high value targets to achieve Remote Code Execution (RCE).
In the second part, I’ll present a research tool called objectwalker allowing to automatically find paths to modules, functions, or high value targets in python objects. This tool can be used locally by an attacker to audit the security of the injection point in the python application, and find direct paths to high value targets such as the os module. After that the attacker can use the found payloads to achieve one click Remote Code Execution on the target, with no more necessary fuzzing on the real target.
Finally, we’ll go through two example use cases to demonstrate where this technique can be applied, with examples of usage of objectwalker. The first use case is searching for the shortest payload to achieve Remote Code Execution (RCE) in a Server-Side Template Injection (SSTI) in the Jinja2 template engine. The second use case is leveraging a format string vulnerability in Python in order to leak a secret configuration key defined in the settings of the web framework Django.
Are you the next cyber security superstar?
Ready for this year's presentations?
By registering you will unlock access to 60+ speakers and two full days with cyber security news & showcases from worldwide leaders.
Sponsors & Partners
They help us make this conference possible.
At Orange Business Services, we help our customers transform their industries, reimagine their services, create a positive impact and unleash the power of their data into an amazing and trusted resource.
With the dual expertise as a global operator coupled with the agility of an end-to-end integrator, Orange Business Services is a global network-native, digital services company. From connectivity, smart mobility services and the cloud to artificial intelligence (AI), analytics and cybersecurity, Orange Business Services helps businesses at every stage of their data management. Orange Business Services is represented in Romania by the business division of Orange Romania and helps large companies, SMEs and public authorities to transform their organizations through the use of technology and digital information.