利用服务器端模板注入

Server Side Template Injection: To present data dynamically from emails or webpages we use templates and unsafely use of it leads to server exploits like RCE and many more. 服务器端模板注入:为了从电子邮件或网页中动态显示数据,...
摘要由CSDN通过智能技术生成

Server Side Template Injection: To present data dynamically from emails or webpages we use templates and unsafely use of it leads to server exploits like RCE and many more.

服务器端模板注入:为了从电子邮件或网页中动态显示数据,我们使用模板,并且不安全地使用它会导致服务器漏洞利用,例如RCE等。

So when user controlled input is embedded directly into template, it may cause of SSTI. This may occurs as developer want to offer rich functionality.

因此,当用户控制的输入直接嵌入到模板中时,可能会导致SSTI。 当开发人员想要提供丰富的功能时,可能会发生这种情况。

Example: There is application that has functionality where users can send emails to their customer and the content of the email can be modified by the user. So if developer is using templates such as freemarker or twig for rich email experience and directly passing the inputs from the user for processing and sending the email. Attacker can inject malicious inputs in order to run the commands on the server.

示例:存在具有功能的应用程序,用户可以在其中向用户发送电子邮件,并且用户可以修改电子邮件的内容。 因此,如果开发人员正在使用诸如freemarker或twig之类的模板来获得丰富的电子邮件体验,并直接传递用户输入来处理和发送电子邮件。 攻击者可以注入恶意输入,以便在服务器上运行命令。

Working:

加工:

· User enter the malicious input in the application which is using templates.

·用户在使用模板的应用程序中输入恶意输入。

· Application transfers the malicious inputs without validating to the template engine

·应用程序在不验证模板引擎的情况下传输恶意输入

· Template engine processes invalidated input which may cause code execution on the server.

·模板引擎处理无效的输入,这可能导致服务器上的代码执行。

Detect: To test for template engine we can try some simple payloads if they gets evaluated then the application is vulnerable to template injection.

检测:要测试模板引擎,我们可以尝试一些简单的有效负载(如果经过评估),则应用程序容易受到模板注入的攻击。

Different la

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值