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 PR fixes an issue in the lookup logic when providing a Kerberos ticket as a file. The comparison of the SPN hostname was done case sensitive, which prevents the ticket to be used if the user sets the
*::rhostname
option with a different case than the one stored in the ticket.Verification
First, generate a service ticket using uppercase SPN hostname for the CIFS service.
msfconsole
use admin/kerberos/get_ticket
run action=GET_TGS rhost=<remote host> username=<username> password=<passord> domain=<FQ domain name> spn=cifs/<HOSTNAME>.<FQ domain name>
Use
windows/smb/psexec
to verify the ticket is correctly picked up when thesmb::rhostname
option is set in lowercase.use windows/smb/psexec
run lhost=<local host> rhost=<remote host> username=<username> smb::auth=kerberos smb::rhostname=<hostname>.<FQ domain name> domaincontrollerrhost=<DC IP> domain=<FQ domain name> SMB::Krb5Ccname=<path of the service ticket generated before>
Scenarios
Get the Kerberos service ticket with
spn=cifs/DC01.newlab.local
(uppercase)Before this fix
Using
smb::rhostname=dc01.newlab.local
(lowercase)After this fix
Using
smb::rhostname=dc01.newlab.local
(lowercase)