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.
This module supports running an SMB server which validates credentials, and then attempts to execute a relay attack against an LDAP server on the configured
RELAY_TARGETS
hosts.It is not possible to relay NTLMv2 to LDAP due to the Message Integrity Check (MIC). As a result, this will only work with NTLMv1. The module takes care of removing the relevant flags to bypass signing.
If the relay succeeds, an LDAP session to the target will be created. This can be used by any modules that support LDAP sessions, like
admin/ldap/rbcd
orauxiliary/gather/ldap_query
.Supports SMBv2, SMBv3, and captures NTLMv1 as well as NTLMv2 hashes. SMBv1 is not supported - please see #16261
Verification Steps
Lab setup
You will need a Domain Controller and a Domain-joined host:
Domain Computer <-> Metasploit framework <-> Domain Controller
Where:
The Domain Computer will need to be configured to use NTLMv1 by setting the following registry key to a value less or equal to 2:
Finally run the relay server on msfconsole, setting the
RELAY_TARGETS
option to the Domain Controller IP address.You will have to coerce the Domain Computer and force it to authenticate to the msfconsole server (see an example below).
Scenarios
Start the relay server
Net use example
A simple test would be using the Windows
net use
command:msfconsole output:
PetitPotam example
Coerce authentication using a non-privileged Domain User account with PetitPotam:
Exploit Resource-based Constrained Delegation (RBCD)
For details about RCBD, see https://docs.metasploit.com/docs/pentesting/active-directory/kerberos/rbcd.html#rbcd-exploitation
admin/dcerpc/samr_account
module and the same Domain User accountadmin/ldap/rbcd
module using the LDAP sessionadmin/kerberos/get_ticket
modulewindows/smb/psexec
module