Credential Dumping via Esentutl.exe
Attackers utilize the legitimate Windows utility esentutl.exe to perform unauthorized copies of the SAM and ntds.dit files for offline credential extraction, facilitating privilege escalation and lateral movement.
The esentutl.exe utility is a legitimate Windows binary designed for database maintenance, specifically for the Extensible Storage Engine (ESE). Threat actors frequently abuse this binary to bypass security controls by performing unauthorized copies of sensitive credential databases, including the Security Account Manager (SAM) hive and the Active Directory database (ntds.dit). By creating an offline copy of these files, attackers can perform offline password cracking or extract secrets, significantly increasing the risk of lateral movement and full domain compromise. This technique is categorized as "Living off the Land" (LotL), as it relies on signed, native system tools that are often overlooked by standard signature-based antivirus solutions. Defenders should focus on process execution patterns where esentutl.exe interacts with these high-value files to identify potential credential dumping activity.
Attack Chain
- Attacker gains initial access to a Windows system via phishing or exploitation.
- Attacker performs local enumeration to identify system paths for sensitive files.
- Attacker executes
esentutl.exevia command line with administrative privileges. - The utility is invoked with parameters targeting
%SystemRoot%\System32\config\SAMorntds.dit. esentutl.execreates a volume shadow copy or a direct database copy of the targeted file.- The copied file is staged in a temporary directory such as
C:\Windows\Tempor\Users\Public. - Attacker exfiltrates the staged file to a remote server for offline analysis.
- Attacker uses tools like Mimikatz or Impacket to extract credentials from the dumped files to escalate privileges.
Impact
Successful execution of this technique leads to the acquisition of NTLM hashes or plaintext credentials for local or domain-level accounts. This outcome enables attackers to move laterally across the network, escalate privileges, and maintain long-term persistent access. If compromised credentials include domain administrative accounts, the entire Active Directory forest is at risk of full control and data exfiltration.
Recommendation
Prioritize the identification of esentutl.exe command-line patterns that reference sensitive database files.
- Deploy the provided Sigma rule to detect process execution of
esentutl.exetargeting SAM or ntds.dit. - Configure EDR telemetry to capture full command-line arguments for all executions of
esentutl.exe. - Monitor for abnormal file creation events in common staging locations (e.g.,
C:\Windows\Temp,C:\Users\Public). - Restrict administrative access to systems and implement "Credential Guard" on domain-joined endpoints to mitigate the utility of extracted hashes.
Immediate actions
Deploy Sigma detection rule to monitor for esentutl.exe usage
Mitigations
Enable Credential Guard on all endpoints
Credential dumping techniques
Detection coverage 1
Detect Esentutl SAM or NTDS Copy
mediumDetects the execution of esentutl.exe with command-line arguments targeting the SAM or NTDS database files, commonly used for credential dumping.
Detection queries are available on the platform. Get full rules →