当前位置:网站首页>攻防世界----easytornado笔记
攻防世界----easytornado笔记
2022-07-17 00:14:00 【jjj34】
参考博客:Python中从服务端模板注入到沙盒逃逸的源码探索 (一) - 先知社区 (aliyun.com)
XCTF系列 // Web | easytornado_Ga1axy_z的博客-CSDN博客
Tornado
Tornado是Python开发的全栈式(full-stack) Web框架和异步网络库,是Python的一种Web开发框架
Tornado的模板注入
通过welcome.txt我们可以看到

很显然,这一题是render模板注入
render模板:
render是python中一种渲染函数,也就是一种模板,通过调用的参数不同,生成不同的网页,当用户对render内容可控时,就可以注入xss
和flask模板注入的原理差不多
flask模板注入_jjj34的博客-CSDN博客_flask模板注入
分析题目

从这个文件,我们可以知道,filehash的值为 md5( cookie_secret+md5(filename))

从这个文件,我们可以了解到flag在/fllllllllllllag中
因此 我们直接访问 /fllllllllllllag 文件

很显然,利用点出现了

存在某个过滤
根据上文看到的提示中有 cookie_secret 因此我们通过handler.setting 去找cookie_secret
tornado源码如下

根据源码构造payload
1.cookie_secret存放在settings里
2.settings作为参数传给了Application的构造函数,因此可以通过self.application.settings 来获取cookie
3.根据官方文档,RequestHandler.settings的别名是self.application.settings并且handler指向处理当前页面的RequestHandler对象,因此可以通过 handler.settings来获取 cookie_secret
因此我们的payload为
http://111.200.241.244:50619/error?msg={
{handler.settings}} 
拿到cookie后就是进行md5加密,算出filehash值
加密的网站:md5在线解密破解,md5解密加密 (cmd5.com)
filehash = md5(cookie_secret + md5( /fllllllllllllag))
1.将 /fllllllllllllag进行md5加密 得到 x1
2.将 x1 与cookie_secret 拼接后进行x2
x2就是我们要的filehash

成功解题
边栏推荐
- Unity导入fbx模型后,运行时物体的旋转和位置自动改变的问题解决方法
- Gdb+vscode for debugging 1 -- compile and debug using cmakelist files + attach process debugging
- 图像质量评估指标:SNR、PSNR、MSE和SSIM
- DGC best practice: how to ensure that confidential data is not leaked when entering the lake?
- gdb+vscode进行调试3——vscode以及gdb远程调试
- 捉虱子的博弈论
- Unity3D 游戏人物跳跃落地时发生弹跳,偏移情况的解决方法
- 新手如何配置多个 SSH Key(通俗易懂手把手教学)
- Double Q-Learning理论基础及其代码实现【Pendulum-v0】
- STL--map容器
猜你喜欢

成信大ENVI_IDL第二周实验内容:提取所有MODIS气溶胶产品中AOD+详细解析

浏览器无法打开Tensorboard

成信大ENVI_IDL第二周课后作业:提取n个点的气溶胶厚度+详细解析

3D NFT的破茧重生:Caduceus去中心化边缘渲染技术

ENVI_IDL:读取OMI数据(HDF5)并输出为Geotiff文件+详细解析

Envi IDL: lire la teneur en colonne de NO2 de tous les produits OMI et calculer la moyenne mensuelle, la moyenne trimestrielle, la moyenne annuelle + résolution

【Unity面板属性扫盲】导入纹理后设置Texture Import Settings

ENVI_IDL:讀取所有OMI產品的NO2柱含量並計算月均值、季均值、年均值+解析

信号与系统实验

gdb+vscode进行调试3——vscode以及gdb远程调试
随机推荐
Chengxin University envi_ IDL third week class content 1: reading OMI data (HDF5 file) and output + parsing
Gdb+vscode debugging -- how to debug the release version
ENVI_ Idl: batch Reproject MODIS swath products and specify the range output as GeoTIFF format + parsing
Leetcode 198:House Robber
去中心化边缘渲染元宇宙协议Caduceus受邀出席CBAIA 2022峰会,以技术赋能更多Web3应用场景
【Unity面板属性扫盲】导入纹理后设置Texture Import Settings
3D NFT的破茧重生:Caduceus去中心化边缘渲染技术
池式组件之线程池篇
Visual Studio 2019-QT调试
第1章-多智能体系统
【解决方案】win11中本地组策略编辑器(gpedit.msc)打不开
ENVI_ Idl: batch re projection of modisswath products (calling the secondary development interface) + parsing
Foo bar what the hell?
gdb+vscode进行调试5——gdb查看相关命令
各种开发工具
STL--string容器
UE4 笔记
YYDS! The latest distributed core technology notes summarized by Alibaba technical officers have been launched, which can be regarded as a blessing
Labelme 的简单用法和界面介绍
ENVI_ Idl: batch splice the daily data of MODIS swath and output it in GeoTIFF format