Skip to content
Memory corruption Write-up Advanced

LDAP Nightmare (CVE-2024–49113): Exploit Behavior Overview

A vulnerability in Windows domain controllers allows an attacker to send a crafted LDAP referral that points to a malicious server, causing the LSASS process to crash or potentially execute arbitrary code. An attacker could trigger a system reboot or gain remote code execution.

medium.com

Published on medium.com

Recently, SafeBreach published a proof-of-concept (PoC) exploit for the vulnerability LDAP Nightmare (CVE-2024–49113) on their GitHub repository. Intrigued by its technical details and potential impact, I decided to delve deeper into this PoC to better understand its inner workings.

S4lazaar, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could crash the LSASS process and cause a system reboot, or potentially achieve remote code execution.

What the attacker needed

Victim RPC port accessible; Attacker controls DNS server; Attacker controls LDAP server

The fix

Apply Microsoft's security patches and restrict LDAP and RPC traffic, disable untrusted LDAP referrals, and monitor for unusual LDAP queries.

How it was found

  1. Send a DsrGetDcNameEx2 RPC request to the victim domain controller with a malicious domain name.
  2. The victim performs a DNS SRV query to locate the LDAP service for that domain, which the attacker's DNS server answers with the attacker's host.
  3. If the hostname cannot be resolved, the victim may send an NBNS query, and the attacker responds with its own IP address.
  4. The victim connects to the attacker's LDAP server and sends an LDAP query.
  5. The attacker's LDAP server responds with a SearchResultDone packet containing a referral to a malicious URL.
  6. The victim processes the referral, leading to a crash or potential code execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Domain controllers are servers that manage logins and security in Windows networks. This bug lets an attacker trick a domain controller into following a malicious link, which can crash a critical system process and force a reboot, or even let the attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.