网站是个没有内容的博客,返回头表明了后端语言"Werkzeug/1.0.1 Python/2.7.6",尝试几个"www.zip,robots.txt"之类的路径没什么发现,然后各个标签点了点,发现了/div/目录,是这个样子的b3bdd9848c167e77a604ab6837d6340.png

google一下"Werkzeug",找到一个exploit,结果没用,/console下pin不正确,卡了两个小时,突然看到题目提示点是ssti,然后就想起来了,以前故意避开了这种题(看到python、flask、django就头疼)

使用"{{}}"报错,报错信息中找到/app/ssti.py

@app.route('/diy/', methods=['GET', 'POST'])
def diy():
    if request.method == 'POST':
        tpl = request.form['tpl']
        def get_flag():
            with open("6bf85e3329f6da6462a213d75e9f5b6f.py", "r") as f:
                return f.readlines()
        template = Template('''%s''' % (tpl))
        template.globals['flag'] = get_flag    #get_flag function can be used in templates
        return template.render()
    return render_template('diy.html')

看样子flag在open的文件中,输入"{{flag()}}"后仍然报错

IOError: [Errno 2] No such file or directory: '6bf85e3329f6da6462a213d75e9f5b6f.py'

网上没找到答案,试着将文件名提交,error,做不出来了,希望有大师傅救我