Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Tutorial for NTDS goodness (VSSADMIN, WMIS, NTDS.dit, SYSTEM)

I recently performed an internal penetration test where the NTDS.dit file got me thousands of password hashes. After compromising unpatched Microsoft Windows computers on the client's domain, I gained access to a number of domain accounts. Below I'll explain how I did it.

The client had two domain controllers, one Windows 2003 and one Windows 2008. One of the domain accounts obtained via other means (not described by this post) had rights to log-on locally on both domain controllers.

I attempted to dump the Active Directory database, but I couldn't get the SAM file through my usual methods. Eventually, and after much effort, I got the SAM file but found it only contained one hash.

The following actions allowed me to obtain the Active Directory password hashes. This method will work on Windows 2003, Windows 2008 and Windows 2012 servers.

The NTDS.dit file is the Active Directory database. It stores all Active Directory information including password hashes.

I recreated the scenario, to demonstrate it on a Windows 2012 server.


There are various ways of accessing the NTDS.dit file. It can't just be copied when it is in use (similar to a SAM file).

A technology that is included in Microsoft Windows itself is the Volume Snapshot Service or Volume Shadow Copy Service. It requires the partition to run NTFS, and it is the same technology used to
create a Windows backup or automatic system restore point.

The command line utility I used was VSSADMIN.

The command determines whether there are current volume shadow copies that exist or if we need to create one:


As you can see, no shadow copy existed yet. So I created one.

The default path is c:\windows\ntds\ntds.dit. But it could be on any other drive, for example I found it on d:\NTDS\ntds.dit in my test.


I also created the SYSTEM file in path c:\windows\system32\.


A shadow copy of the c: drive had been created.



Next I copied the NTDS.dit file to a place where it could be retrieved on the main (non-shadowed) drive.


Then I did the same with the SYSTEM file.


The two files were then copied to the root of the c: drive.


I used Kali 1.0.5 as my attack platform.


To use the mount command to mount to the default Windows share, I needed cifs-utils on Kali.


Then I mounted the network share.


Next I copied the two files to the attack system.


This can be done remotely without interactively logging-on to the server by using the "wmic" command from any Windows computer. Kali's WMIS package allowed me to do the same.


Next, I ran the VSSADMIN command to list shadows remotely with WMIS.


Next I checked the output.txt file to see what happened.


Then I checked that the root was empty and deleted the previous NTDS.dit and SYSTEM files I copied.


I copied the NTDS.dit file, using WMIS.


Note that the shadow copy folder has three slashes ('\\\').

Next I copied the SYSTEM file using WMIS.


Then I checked whether the files were copied on the previously mounted drive.


My next step was to get the password hashes.

First I needed to download and unzip from



Second, I needed to download and unzip from



Then I compiled and made libesedb.



Here I exported tables from NTDS.dit, using the command esedbdumphash.


Other information could also be exported using esedbexport, but I was only interested in Table 4 where the password hashes are.


This took some time and resulted in the creation of a folder called ntds.dit.export containing a file called datatable.


Then I went to the creddump folder to run the dsdump python script.



From there, I could output the hashes into a file and use my favorite password-cracking tool to recover the passwords.


Latest SpiderLabs Blogs

Welcome to Adventures in Cybersecurity: The Defender Series

I’m happy to say I’m done chasing Microsoft certifications (AZ104/AZ500/SC100), and as a result, I’ve had the time to put some effort into a blog series that hopefully will entertain and inform you...

Read More

Trustwave SpiderLabs: Insights and Solutions to Defend Educational Institutions Against Cyber Threats

Security teams responsible for defending educational institutions at higher education and primary school levels often find themselves facing harsh lessons from threat actors who exploit the numerous...

Read More

Breakdown of Tycoon Phishing-as-a-Service System

Just weeks after Trustwave SpiderLabs reported on the Greatness phishing-as-a-service (PaaS) framework, SpiderLabs’ Email Security team is tracking another PaaS called Tycoon Group.

Read More