Potential Shadow Credentials added to AD Object
This rule detects the modification of the msDS-KeyCredentialLink attribute in an Active Directory Computer or User Object, which could indicate an attacker is creating shadow credentials to gain persistent and stealthy access.
The “Shadow Credentials” attack involves manipulating the msDS-KeyCredentialLink attribute in Active Directory (AD) to gain unauthorized access to user or computer accounts. Attackers can create a key pair, append the raw public key to the attribute, and authenticate as the target object. This technique allows for persistent and stealthy access, as it leverages Kerberos key trust account mapping. The original detection rule was created in January 2022 and last updated in April 2026. This attack abuses control over an object to create the shadow credentials. Defenders should monitor for modifications to the msDS-KeyCredentialLink attribute, especially those not associated with legitimate Azure AD Connect or ADFS provisioning.
Attack Chain
- Initial Access: Attacker gains initial access to a system with sufficient privileges to modify Active Directory objects.
- Discovery: The attacker identifies a target user or computer object within Active Directory to compromise.
- Credential Access: The attacker generates a new key pair.
- Privilege Escalation: The attacker modifies the
msDS-KeyCredentialLinkattribute of the target object to include the attacker’s public key. This requires specific permissions on the target object. - Persistence: The attacker uses the private key to authenticate as the target object, bypassing normal authentication mechanisms.
- Lateral Movement: The attacker uses the compromised account to move laterally within the network, accessing resources and systems.
- Impact: The attacker achieves their objective, such as data exfiltration, system compromise, or further privilege escalation.
Impact
Successful exploitation allows attackers to maintain persistent and stealthy access to Active Directory objects, potentially compromising sensitive accounts and resources. Shadow Credentials can be used to bypass multi-factor authentication and other security controls, leading to significant data breaches or system-wide compromises. Without proper monitoring and alerting, these attacks can remain undetected for extended periods.
Recommendation
- Enable and monitor Windows Security Event Logs, specifically event ID 5136, for modifications to the
msDS-KeyCredentialLinkattribute as described in the rule description. - Deploy the provided Sigma rule to your SIEM to detect suspicious modifications to the
msDS-KeyCredentialLinkattribute, and tune for your environment. - Implement strict access controls and auditing on Active Directory objects, particularly those with sensitive privileges, to prevent unauthorized modifications.
- Investigate any alerts generated by the Sigma rule by examining the
winlog.event_data.ObjectDN,winlog.event_data.SubjectUserName, andwinlog.event_data.AttributeValuefields to determine the legitimacy of the changes. - Follow the triage and analysis steps in the rule’s
notefield to investigate alerts.
Detection coverage 2
Potential Shadow Credentials added to AD Object
highDetects modifications to the msDS-KeyCredentialLink attribute in Active Directory objects, indicative of potential shadow credential attacks.
AD Object Modified with msDS-KeyCredentialLink Containing Suspicious Data
highDetects the addition of base64 encoded data within the msDS-KeyCredentialLink attribute, which is a common characteristic of shadow credential attacks.
Detection queries are kept inside the platform. Get full rules →