IF_ENFORCEENCRYPTICERTREQUEST CA flag must be turned off. In BloodHound, this configuration is revealed by the “RPC Encryption Enforced” (rpcencryptionenforced) property on the EnterpriseCA node.
Click on Relay Targets to view vulnerable enterprise CA servers that enable certificate enrollment for the target computer via RPC endpoints.
Abuse Info
This section provides general guidance about abusing this edge. For detailed instructions, see references at the end of this article.Linux
1
Start the Relay Server
The NTLM relay can be executed with ntlmrelayx.py. To relay to the enterprise CA via RPC endpoints and enroll a certificate, specify the RPC endpoint as the target and use the arguments:
2
Coerce the Target Computer
Several coercion methods are documented here: Windows Coerced Authentication Methods.Every coercion technique has prerequisites that must be met on the target. The following command uses Manticore Coercer to attempt all relevant SMB coercion techniques. Success depends on the prerequisites for at least one technique being met.
3
Perform Certificate Authentication
Authenticate using the certificate obtained as the target principal, for example by using Certipy.
Windows
1
Start the Relay Server on Linux
There is currently no publicly available Windows tool that supports relaying NTLM authentication to an AD CS RPC enrollment endpoint. Start the relay server on a Linux host using ntlmrelayx.py. To relay to the enterprise CA via RPC and enroll a certificate, specify the RPC endpoint as the target and use the following arguments:
2
Coerce the Target Computer
Several coercion methods are documented here: Windows Coerced Authentication Methods.Every coercion technique has prerequisites that must be met on the target. The following command uses Manticore Coercer to attempt all relevant SMB coercion techniques. Success depends on the prerequisites for at least one technique being met.
3
Perform Certificate Authentication
Authenticate using the certificate obtained as the target principal, for example by using Rubeus.
Opsec Considerations
Coercion Attempts
Runningmanticore-coercer with --always-continue --path-type smb attempts all relevant SMB coercion techniques and is not stealthy.
Attempting many techniques increases observable activity. For better OPSEC, use individual techniques whose prerequisites you have verified on the target.
Detection of NTLM Relay
NTLM relayed authentications can be detected by login events where the IP address does not match the computer’s actual IP address. This detection technique is described in the blog post: Detecting NTLM Relay Attacks.Detection of Certificate Usage
Authentication using the obtained certificate is another detection opportunity. If Kerberos authentication is used, a domain controller will generate Windows Event ID 4768 (“A Kerberos authentication ticket (TGT) was requested”). This event will include the attacker’s IP address rather than the target computer’s IP address. Similarly, for Schannel authentication, Event ID 4624 will reveal the incorrect IP address. These detection techniques are described in detail under DETECT2 in the whitepaper: Certified Pre-Owned.Edge Schema
Source:Authenticated Users, GroupDestination: Computer
Traversable: ✅
References
- Relaying to AD Certificate Services over RPC
- Exploiting Active Directory Certificate Services - ESC11 Walkthrough
- Hackndo: NTLM relay
- Microsoft: NTLM Overview
- Relay Your Heart Away: An OPSEC-Conscious Approach to 445 Takeover
- Windows Coerced Authentication Methods
- Manticore Coercer
- Rubeus
- Certipy
- Beyond the Basics: Exploring Uncommon NTLM Relay Attack Techniques
- I’m bringing relaying back: A comprehensive guide on relaying anno 2022
- ntlmrelayx.py
- Detecting NTLM Relay Attacks
- Certified Pre-Owned: Abusing Active Directory Certificate Services