abusing-shadow-credentials-for-privesc
できること
このツールにより、攻撃者はActive Directoryのアカウントを完全に乗っ取ることができます。対象アカウントに偽の公開鍵を追加し、パスワードなしで被害者になりすますことを可能にします。
使う場面
- ✓ネットワークのマッピングツールで、アカウント情報を変更できることがわかったとき。
- ✓パスワード変更の通知を発生させずに、こっそりアカウントを乗っ取りたいとき。
- ✓コンピュータアカウントにアクセスし、それを使って他のリソースにアクセスしたいとき。
スキルのリンク
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/abusing-shadow-credentials-for-privesc/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“誰にも気づかれずに「user1」アカウントを乗っ取るにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
ツールは「Shadow Credentials」と呼ばれるセキュリティ設定を悪用します。対象アカウントに偽のアクセスキーを追加します。このキーを使うと、攻撃者は被害者として認証し、暗号化されたパスワードを取得できます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Abusing Shadow Credentials for Privilege Escalation
Legal Notice: This skill is for authorized security testing and educational purposes only. Shadow Credentials grant full takeover of the targeted account. Use only against systems you own or are explicitly authorized in writing to test. Unauthorized access is a crime.
Overview
The Shadow Credentials technique abuses the msDS-KeyCredentialLink attribute of Active Directory user and computer objects. This attribute stores raw public keys ("Key Credentials") used by Windows Hello for Business and Azure AD device registration for passwordless certificate-based logon via PKINIT (Public Key Cryptography for Initial Authentication in Kerberos). If an attacker has write permission over a target object's msDS-KeyCredentialLink — typically granted by GenericWrite, GenericAll, WriteProperty, or AddKeyCredentialLink ACEs surfaced in BloodHound — they can append their own attacker-generated public key. They then request a TGT for the target via PKINIT using the matching private key and recover the target's NT hash, achieving complete account takeover without resetting the password, which is far stealthier than a forced password reset.
The technique was published by Elad Shamir ("Shadow Credentials: Abusing Key Trust Account Mapping for Account Takeover") and implemented in the C# tool Whisker. The Python equivalent pyWhisker (ShutdownRepo) manipulates the attribute over LDAP, and Certipy integrates the entire chain via certipy shadow auto. The target environment must support PKINIT and have at least one Domain Controller running Windows Server 2016 or later. Sources: pyWhisker, Whisker, The Hacker Recipes — Shadow Credentials.
When to Use
- When BloodHound reveals
GenericWrite/GenericAll/AddKeyCredentialLinkover a higher-value user or computer - As a stealthier alternative to
ForceChangePassword(no password reset = less disruption/alerting) - To take over a computer account to chain into Resource-Based Constrained Delegation (RBCD)
- During red-team operations needing account takeover without locking out the legitimate user
- For purple-team exercises generating
msDS-KeyCredentialLinkmodification telemetry
Prerequisites
- Authorized engagement scope including AD credential-access techniques
- Control of a principal with write access to the target's
msDS-KeyCredentialLink - A DC running Windows Server 2016+ with PKINIT enabled (domain functional level supporting Key Trust)
- Network reachability to LDAP (389/636) and Kerberos (88) on a DC
- Linux attack host with Python 3.8+; install the tooling:
# pyWhisker (from source) git clone https://github.com/ShutdownRepo/pywhisker cd pywhisker && pip install . # Certipy (integrated shadow attack) pipx install certipy-ad # PKINITtools for manual TGT/NT-hash extraction git clone https://github.com/dirkjanm/PKINITtools
Objectives
- Confirm write access over a target's
msDS-KeyCredentialLink - Generate a key pair and append a Key Credential to the target object
- Request a TGT for the target via PKINIT using the new key
- Recover the target's NT hash for pass-the-hash / further movement
- Clean up the injected Key Credential to restore the object's state
- Document the ACL path that enabled the attack for remediation
MITRE ATT&CK Mapping
| ID | Technique | Application in this skill |
|---|---|---|
| T1098.005 | Account Manipulation: Device Registration | Writing an attacker-controlled Key Credential (device key) to msDS-KeyCredentialLink to register an alternate authentication credential for the target account |
Workflow
Step 1: Confirm the write primitive
List existing Key Credentials on the target to verify you have the required access. An empty or readable result confirms write access for the add step.
python3 pywhisker.py -d "corp.local" -u "attacker" -p "Passw0rd!" \
--target "victim" --action "list"
Step 2: Add a Shadow Credential with pyWhisker
Generate a certificate/key pair and write it into the target's msDS-KeyCredentialLink. pyWhisker outputs a PFX you control.
python3 pywhisker.py -d "corp.local" -u "attacker" -p "Passw0rd!" \
…
よくある質問
これは合法ですか?
いいえ。システムをテストする明示的な書面による許可がない限り違法です。許可のないシステムで使うのは犯罪です。
被害者のパスワードは必要ですか?
いいえ。まさにパスワードなしで制御を得ることが目的です。
Active Directoryとは何ですか?
多くの企業が、ネットワーク上のコンピュータやユーザーを管理するために使っているシステムです。
詳細
作者による元の説明
Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target's NT hash without a password reset. Use when BloodHound shows GenericWrite/GenericAll/AddKeyCredentialLink over a target, as a stealthier alternative to ForceChangePassword, during autho
人気
- GitHubのスター
- 35k
- ランキング
- #7592
- ライセンス
- Apache-2.0
- 更新日
- 2026/8/31
コメント
- …
このリポジトリの他のスキル
abusing-dpapi-for-credential-access
35k特定のタスク向けに用意された指示をAIエージェントに与え、より良く、より速く作業できるようにします。
achieving-cmmc-level-2-compliance
35kエージェントがCMMC Level 2への準拠に向けた環境を整えられるようにします。セキュリティ要件を実装し、必要なドキュメントを管理します。
acquiring-disk-image-with-dd-and-dcfldd
35kエージェントがハードディスクの完全なコピーを作成できるようにします。調査中に情報が失われたり改変されたりしないようにするのに役立ちます。
analyzing-active-directory-acl-abuse
35kエージェントがネットワークの脆弱なセキュリティ設定を見つけられるようにします。攻撃者が不正にアクセスする可能性のある経路を調べます。
似ているスキル
obsidian-vault-maintainer
394kObsidianと相性のよいメモリボールトを整理して、動くウィキリンク、統一されたプロパティ、安全に生成されるセクションを保つようエージェントを支援します。
wiki-maintainer
394k同じ内容を繰り返し保てるページ、安全な管理ブロック、矛盾や抜けの確認を使って、OpenClawのメモリウィキを維持するようエージェントを支援します。
obsidian
394k公式のObsidianコマンドラインを使って、Obsidianのメモ、タスク、リンク、プロパティを読み、検索し、作成し、編集するようエージェントを支援します。