Rapid7 Vulnerability & Exploit Database

Windows Secrets Dump

Back to Search

Windows Secrets Dump

Created
09/30/2020

Description

Dumps SAM hashes and LSA secrets (including cached creds) from the remote Windows target without executing any agent locally. This is done by remotely updating the registry key security descriptor, taking advantage of the WriteDACL privileges held by local administrators to set temporary read permissions. This can be disabled by setting the `INLINE` option to false and the module will fallback to the original implementation, which consists in saving the registry hives locally on the target (%SYSTEMROOT%\Temp\.tmp), downloading the temporary hive files and reading the data from it. This temporary files are removed when it's done. On domain controllers, secrets from Active Directory is extracted using [MS-DRDS] DRSGetNCChanges(), replicating the attributes we need to get SIDs, NTLM hashes, groups, password history, Kerberos keys and other interesting data. Note that the actual `NTDS.dit` file is not downloaded. Instead, the Directory Replication Service directly asks Active Directory through RPC requests. This modules takes care of starting or enabling the Remote Registry service if needed. It will restore the service to its original state when it's done. This is a port of the great Impacket `secretsdump.py` code written by Alberto Solino.

Author(s)

  • Alberto Solino
  • Christophe De La Fuente
  • antuache

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use auxiliary/gather/windows_secrets_dump
msf auxiliary(windows_secrets_dump) > show actions
    ...actions...
msf auxiliary(windows_secrets_dump) > set ACTION < action-name >
msf auxiliary(windows_secrets_dump) > show options
    ...show and set options...
msf auxiliary(windows_secrets_dump) > run 

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;