AADInternals
- Type
- Infostealer
- Capabilities
- Credential theftSession hijackingPersistencePost exploitationReconnaissanceProcess injection
- Delivery
- Phishing
- Platforms
- WindowsCloud
AADInternals is a dual-use PowerShell toolkit for interacting with and assessing Microsoft Azure Active Directory and hybrid identity infrastructure. It has been abused for credential theft, access-token theft, reconnaissance, and post-compromise manipulation of identity services. Its capabilities include extracting locally stored Azure AD Connect credentials, dumping Windows Local Security Authority secrets, and retrieving encryption keys from ADSync and Active Directory Federation Services servers. It can also validate the existence of user email addresses through public Microsoft APIs and send consent-phishing emails containing links intended to obtain users’ access tokens.
AADInternals supports manipulation of pass-through authentication infrastructure, including registry changes to configure authentication agents. Its PTA spying functionality can inject a malicious DLL into the Azure AD Connect authentication agent service to capture credentials processed by that service. These capabilities affect Windows-based identity servers and connected cloud environments.
Octo Tempest has used AADInternals to manipulate federated identity providers. In March 2024, Storm-0501 used it to federate attacker-controlled domains within compromised Azure tenants and access additional valid accounts. Such federation abuse enables attackers to extend access through compromised identity infrastructure. AADInternals is an administrative and security-assessment tool rather than a distinct malware family.
Associated threat actors
2 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
“Storm-0501 attacked Azure environments using the AADInternals tool to federate attacker-owned domains within compromised tenants.”
“Storm-0501 attacked Azure environments using the AADInternals tool to federate attacker-owned domains within compromised tenants.”
Techniques & procedures
37 distinct techniques documented for this family, organized by ATT&CK tactic.
Reconnaissance
1 technique
Reconnaissance
このツールを使って以下の情報を調査し初期アクセス (Initial access) へと繋げます。 利用サービスの調査 テナント ID の調査 サブドメインの列挙 ユーザの列挙
Initial Access
4 techniques
Initial Access
The implication of this attack was that the threat actors were able to log in and impersonate any Microsoft 365 (M365) user and bypass all requirements for MFA as well as bypass any need to enter a valid password.
Step 6 - Cloud Pivot (Storm-0501 specific) T1078.004, T1098.001, T1098.003, T1484.002, T1537 | Affiliate Compromises Microsoft Entra Connect Sync accounts or hijacks on-prem sessions with cloud admin privileges (no MFA).
APT28 used a URL-shortener to masquerade as a legitimate service and redirect targets to credential harvesting sites; Windshift sent spearphishing emails with links to harvest credentials; AADInternals can send 'consent phishing' emails designed to steal users’ access tokens. | Multiple actors and malware families are described as being delivered via spearphishing/phishing emails containing malicious links (e.g., APT28 used URL shorteners to redirect to credential harvesting sites; APT29 used links to ZIP files; APT33 used links to .hta files; BlackTech used links to cloud services; Wizard Spider used links to Google Drive/free file hosting).
"AADInternals can send 'consent phishing' emails containing malicious links designed to steal users’ access tokens."
Execution
3 techniques
Execution
The content repeatedly describes threat actors and malware using PowerShell to execute payloads, run commands, download additional malware, perform lateral movement, evade defenses, and execute scripts in memory. | Examples include: 'APT28 downloads and executes PowerShell scripts and performs PowerShell commands'; 'APT3 has used PowerShell on victim systems to download and run payloads after exploitation'; 'TA505 has used PowerShell to download and execute malware and reconnaissance scripts.'
Let's authorize a Microsoft public client application using Python. In this example, we will complete an device authorization grant flow as the Azure CLI public client application.
APT29 has leveraged the Microsoft Graph API to perform various actions across Azure and M365 environments. They have also utilized AADInternals PowerShell Modules to access the API
Persistence
9 techniques
Persistence
The implication of this attack was that the threat actors were able to log in and impersonate any Microsoft 365 (M365) user and bypass all requirements for MFA as well as bypass any need to enter a valid password.
Step 6 - Cloud Pivot (Storm-0501 specific) T1078.004, T1098.001, T1098.003, T1484.002, T1537 | Affiliate Compromises Microsoft Entra Connect Sync accounts or hijacks on-prem sessions with cloud admin privileges (no MFA).
Calling an organization’s help desk and socially engineering the help desk to reset the user’s password and/or change/add a multi-factor authentication token/factor... Addition of MFA methods to existing users.
During the 2015 Ukraine Electric Power Attack, Sandworm Team modified in-registry Internet settings to lower internet security before launching rundll32.exe ... AADInternals can modify registry keys ... ADVSTORESHELL is capable of setting and deleting Registry values ... [many additional examples].
They use these tools to perform enumeration of the victim’s Azure environment, backdooring active directory, various persistence techniques and lateral movement.
AADConnect PS > Import-Module AADInternals AADConnect PS > Install-AADIntPTASpy 1. TA injects malicious DLL in “AzureADConnectAuthenticationAgentService”
For identity-based persistence, Octo Tempest targets federated identity providers using tools like AADInternals to federate existing domains, or spoof legitimate domains by adding and then federating new domains.
“By default, there is one and only one attribute that is written from an Entra user to an Active Directory user and that is the searchableDeviceKey -> msDS-KeyCredentialLink attribute flow… an abuse primitive known as ‘Shadow Credentials’… if we can add a public key to the msDS-KeyCredentialLink attribute of a user, we can obtain a TGT for that user with the private key.”
one of the techniques utilised by the threat actors to gain control of a victim's Azure Active Directory (AAD) was to create an AAD backdoor through identity federation.
Privilege Escalation
5 techniques
Privilege Escalation
The implication of this attack was that the threat actors were able to log in and impersonate any Microsoft 365 (M365) user and bypass all requirements for MFA as well as bypass any need to enter a valid password.
Step 6 - Cloud Pivot (Storm-0501 specific) T1078.004, T1098.001, T1098.003, T1484.002, T1537 | Affiliate Compromises Microsoft Entra Connect Sync accounts or hijacks on-prem sessions with cloud admin privileges (no MFA).
Calling an organization’s help desk and socially engineering the help desk to reset the user’s password and/or change/add a multi-factor authentication token/factor... Addition of MFA methods to existing users.
Uses AADInternals to create a federated-domain backdoor.
AADConnect PS > Import-Module AADInternals AADConnect PS > Install-AADIntPTASpy 1. TA injects malicious DLL in “AzureADConnectAuthenticationAgentService”
Stealth
4 techniques
Stealth
To be a little sneakier, let’s now remove the service and agent completely.
The implication of this attack was that the threat actors were able to log in and impersonate any Microsoft 365 (M365) user and bypass all requirements for MFA as well as bypass any need to enter a valid password.
Step 6 - Cloud Pivot (Storm-0501 specific) T1078.004, T1098.001, T1098.003, T1484.002, T1537 | Affiliate Compromises Microsoft Entra Connect Sync accounts or hijacks on-prem sessions with cloud admin privileges (no MFA).
The requests covered directory-wide discovery targets: ... servicePrincipals ... applicationRefs / other app objects ... applications ... oauth2PermissionGrants ... app role assignments.
Defense Impairment
5 techniques
Defense Impairment
During the 2015 Ukraine Electric Power Attack, Sandworm Team modified in-registry Internet settings to lower internet security before launching rundll32.exe ... AADInternals can modify registry keys ... ADVSTORESHELL is capable of setting and deleting Registry values ... [many additional examples].
Uses AADInternals to create a federated-domain backdoor.
For identity-based persistence, Octo Tempest targets federated identity providers using tools like AADInternals to federate existing domains, or spoof legitimate domains by adding and then federating new domains.
“By default, there is one and only one attribute that is written from an Entra user to an Active Directory user and that is the searchableDeviceKey -> msDS-KeyCredentialLink attribute flow… an abuse primitive known as ‘Shadow Credentials’… if we can add a public key to the msDS-KeyCredentialLink attribute of a user, we can obtain a TGT for that user with the private key.”
one of the techniques utilised by the threat actors to gain control of a victim's Azure Active Directory (AAD) was to create an AAD backdoor through identity federation.
Credential Access
14 techniques
Credential Access
Using Mimikatz, the attacker exfiltrates the PRT token from memory (LSASS).
A legacy Entra ID endpoint kept alive for Office 2013 clients lets attackers spray passwords past Smart Lockout, confirm valid credentials on MFA-protected accounts, and leave only partial logs behind.
When executed, ConvertTo-AADIntBackdoor modifies the federation settings of a domain by adding or changing the federation configuration to allow an attacker to control the authentication process. This manipulation enables the creation of security tokens that can impersonate any user within the Azure AD tenant. Annotations ID Technique Tactic T1212 Exploitation for Credential Access Persistence
Token Theft ROADtools AADInternals TokenTactics PRT theft OAuth / Device Code Device code phishing Illicit consent grant
Pass-the-Cookie ... involves directly stealing the PRT cookie from the compromised local AAD user ... to exfiltrate a PRT cookie associated with a compromised local AAD user and impersonate their identity.
"AADInternals can gather unsecured credentials for Azure AD services, such as Azure AD Connect, from a local machine."
AADInternals can gather unsecured credentials for Azure AD services, such as Azure AD Connect, from a local machine... Agent Tesla has the ability to extract credentials from configuration or support files... APT33 has used a variety of publicly available tools like LaZagne to gather credentials.
For identity-based persistence, Octo Tempest targets federated identity providers using tools like AADInternals to federate existing domains, or spoof legitimate domains by adding and then federating new domains.
“By default, there is one and only one attribute that is written from an Entra user to an Active Directory user and that is the searchableDeviceKey -> msDS-KeyCredentialLink attribute flow… an abuse primitive known as ‘Shadow Credentials’… if we can add a public key to the msDS-KeyCredentialLink attribute of a user, we can obtain a TGT for that user with the private key.”
one of the techniques utilised by the threat actors to gain control of a victim's Azure Active Directory (AAD) was to create an AAD backdoor through identity federation.
Octo Tempest is a financially motivated collective... known for launching wide-ranging campaigns that prominently feature adversary-in-the-middle (AiTM) techniques... Navigate to a site configured with a fake login portal using an adversary-in-the-middle toolkit.
Essentially, to generate fake events and send them into Azure sign-in logs, the attacker needs to get a service access token... The attacker then use this token to get a blob storage URL with a SAS token... uploads the “fake” events to blob storage.
Retrieve ADFS token signing and encrypting certificates. This is a precursor to the Golden SAML attack (T1606.002).
The threat actor then abuses this federation to generate forged valid security assertion markup language (SAML) tokens for any user of the target tenant with claims that have MFA satisfied, a technique known as Golden SAML.
Discovery
6 techniques
Discovery
The way that AD FS stores its configuration encryption key involves the use of a Distributed Key Manager (DKM) container which is located in the DC... To summarize the LDAP Object query... thumbnailPhoto attribute is AD FS’ DKM LDAP query example to retrieve the AD FS DKM
The requests covered directory-wide discovery targets: ... servicePrincipals ... groups ... directoryRoles ... applications ... devices ... users ... oauth2PermissionGrants ... tenantDetails ... This pattern is consistent with automated tenant mapping.
“ROADrecon's gather command uses aiohttp by default and walks every directory object type” and produces “Bulk enumeration across every object type ROADrecon knows.”
Annotations ID Technique Tactic T1482 Domain Trust Discovery Discovery
The requests covered directory-wide discovery targets: ... servicePrincipals ... applicationRefs / other app objects ... applications ... oauth2PermissionGrants ... app role assignments.
Notably toolkits like ROADtools and AADInternals use this API to gather deep insights into the tenant... Gathering information for a whole tenant requires a lot of requests to different endpoints... I created a hunting query which you can use to find ROADtools based on the endpoints the default gather parameter requests.
Lateral Movement
2 techniques
Lateral Movement
Yuya Chudo ... showed how to abuse a hardcoded rarely known exclusion in Conditional Access (CA) for device compliance in combination with the undocumented “FOCI-Feature” in Entra ID.
Possessing a PRT token and decrypted session key enables an adversary to generate PRT cookies and authenticate as the AAD user, thereby accessing cloud resources and services in AAD/ARM.
Collection
1 technique
Collection
Octo Tempest is a financially motivated collective... known for launching wide-ranging campaigns that prominently feature adversary-in-the-middle (AiTM) techniques... Navigate to a site configured with a fake login portal using an adversary-in-the-middle toolkit.
Command and Control
1 technique
Command and Control
Annotations ID Technique Tactic T1071.001 Web Protocols Privilege Escalation Command and Control Delivery Exploitation Installation
Recent activity
18 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.