当前位置:网站首页>Attack and defense world - easytornado notes
Attack and defense world - easytornado notes
2022-07-19 02:20:00 【jjj34】
Reference blog :Python From the server-side template injection to sandbox escape source code exploration ( One ) - The prophet community (aliyun.com)
XCTF series // Web | easytornado_Ga1axy_z The blog of -CSDN Blog
Tornado
Tornado yes Python Development of the whole trestle (full-stack) Web Framework and asynchronous network library , yes Python A kind of Web Development framework
Tornado Template injection of
adopt welcome.txt We can see

Obviously , The question is render Template Injection
render Templates :
render yes python A rendering function in , That is, a template , The parameters through the call are different , Generate different web pages , When the user render When the content is controllable , You can inject xss
and flask The principle of template injection is similar
flask Template Injection _jjj34 The blog of -CSDN Blog _flask Template Injection
Analysis topic

From this file , We can know ,filehash The value of is md5( cookie_secret+md5(filename))

From this file , We can see flag stay /fllllllllllllag in
therefore We have direct access to /fllllllllllllag file

Obviously , The utilization point appears

There is a filter
According to the tips seen above, there are cookie_secret So we passed handler.setting Look for cookie_secret
tornado Source code is as follows

Construct according to the source code payload
1.cookie_secret Store in settings in
2.settings Passed to as a parameter Application Constructor for , So you can use self.application.settings To get cookie
3. According to official documents ,RequestHandler.settings Its alias is self.application.settings also handler Point to processing the current page RequestHandler object , So you can use handler.settings To get cookie_secret
So our payload by
http://111.200.241.244:50619/error?msg={
{handler.settings}} 
Get cookie Then there is the process md5 encryption , Work out filehash value
Encrypted website :md5 Online decryption ,md5 Decryption encryption (cmd5.com)
filehash = md5(cookie_secret + md5( /fllllllllllllag))
1. take /fllllllllllllag Conduct md5 encryption obtain x1
2. take x1 And cookie_secret After splicing x2
x2 That's what we want filehash

Solve the problem successfully
边栏推荐
猜你喜欢

笔记一之IDL基础内容:常用数据类型_创建数组_类型转换_print输出_基本运算_关系运算

简述特征工程及其sklearn的实现

Engineering compilation: makefile and cmake (I)

【Unity开发小技巧】Unity打包PC端exe,压缩打包为一个exe文件

成信大ENVI_IDL第三周课堂内容1:读取OMI数据(HDF5文件)以及输出+解析

攻防世界----easytornado笔记

ENVI_ Idl: read the text file and output it in GeoTIFF format + simple mean interpolation

Unity导入fbx模型后,运行时物体的旋转和位置自动改变的问题解决方法

第1章-多智能体系统

【Unity编辑器扩展】显示资源目录下所有文件所占内存大小
随机推荐
DoubleDQN的理论基础及其代码实现【Pytorch + Pendulum-v0】
【Unity编辑器扩展】Unity资产预处理和后处理图片自动转Sprite2D
攻防世界----easytornado笔记
散列表、布隆过滤器、分布式一致性hash
Vmware Tools最新安装教程(RHEL8)
Leetcode 198:House Robber
二叉树的遍历
STL--stack容器
bugku---game1
池式组件之内存池篇
ENVI_IDL:批量重投影Modis Swath产品并指定范围输出为Geotiff格式+解析
成信大ENVI_IDL第二周课堂内容:打开HDF4文件并读取文件以及简单的数据处理和保存+详细解析
Gdb+vscode debugging -- how to debug the release version
(with word operation and video explanation) map registration using ArcGIS_ Projection transformation_ General map making_ Thematic map making
Gdb+vscode for debugging 1 -- compile and debug using cmakelist files + attach process debugging
Software testing technology interim testing summary | software testing foundation & Executive testing & test design and development
Cookie和Session的区别
LeetCode:动态规划中的子序列问题
Unity导入fbx模型后,运行时物体的旋转和位置自动改变的问题解决方法
成信大ENVI_IDL第一周实验测试:数组的简单运算+详细解析