SQL Server危險擴充儲存刪除和恢複[網路收集]

來源:互聯網
上載者:User

將有安全問題的SQL過程刪除.比較全面.一切為了安全!

刪除了調用shell,註冊表,COM組件的破壞許可權

MS SQL SERVER2000

使用系統帳戶登陸查詢分析器

運行以下指令碼:

use master

exec sp_dropextendedproc 'xp_cmdshell'

exec sp_dropextendedproc 'xp_enumgroups'

exec sp_dropextendedproc 'xp_loginconfig'

exec sp_dropextendedproc 'xp_enumerrorlogs'

exec sp_dropextendedproc 'xp_getfiledetails'

exec sp_dropextendedproc 'Sp_OACreate'

exec sp_dropextendedproc 'Sp_OADestroy'

exec sp_dropextendedproc 'Sp_OAGetErrorInfo'

exec sp_dropextendedproc 'Sp_OAGetProperty'

exec sp_dropextendedproc 'Sp_OAMethod'

exec sp_dropextendedproc 'Sp_OASetProperty'

exec sp_dropextendedproc 'Sp_OAStop'

exec sp_dropextendedproc 'xp_regaddmultistring'

exec sp_dropextendedproc 'xp_regdeletekey'

exec sp_dropextendedproc 'xp_regdeletevalue'

exec sp_dropextendedproc 'xp_regenumvalues'

exec sp_dropextendedproc 'xp_regremovemultistring'

exec sp_dropextendedproc 'xp_regwrite'

drop procedure sp_makewebtask

go

刪除所有危險的擴充:

exec sp_dropextendedproc 'xp_cmdshell' [刪除此項擴充後,將無法遠端連線資料庫]

以下3個預存程序會在SQL SERVER恢複備份時被使用,非必要請勿刪除

#exec sp_dropextendedproc 'xp_dirtree' [刪除此項擴充後,將無法建立或附加資料庫]

#exec sp_dropextendedproc 'Xp_regread' [刪除此項擴充後, 還原資料庫輔助]

#exec sp_dropextendedproc 'xp_fixeddrives' [刪除此項擴充後,將無法還原資料庫]

 

恢複指令碼

use master

EXEC sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'

EXEC sp_addextendedproc xp_enumgroups ,@dllname ='xplog70.dll'

EXEC sp_addextendedproc xp_loginconfig ,@dllname ='xplog70.dll'

EXEC sp_addextendedproc xp_enumerrorlogs ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_getfiledetails ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc Sp_OACreate ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc Sp_OADestroy ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc Sp_OAGetErrorInfo ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc Sp_OAGetProperty ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc Sp_OAMethod ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc Sp_OASetProperty ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc Sp_OAStop ,@dllname ='odsole70.dll'

EXEC sp_addextendedproc xp_regaddmultistring ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_regdeletekey ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_regdeletevalue ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_regenumvalues ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_regremovemultistring ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_regwrite ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_dirtree ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_regread ,@dllname ='xpstar.dll'

EXEC sp_addextendedproc xp_fixeddrives ,@dllname ='xpstar.dll'

go

全部複製到"SQL查詢分析器"

 

點擊菜單上的--"查詢"--"執行",就會將有安全問題的SQL過程刪除。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.