当前位置:网站首页>漏洞复现-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
renderrender是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]
运放电路的反馈电阻上并联一个电容是什么作用

jeeSite 表单页面的Excel 导入功能

2022 Inner Mongolia latest advanced fire facility operator simulation examination question bank and answers

【踩坑系列】uniapp之h5 跨域的问题

Ansible

【数字IC验证快速入门】17、SystemVerilog学习之基本语法4(随机化Randomization)

The zblog plug-in supports the plug-in pushed by Baidu Sogou 360

JS quick start (I)

Linux server development, redis source code storage principle and data model

2022 National latest fire-fighting facility operator (primary fire-fighting facility operator) simulation questions and answers
随机推荐
Leetcode simple question: find the K beauty value of a number
Pytorch(六) —— 模型调优tricks
ZCMU--1396: 队列问题(2)
【无标题】
【数字IC验证快速入门】17、SystemVerilog学习之基本语法4(随机化Randomization)
【数字IC验证快速入门】14、SystemVerilog学习之基本语法1(数组、队列、结构体、枚举、字符串...内含实践练习)
JS quick start (I)
【数字IC验证快速入门】13、SystemVerilog interface 和 program 学习
Fast parsing intranet penetration escorts the document encryption industry
The element with setfieldsvalue set is obtained as undefined with GetFieldValue
Introduction to basic components of wechat applet
ZCMU--1492: Problem D(C语言)
Yugu p1020 missile interception (binary search)
Introduction à l'objet blob
Myabtis_Plus
Linux server development, MySQL transaction principle analysis
Myabtis_ Plus
快解析内网穿透助力外贸管理行业应对多种挑战
It took "7" years to build the robot framework into a micro service
MySQL multi column index (composite index) features and usage scenarios