当前位置:网站首页>攻防世界----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

成功解题
边栏推荐
猜你喜欢

ENVI_IDL:读取所有OMI产品的NO2柱含量并计算月均值、季均值、年均值+解析

工程编译那点事:Makefile和cmake(一)
![[hdrp HD rendering pipeline] create hdrp project and upgrade the built-in pipeline project to hdrp project](/img/40/d3b2bb62db88c7b18a3c3df4df5609.png)
[hdrp HD rendering pipeline] create hdrp project and upgrade the built-in pipeline project to hdrp project

Chengxin University envi_ IDL third week class content 1: reading OMI data (HDF5 file) and output + parsing

ENVI:(2022年最详细的教程)自定义坐标系

ENVI_ Idl: batch Reproject MODIS swath products and specify the range output as GeoTIFF format + parsing

Gdb+vscode for debugging 1 -- compile and debug using cmakelist files + attach process debugging

(附word操作以及视频讲解)使用ARCGIS进行地图配准_投影变换_普通地图制作_专题地图制作

Gdb+vscode for debugging 0 - environment configuration

LeetCode:动态规划【基础题目求解】
随机推荐
Memory pooling of pooled components
Installing MySQL and JDBC on Windows
gdb+vscode进行调试7——程序出现segmentation default/段错误,如何进行调试?
软件测试技术期中测试小结|软件测试基础&执行测试&测试设计和开发
[unity Editor Extension] scriptableobject for internal asset configuration of unity
YYDS! The latest distributed core technology notes summarized by Alibaba technical officers have been launched, which can be regarded as a blessing
成信大ENVI_IDL第二周课后作业:提取n个点的气溶胶厚度+详细解析
Leetcode 1: Two Sum
Hash table, bloom filter, distributed consistency hash
【HSJFramework】Unity时间管理TimeManger计时器
Gdb+vscode for debugging 0 - environment configuration
Vmware Tools最新安装教程(RHEL8)
ENVI_IDL: 文本文件的读取(主要是txt、csv文件)
ENVI_ Idl: reading of text files (mainly txt and CSV files)
ENVI_IDL: 读取文本文件并输出为Geotiff格式+简单均值插值
散列表、布隆过滤器、分布式一致性hash
树和堆知识点总结
Gdb+vscode for debugging 5 - GDB view relevant commands
ENVI_IDL:批量重投影Modis Swath产品并指定范围输出为Geotiff格式+解析
动态规划 - 01背包问题