A French security researcher, Gilles Lionel, discovered a new NTLM relay attack he has dubbed PetitPotam. Giles published a proof-of-concept (PoC) to his GitHub account on July 18th. Giles noted that the flaw works by forcing “Windows hosts to authenticate to other machines via MS-EFSRPC EfsRpcOpenFileRaw function.”
The attack “enables a domain controller (DC) to authenticate against a remote NTLM under a bad actor’s control using the MS-EFSRPC interface and share its authentication information. This is done by connecting to LSARPC, resulting in a scenario where the target server connects to an arbitrary server and performs NTLM authentication.”
- Windows servers with NTLM enabled and using Active Directory Certificate Services (AD CS) with the following services:
- Certificate Authority Web Enrollment, or
- Certificate Enrollment Web Service
Successful exploitation gives an attacker an authentication certificate that can be used to access domain services as a DC and the potential to compromise the entire domain.
To mitigate this attack, Microsoft released KB5005413 on July 23rd. Microsoft states that the preferred mitigation measure is to “disable NTLM authentication on your Windows domain controller as the simplest mitigation. This can be accomplished by following the documentation in Network security: Restrict NTLM: NTLM authentication in this domain.”
Microsoft also provided additional mitigations if you are unable to disable NTLM for compatibility reasons. They are listed in order of more secure to less secure:
- Disable NTLM on any AD CS Servers in your domain using the group policy Network security: Restrict NTLM: Incoming NTLM traffic.
- Disable NTLM for Internet Information Services (IIS) on AD CS Servers in your domain running the “Certificate Authority Web Enrollment” or “Certificate Enrollment Web Service” services.
To see implementation details for either of these workarounds, Deepwatch recommends referring to Microsoft’s guidance provided by KB5005413.
Learn more about Deepwatch Managed Detection and Response here.