Tornado是python的web框架
打開題目是3個txt的鏈接:

依次打開,注意url:

flag在/fllllllllllllag

render(渲染),render()是生成模板的函式,差不多就是考模板注入了

cookie_secret:https://tornado-zh.readthedocs.io/zh/latest/guide/security.html
把cookie_secret+md5(filename)進行md5就是filehash,要想辦法弄出cookie_secret
嘗試訪問/file?filename=/fllllllllllllag,url出現error?msg=Error,發現msg引數可控,其實file?filename=,(filename的值隨意)也是同樣的結果


服務端模版注入漏洞檢測payload整理

發現過濾了數學運算子
下載tornado框架原始碼,匯入pycharm,全域搜索cookie_secret:

看到cookie_secret在handler.application.settings配置中,

{'autoreload': True, 'compiled_template_cache': False, 'cookie_secret': '4dea0e25-9f47-4263-9be8-5b49b83ae3ec'}
利用cookie_secret,求出filehash:
<?php
$cookie_secret = '4dea0e25-9f47-4263-9be8-5b49b83ae3ec';
echo md5($cookie_secret.md5('/fllllllllllllag'));
payload:/file?filename=/fllllllllllllag&filehash=d42012554c615c9eabad5dd6533a2bb9
flag:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/135441.html
標籤:其他
