ThreatMon Blog
  • Platform
  • Intelligence Modules
    • Cyber Threat Intelligence
    • Attack Surface Management
    • Digital Risk Protection
  • Resources
    • Blog
    • Reports
  • Company
    • About Us
    • Term & Use
    • Privacy Policy
  • Platform
  • Intelligence Modules
    • Cyber Threat Intelligence
    • Attack Surface Management
    • Digital Risk Protection
  • Resources
    • Blog
    • Reports
  • Company
    • About Us
    • Term & Use
    • Privacy Policy
No Result
View All Result
ThreatMon Blog
No Result
View All Result

Home » PetitPotam (MS-EFSRPC) Exploit – CVE2021-36942

PetitPotam (MS-EFSRPC) Exploit – CVE2021-36942

ibrahim mestav by ibrahim mestav
August 15, 2023
in General
0
petitpotam-ms-efsrpc-exploit-cve2021-36942
594
SHARES
3.3k
VIEWS
Share on FacebookShare on Twitter

PetitPotam (MS-EFSRPC) Exploit – Summary

PetitPotam Exploit needs Active Directory Certificate Services, specifically the default settings behind the Web Enrollment service because of this Vulnerability. Adversaries can achieve full Domain Admin (DC) takeover of a target Active Directory by using PetitPotam, which takes attention among Ransomware Gangs, they are able to use this Vulnerability to get DC server and make a Group Policy to spread their Ransomware all of the Internal Network. The adversary can send requests to a Domain Controller using PetitPotam for NTLM relay credentials to a host chosen by the attacker. The Domain Controller’s NTLM Credentials can then be relayed to the Active Directory Certificate Services (AD CS) Web Enrollment pages, and DC Server certificate can be enrolled. This certificate can then be used to request a Ticket Granting Ticket and compromise the entire domain through DCsync and Pass The Ticket. AD CS (Active Directory Certificate Services) offers role services that by default accept NTLM-based authentication which it’s abused in this attack. These services specifically include Certificate Authority Web Enrollment and the Certificate Enrollment Web Service.

Attack Steps and Demonstrations

  1. Use PetitPotam to trigger NTLM authentication from the Domain Controller to the Listener attacker machine this time it’s Kali Linux (Running Responder or ntlmrelayx)
  2. Use ntlmrelayx to relay the DC’s credentials to the AD CS (Active Directory Certificate Services) server with default Web Enrollment enabled (NTLM authentication must be enabled and it’s enabled by default), using the “KerberosAuthentication” or “DomainControllers” AD CS template on settings of ntlmrelayx.
  3. Obtain Base64 PKCS12 Certificate captured via NTLM relaying attack
  4. Use the Base64 PKCS12 cert to import to Kekeo (manipulate Microsoft Kerberos) to ask for a TGT (Ticket Granting Ticket)
  5. Use Mimikatz to perform DCsync and dump LSA secrets for the user of choice (Administrator, Krbtgt etc.)
  6. Note down the NT hash from the domain administrator user we will use on Pass The Hash.
  7. Use wmiexec to gain execution as that user against the Domain Controller and perform Pass The Hash attack
  8. Congratulations if everything goes normal you got a Reverse Shell on Domain Administrator !!

PoC Video

https://www.youtube.com/embed/HHdVp_EkuwU?feature=oembed

Attack Flowchart

Conclusion

This attack allows for instant Privilege Escalation from low privileged user to domain administrator. This is a critical security hole for companies and during our research on DarkNet adversaries begin to abuse this Vulnerability widely.

Mitigating NTLM Relay Attacks on Active Directory Certificate Services (AD CS) – ADV210003 – KB5005413 – PetitPotam

Block Outbound Traffic From DC’s

Blocking connections by DC to arbitrary services and hosts is an effective mitigation. DC’s should only initiate connections to well-known destinations like other Domain Controllers or hosts that are classified to be necessary for such communication. If it’s implemented in the domain, outbound connections should be limited to tier 0 hosts and services.

Block [MS-ESFR] (EFSRPC) Using RPC Filters

Use RPC filters to block MS-EFSR by creating filter rules to block the known UUID’s for \pipe\lsarpc and \pipe\efsrpc using this command: netsh.exe -f block_efsr.txt For the full list of block_efsr.txt : https://gist.github.com/whichbuffer/8c16d0a394be36bf525aca85e4dd652b Remove the listed role services if not justified by a business need. In most cases, the affected services are replaceable by other API/interfaces such as the built-in RPC interfaces. Restrict/disable inbound NTLM authentication to the server running the role service by setting the policy “Network security: Restrict NTLM: Incoming NTLM traffic”. Disable/remove the NTLM provider in the Internet Information Services (IIS) running the selected role services. Enabling Extended Protection for Authentication (EPA) And Require TLS on the selected role services.
  • Enable strict network access control to the selected service.
  • Always enable TLS for proper transport and session protection.
Microsoft has released ADV210003 and KB5005413 in response to the published POC.

Links & Further Research

  • https://www.exandroid.dev/2021/06/23/ad-cs-relay-attack-practical-guide/
  • https://posts.specterops.io/certified-pre-owned-d95910965cd2
  • https://isc.sans.edu/forums/diary/Active+Directory+Certificate+Services+ADCS+PKI+domain+admin+vulnerability/27668/
  • https://www.blumira.com/ntlm-relay-attack-petitpotam/
  • https://www.bussink.net/ad-cs-exploit-via-petitpotam-from-0-to-domain-domain/
  • https://github.com/topotam/PetitPotam
  • https://github.com/gentilkiwi/mimikatz
  • https://github.com/gentilkiwi/kekeo
  • https://github.com/ExAndroidDev/impacket/tree/ntlmrelayx-adcs-attack
  • https://github.com/SecureAuthCorp/impacket
Previous Post

FluBot Android Malware Technical Analysis

Next Post

REvil Ransomware Malware Analysis 

Next Post
revil-ransomware-malware-analysis

REvil Ransomware Malware Analysis 

Recommended

iranian-threat-actor-mercury-exploits-log4j-2-vulnerabilities-in-unpatched-systems (1) (1)

Iranian Threat Actor MERCURY Exploits Log4j 2 Vulnerabilities in Unpatched Systems

September 12, 2023
the-fake-internet-download-manager-chrome-extension-has-been-downloaded-over-200000-times

​The fake ‘Internet Download Manager’ Chrome Extension Has Been Downloaded Over 200,000 Times

August 5, 2023

Popular Story

  • chatgpt-and-malware-analysis-threatmon

    ChatGPT and Malware Analysis – ThreatMon

    977 shares
    Share 391 Tweet 244
  • ChatGPT and Cyber Security in 15 Questions: Impacts, Benefits and Harms

    777 shares
    Share 311 Tweet 194
  • TA558 APT Group Uses Malicious Microsoft Compiled HTML Help Files

    751 shares
    Share 300 Tweet 188
  • What is SMTP Open Mail Relay Vulnerability?

    727 shares
    Share 291 Tweet 182
  • The Importance of Attack Surface Management for Organizations

    678 shares
    Share 271 Tweet 170

Intelligence Modules

Cyber Threat Intelligence Attack Surface Management Digital Risk Protection

Resources

Blog Reports

Platform

Discover the platform

Company

About Us Terms & Use Privacy Policy

Blog

The Importance of Attack Surface Management for Organizations ChatGPT and Malware Analysis – ThreatMon TA558 APT Group Uses Malicious Microsoft Compiled HTML Help Files
threatmon-logo

Copyright © 2023

No Result
View All Result
  • Platform
  • Intelligence Modules
    • Cyber Threat Intelligence
    • Attack Surface Management
    • Digital Risk Protection
  • Resources
    • Blog
    • Reports
  • Company
    • About Us
    • Term & Use
    • Privacy Policy

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

Advanced Threat Intelligence Platform
Get 30 Days Free Trial
Get 30 Days Free Trial