Module/exploit/CVE-2025-33073 #20578
Closed
+342
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Windows SMB Client Privilege Escalation via DNS Injection, NTLM Relay, and RPC Coercion (CVE-2025-33073)
Description
This PR adds a new exploit module exploit/windows/smb/cve_2025_33073_smb_relay that implements a privilege escalation attack chain exploiting CVE-2025-33073 in Windows SMB clients. The module performs:
DNS record injection using samba-tool to poison resolution for a fake hostname pointing to the attacker's IP.
Starts an NTLM relay server using impacket-ntlmrelayx to capture and relay authentication attempts.
Triggers coercion on the victim machine via rpcping using MS-RPRN RPC calls to force authentication to the attacker's relay server.
This allows an authenticated domain user with admin access to the DNS server (e.g., Domain Controller) to elevate privileges and potentially capture NTLM hashes or execute further actions on the target system (e.g., DC for hash dumping).
The module is written in Ruby and integrates with Metasploit's framework, requiring external tools (samba-tool, impacket-ntlmrelayx, rpcping) available on the host (e.g., Kali Linux). It does not auto-execute payloads post-relay but logs output for manual follow-up.
No existing bugs are fixed; this is a new module.
Submitted from unique branch: module/exploit/cve_2025_33073
Verification
List the steps needed to make sure this thing works
Ensure required tools are installed on the Metasploit host: samba-tool (from Samba), impacket-ntlmrelayx (from Impacket suite), and rpcping (from Windows or RPC tools).
Start msfconsole
use exploit/windows/smb/cve_2025_33073_smb_relay
set ATTACKER_IP <your_ip> (e.g., 192.168.1.100)
set DNS_IP <dns_server_ip> (e.g., 192.168.1.10)
set DC_FQDN <dc_fqdn> (e.g., dc.example.com)
set TARGET <relay_target_ip> (e.g., 192.168.1.10 for DC)
set VICTIM_IP <victim_ip> (e.g., 192.168.1.50)
set SAMBA_USER Administrator (optional, defaults to Administrator)
set SAMBA_PASS (e.g., YourPassword)
set VERBOSE true (to see subprocess logs)
check → Should detect environment suitability and missing tools if any.
run → Module injects DNS record, verifies propagation, starts relay server (logs to ~/.msf4/logs/ntlmrelayx_.log), and triggers coercion.
Verify the thing does what it should:
DNS record relaytrigger.<DC_FQDN> resolves to ATTACKER_IP (check with nslookup).
NTLM relay process starts (PID logged) and runs in background.
RPC coercion command executes without errors (output in verbose).
Monitor relay log for incoming NTLM auth attempts from victim (e.g., hashes captured if relayed to DC).
Verify the thing does not do what it should not:
No crash or hang on invalid inputs (e.g., bad IP → fails with NoAccess/Unreachable).
Relay server auto-terminates on module cleanup (sessions -K or manual kill).
No unauthorized actions without required options set.
Environment mitigations (SMB signing, EPA) prevent relay if enabled (module does not bypass them).
Document the thing and how it works
Documentation added in documentation/modules/exploit/windows/smb/cve_2025_33073_smb_relay.md:
text# CVE-2025-33073 SMB Relay Privilege Escalation
Description
[Full module description from initialize()]
Usage
auxiliary/gather/hashdump
or psexec.Scenarios
References
Demo
As this module requires a complex Active Directory lab setup (Domain Controller, vulnerable Windows clients/servers, no mitigations), I've attached a sanitized PCAP demonstrating successful execution:
Email sent to [email protected] with subject: "CVE-2025-33073 - PR #<this_pr_number> - Sanitized PCAP Demo"
PCAP shows: DNS update query/response, RPC coercion packet to victim, NTLM auth relay to target DC, and hash capture simulation.
Lab: Windows 11 24H2 victim, Server 2022 DC, Kali attacker (all VMs on isolated network).