sql数据库授予权限 Microsoft SQL Server数据库SA权限总结
Microsoft SQL Server数据库SA权限总结
需要准备的工具
SQL Query Analyzer和SqlExec Sunx Version
第一部分
去掉xp_cmdshell保护系统的具体分析
语句如下
去掉xp_cmdshell扩展过程的方法是使用如下语句
if exists (select * from dbo sysobjects where id=object_id(N [dbo] [xpcmdshell] ) and OBJECTPROPERTY(id N IsExtendedProc )= )exec sp_dropextendedproc N [dbo] [xp_cmdshell]
添加xp_cmdshell扩展过程的方法是使用如下语句
sp_addextendedproc xp_cmdshell @dllname= xplog dll
现在看看现象
我们在取得SA权限后远程用Sqlexec执行cmd命令 出现提示SQL_ERROR 那么很可能是去掉了xp_cmdshell
现在来看看被去掉xp_cmdshell后恢复的两种方法
方法一 使用SQL Query Analyzer连接对方后直接写入 挺方便sp_addextendedproc xp_cmdshell @dllname= xplog dll
方法二 使用SqlExec Sunx Version首先在SqlExec Sunx Version的Format选项里填上%s 在CMD选项里输入sp_addextendedproc xp_cmdshell xpsql dll 或者对Sql 情况下使用sp_addextendedproc xp_cmdshell xplog dll 另外使用SqlExec Sunx Version来去除xp_cmdshell的方法和加的时候选择条件一样 然后输入sp_dropextendedproc xp_cmdshell 就可以了
第二部分
假如对方已经把xplog dll删除或者改了名 我们来用下面的方法继续我们的hack任务
当出现如下现象暗示代表很有可能是xplog dll删除或者改了名

lishixinzhi/Article/program/SQLServer/201311/22410