
DPAPI Credential Access
Explains decrypting Windows DPAPI secrets in authorized red-team engagements.
Install
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill abusing-dpapi-for-credential-access -g -a claude-code -y- Repository
- mukul975/Anthropic-Cybersecurity-Skills35.4k
- Category
- Security
- Updated
- 2mo ago
- License
- Apache-2.0
- Context cost
- Mediumabout 2,486 tokens
- Runs scripts
- Yes, review before use
What it does
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket's dpapi.py, including domain-wide decryption via the DPAPI backup key. Use during authorized red-team credential-access engagements after gaining a foothold or when triaging DPAPI blobs pulled from a host.
Abusing DPAPI for Credential Access
Legal Notice: This skill is for authorized penetration testing, red-team engagements, and educational purposes only. Extracting credentials from systems you do not own or lack explicit written authorization to test is illegal and may violate computer fraud and abuse laws. Always operate within a signed rules-of-engagement and document every action.
Overview
The Windows Data Protection API (DPAPI) is the operating system's built-in symmetric-encryption service that applications use to protect secrets at rest: saved RDP and Windows Credential Manager credentials, web and Wi-Fi credentials in the Credential Vault, browser saved logins and cookies (Chrome/Edge), KeePass keys, certificate private keys, and Scheduled Task passwords. DPAPI derives a per-user (or per-machine) master key from the user's password (or the machine account secret), and that master key encrypts individual "DPAPI blobs." The encrypted master keys live under %APPDATA%\Microsoft\Protect\<SID>\ (user) and %WINDIR%\System32\Microsoft\Protect\ (machine).
Red teamers abuse DPAPI to recover plaintext secrets after gaining a foothold, mapping to MITRE ATT&CK T1555.004 (Credentials from Password Stores: Windows Credential Manager). There are three primary decryption paths:
- Online / context-based, running as the target user, DPAPI APIs (
CryptUnprotectData) transparently decrypt the user's blobs. SharpDPAPI's/unprotectflag uses this. - Offline with the user password or NTLM hash, decrypt the user's master keys with
/password:or/ntlm:, then decrypt the blobs offline (great for triaged files pulled from a host). - Domain-wide with the DPAPI backup key, Domain Admins can extract the domain's RSA DPAPI backup key (
.pvk) once, then decrypt any domain user's master keys forever, online or offline, with/pvk:.

