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. First, it reads as much data as possible from the registry and then save the hives locally on the target (%SYSTEMROOT%\Temp\random.tmp). Finally, it downloads the temporary hive files and reads the rest of 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

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

;