Skip to content

Back to the category index / Back to the command index

Retrieves the SYSTEM account’s DPAPI credentials and SCCM client secrets from a remote host, then decrypts them with the DPAPI_SYSTEM key.

ItemDetails
Implementationexamples/dpapidump.py
CategorySecrets / DPAPI / registry / file analysis
Size507 lines
DistributionInstalled as a script through scripts=examples/*.py in setup.py

Run python examples/dpapidump.py -h for the current option definitions.

ArgumentDescription
-credsExtract SYSTEM user DPAPI credentials (default: all)
-sccmExtract SCCM client credentials (default: all)
-userkeyDPAPI user key for SYSTEM, for example from a previous secretsdump run; if omitted, retrieve it by dumping LSA secrets
target[[domain/]username[:password]@]
-tsAdd a timestamp to each log message
-debugEnable debug output
-com-versionDCOM version in MAJOR_VERSION:MINOR_VERSION format, for example 5.7
-bootkeyBoot key for the SYSTEM hive
-throttleDelay in seconds between operations
-hashesNTLM hashes in LMHASH:NTHASH format
-no-passDo not prompt for a password (useful with -k)
-kUse Kerberos authentication. Look for matching credentials in the ccache file named by KRB5CCNAME; if none are valid, use those specified on the command line
-aesKeyAES key for Kerberos authentication (128 or 256 bits)
-keytabRead SPN keys from a keytab file
-rpc-auth-levelRPC authentication level: default, integrity (RPC_C_AUTHN_LEVEL_PKT_INTEGRITY), or privacy (RPC_C_AUTHN_LEVEL_PKT_PRIVACY); for example, the CIM path “root/MSCluster” requires privacy by default (choices: integrity, privacy, default)
-dc-ipDomain controller IP address; if omitted, use the domain name (FQDN) from the target parameter
-target-ipTarget machine IP address; if omitted, use the target value. Useful when a NetBIOS target name cannot be resolved

The tool connects over SMB and obtains the boot key and DPAPI_SYSTEM through Remote Registry and LSA. It enumerates target directories and files or SCCM policy information through WMI, matches master key GUIDs to blobs, decrypts them, and displays the results. It applies throttling and restores remote service and connection state on exit.

Reading SYSTEM DPAPI secrets from a remote host first requires the machine boot key and the LSA secret DPAPI_SYSTEM. connect() creates an SMB session, RemoteOperations prepares the required Remote Registry and LSA state, and getDPAPI_SYSTEM() extracts machine and user DPAPI key material.

The credential path enumerates master key and credential files under the system profile over SMB. Each DPAPI_BLOB has a master key GUID, so decideBlobMasterkey() matches it to a retrieved master key. The machine key decrypts that master key, which then decrypts the individual blob. Keeping the steps separate avoids mistaking a GUID or cache mismatch for a simple padding error.

The SCCM path retrieves policy and secret information through DCOM/WMI and passes DPAPI-protected portions through the same key hierarchy. Options determine which of WMI, SMB, and Remote Registry are used. cleanup() restores remote service state, removes temporary files, and closes DCOM connections; throttling controls repeated WMI/SMB requests.

SymbolLocationWhere to trace its responsibility
DumpCreds48__init__(), connect(), getDPAPI_SYSTEM(), getFileContent(), decryptBlob(), decideBlobMasterkey(), addPolicySecret(), dump(), cleanup()
ModuleMain names used
impacketversion
impacket.exampleslogger
impacket.examples.utilsparse_target
impacket.dcerpc.v5.dtypesNULL
impacket.dcerpc.v5.dcomwmi
impacket.dcerpc.v5.dcomrtCOMVERSION, DCOMConnection
impacket.dcerpc.v5.dcom.wmiDCERPCSessionError
impacket.dcerpc.v5.rpcrtRPC_C_AUTHN_LEVEL_PKT_INTEGRITY, RPC_C_AUTHN_LEVEL_PKT_PRIVACY
impacket.smbconnectionSMBConnection
impacket.dpapiCREDENTIAL_BLOB, CredentialFile, DPAPI_BLOB, MasterKey, MasterKeyFile
impacket.uuidbin_to_string
impacket.examples.regsecretsLSASecrets, RemoteOperations
impacket.krb5.keytabKeytab

Output, side effects, and required privileges

Section titled “Output, side effects, and required privileges”
  • The tool primarily makes queries and authentication attempts. Frequent runs can affect audit logs, account lockouts, and target load.
  • Options may create or update local files. Check how existing files are handled and the permissions on output containing secrets.
  • Some paths use temporary resources such as remote services, tasks, files, shares, and WMI/RPC resources. Cleaning them up after an abnormal exit is part of the behavior contract.
  • On failure, use protocol status codes to determine whether name resolution, connection, authentication, service state, or permissions caused the stop.
  • Cleanup-related methods include cleanup(). Check that new early returns and exception paths reach it too.

The code depends on SMBConnection, examples.regsecrets, impacket.dpapi, DCOM/WMI, and RPC authentication levels. DumpCreds.dump() collects data; decideBlobMasterkey() and decryptBlob() choose keys and decrypt blobs.