
SafeBreaches CVE-2024-49113 POC(LdapNightmare) Integrated into Metasploit
SafeBreaches CVE-2024-49113 POC(LdapNightmare) Integrated into Metasploit
This module implements CVE-2024-49113, a critical vulnerability in the Windows LDAP client that can cause system instability. The module integrates with the Metasploit Framework, providing a reliable way to test system resilience against this vulnerability.
ldaptor
impacket
Install the required Python packages:
pip install -r requirements.txt
Place the module in your Metasploit modules directory:
cp ldapnightmare.py /path/to/metasploit/modules/auxiliary/dos/windows/ldap/
Ensure the module is executable:
chmod +x ldapnightmare.py
Start msfconsole:
msfconsole
Load and configure the module:
use auxiliary/dos/windows/ldap/ldapnightmare
set RHOSTS target_ip
set RPORT 49664
set LPORT 389
set DOMAINNAME yourdomain.com
run
RHOSTS - Target address (required)RPORT - Target port for RPC (default: 49664)LPORT - Local port for LDAP server (default: 389)DOMAINNAME - Attacker's domain name (required). This domain must have specific DNS SRV records configured (see Domain Configuration below)ACCOUNT - Target account name (default: Administrator)SITENAME - Target site name (default: empty)The DOMAINNAME parameter requires specific DNS SRV records to be configured. The domain must have two SRV records under it:
ldap.tcp.dc._msdcs.domain_name → listen_port attacker's_machine_hostnameldap.tcp.default-first-site-name._sites.dc._msdcs.domain_name → listen_port attacker's_machine_hostnameImportant Note: The attacker's machine hostname will work only if the victim server can resolve it using NBNS. Alternatively, you can replace the hostname with a domain name that points to the IP address of your LDAP server.
The module operates in three main stages:
This module is intended for authorized security testing and research purposes only. Users must obtain proper authorization before testing any systems they don't own or have permission to test.
This module is released under the BSD 3-Clause License.
This work contains code derived from:
Full license texts can be found in the LICENSES file.